Bixby Developer Center

Guides
References

as

optionalvalue required

Allows you to create an alias for a capsule that you import.

Example

    capsule-imports {
import (viv.core) {
as (core)
}
import (viv.self) {
as (self)
version (3.5.217)
}
import (viv.time) {
as (time)
version (3.1.102)
}
import (viv.money) {
as (money)
version (2.22.36)
}
}

View on GitHub

  capsule-imports {
import (viv.core) {
as (core)
}
import (viv.time) {
as (time)
version (3.1.48)
}
}

View on GitHub

...
capsule-imports {
import (example.flight) {
as (flight)
version (1.0.2)
}
...
Note

Aliases defined with as can only be used in the capsule that declares them, not in capsules that import them. That is, in the example above, if example.flight imports any capsules and declares aliases for them with as, you cannot use the aliases defined in example.flight in your capsule. If you need to do this, explicitly import the capsule using version-from to remain in sync with the higher-level capsule:

...
  capsule-imports {
    import (example.flight) {
      as (flight)
      version (1.0.2)
    }
    import (example.foobar) { 
      as (foobar) 
      version-from (flight)
    }
  }
...