assemblyscript

Are namespaces supported by AssemblyScript?


Something like this:

export namespace Foo {
  export const MY_CONSTANT: u32 = 1;
}

And then using it like this:

const value = Foo.MY_CONSTANT;

Solution

  • Yes, namespaces are supported by AssemblyScript.

    export namespace Foo {
      export function doSomething(): string {
        return "I am doing something";
      }
    }