zerot
    Preparing search index...

    Type Alias ContractCondition<TInput, TContext>

    ContractCondition: (
        input: TInput,
        context: TContext,
    ) => boolean | Promise<boolean> | ContractError | Promise<ContractError>

    Defines a contract condition function.

    Type Parameters

    • TInput = any

      The expected type of the input to the method.

    • TContext = any

      The expected type of the authentication context.

    Type declaration

      • (
            input: TInput,
            context: TContext,
        ): boolean | Promise<boolean> | ContractError | Promise<ContractError>
      • Parameters

        • input: TInput

          The input to the method.

        • context: TContext

          The authentication context.

        Returns boolean | Promise<boolean> | ContractError | Promise<ContractError>

        A boolean indicating if the condition passes, or a Promise resolving to a boolean, or a ContractError/Promise of ContractError if the condition fails with a specific error.