An extension container.

Hierarchy

  • IExtensionContainer

Implemented by

Properties

isInitialized: boolean

Indicates that the container has been initialized. Adding new extensions is not possible.

Methods

  • Releases all related objects.

    Returns void

  • Initializes the extension container.

    Parameters

    • context: {
          diContainer: DiContainer;
      }

      Initialization context.

    Returns Promise<void>

  • Registers a specific extension in the container.

    Returns

    The current extension container.

    Type Parameters

    Parameters

    • params: {
          extension: (new (...params: unknown[]) => E);
          extensionName?: string;
          extensionType?: string;
          order?: number;
          singleton?: boolean;
          stage?: ExtensionStage;
          when?: ExtensionRegisterPredicate<E, ExtractExtensionContext<E>> | ExtensionRegisterPredicate<E, ExtractExtensionContext<E>>[];
      }

      Registration parameters.

      • extension: (new (...params: unknown[]) => E)
          • new (...params: unknown[]): E
          • The extension that needs to be registered in the container.

            Parameters

            • Rest ...params: unknown[]

            Returns E

      • Optional extensionName?: string

        Имя регистрируемого расширения.

      • Optional extensionType?: string

        Тип регистрируемого расширения.

      • Optional order?: number

        The order of execution, taking into account the type of extension and the stage of execution.

      • Optional singleton?: boolean

        A flag indicating the lifetime of an instance of extensions.

      • Optional stage?: ExtensionStage

        The stage of the extension execution in the extension chain.

      • Optional when?: ExtensionRegisterPredicate<E, ExtractExtensionContext<E>> | ExtensionRegisterPredicate<E, ExtractExtensionContext<E>>[]

        Function or array of functions that accept the context of extension execution and allowing extensions to be performed only under certain conditions. If `true', then the lifetime of the extension instance will coincide with the lifetime of the container.

    Returns IExtensionContainer

  • Returns an object that performs extensions of the specified type. The method never returns `null'. If the extension type has not been registered in the container, then the method does not throw an exception, but returns an object that does not perform actions.

    Returns

    An object that performs extensions of the specified type.

    Type Parameters

    Parameters

    • extension: string | (new (...params: unknown[]) => E)

      The type of extension to return the object for.

    • Optional options: null | ExtensionExecutorOptions

      Additional options for the returned object.

    Returns IExtensionExecutor<E>

Generated using TypeDoc