Class EsClass<TArgs>

Mutable class representation.

Class identified by unique symbol and has members.

Type Param

Type of class symbol naming.

Type Param

Type of class symbol.

Type Parameters

  • out TArgs extends Args = Args

    Type of class constructor arguments definition.

Hierarchy

  • EsClass

Implements

Constructors

Accessors

Methods

  • Adds class member.

    Called typically by member declaration method.

    Type Parameters

    • TMember extends EsMember<THandle>

      Member type.

    • THandle = HandleOf<TMember>

      Type of member handle.

    Parameters

    • member: TMember

      Member to add.

    • handle: THandle

      Member handle.

    • declaration: EsSnippet

    Returns EsMemberRef<TMember, THandle>

    Declared member reference.

    Throw

    TypeError if the member already declared in this class.

  • Searches for the member declaration.

    Type Parameters

    • TMember extends EsMember<THandle>

      Member type.

    • THandle = HandleOf<TMember>

      Handle type.

    Parameters

    • member: TMember

      Member to find.

    Returns undefined | EsMemberRef<TMember, THandle>

    Either found member reference, or undefined if the member neither declared in this class, nor in one of its base classes.

  • Obtains member's handle.

    Type Parameters

    • TMember extends EsMember<THandle>

      Member type.

    • THandle = HandleOf<TMember>

      Handle type.

    Parameters

    • member: TMember

      Member to access.

    Returns THandle

    Member handle, either declared in this class, or derived from the base one.

    Throws

    ReferenceError if the member is neither declared in this class, nor derived from one of the base ones.

  • Iterates over class members.

    Parameters

    • Optional filter: {
          derived?: boolean;
          visibility?: "all" | "private" | "public";
      }

      Optional member filter.

      • Optional Readonly derived?: boolean

        Whether to include members derived from the base class and not overridden in this one.

        Default Value

        true

      • Optional Readonly visibility?: "all" | "private" | "public"

        Members visibility.

        Either public to include only public members, private to include only private members, or all to include all members.

        Default Value

        all.

    Returns IterableIterator<EsMemberRef<EsAnyMember, any>>

    Iterable iterator of matching members.

Generated using TypeDoc