An object that performs extensions of the specified type.

interface IExtensionExecutor<E extends Extension> {
    length: number;
    dispose(): void;
    execute<M extends string | number | symbol, C extends unknown>(
        method: M,
        context: C,
    ): void;
    executeAsync<M extends string | number | symbol, C extends unknown>(
        method: M,
        context: C,
    ): Promise<void>;
    executeWithCheck<M extends string | number | symbol, C extends unknown>(
        method: M,
        context: C,
        showErrors?: boolean,
    ): ValidationResult;
    executeWithCheckAsync<
        M extends string
        | number
        | symbol,
        C extends unknown,
    >(
        method: M,
        context: C,
        showErrors?: boolean,
    ): Promise<ValidationResult>;
    getExtensions(context?: null | ExtractExtensionContext<E>): E[];
    getExtensionsAsync(
        context?: null | ExtractExtensionContext<E>,
    ): Promise<E[]>;
}

Type Parameters

Implemented by

Properties

length: number

The number of registered extensions of a certain type.

Methods

  • Releases all related objects.

    Returns void

  • Executes the specified method synchronously for all registered extensions of a certain type.

    Type Parameters

    • M extends string | number | symbol
    • C extends unknown

    Parameters

    • method: M

      An extension method that can be executed.

    • context: C

      Parameter of the executed method passed between extensions.

    Returns void

  • Executes the specified method asynchronously for all registered extensions of a certain type.

    Type Parameters

    • M extends string | number | symbol
    • C extends unknown

    Parameters

    • method: M

      An extension method that can be executed.

    • context: C

      Parameter of the executed method passed between extensions.

    Returns Promise<void>

  • Executes the specified method asynchronously for all registered extensions of a certain type and intercepts all exceptions during method execution.

    Type Parameters

    • M extends string | number | symbol
    • C extends unknown

    Parameters

    • method: M

      An extension method that can be executed.

    • context: C

      Parameter of the executed method passed between extensions.

    • OptionalshowErrors: boolean

      Flag indicating the need to handle errors when they occur according to the settings of the execution object. For example, to output errors to the user.

    Returns ValidationResult

    The result of executing the specified method for all registered extensions of a certain type.

  • Executes the specified method asynchronously for all registered extensions of a certain type and intercepts all exceptions during method execution.

    Type Parameters

    • M extends string | number | symbol
    • C extends unknown

    Parameters

    • method: M

      An extension method that can be executed.

    • context: C

      Parameter of the executed method passed between extensions.

    • OptionalshowErrors: boolean

      Flag indicating the need to handle errors when they occur according to the settings of the execution object. For example, to output errors to the user.

    Returns Promise<ValidationResult>

    The result of executing the specified method for all registered extensions of a certain type.

  • Returns all extensions registered by extensions of a certain type taking into account the passed parameter of the executed method.

    Parameters

    Returns E[]

    All extensions registered extensions of a certain type.

  • Returns all extensions registered by extensions of a certain type taking into account the passed parameter of the executed method.

    Parameters

    Returns Promise<E[]>

    All extensions registered extensions of a certain type.

MMNEPVFCICPMFPCPTTAAATR