@swastikbhattacharyya/next-actions - v0.3.2
    Preparing search index...

    Type Alias ValidationResult<OutputContext, ErrorMap>

    ValidationResult:
        | (
            OutputContext extends object
                ? { context: OutputContext; ok: true }
                : { ok: true }
        )
        | (
            ErrorMap extends object
                ? {
                    errorCode: keyof ErrorMap;
                    ok: false;
                    payload: ErrorMap[keyof ErrorMap];
                }
                : { ok: false }
        )

    Represents the result of a validation step.

    If validation succeeds, it returns ok: true and optionally includes additional context. If it fails, it returns ok: false along with an error code and payload as defined in ErrorMap.

    Type Parameters

    • OutputContext extends void | object

      Additional context injected into execution on success.

    • ErrorMap extends void | object

      A map where each key is an error code, and the corresponding value is the payload associated with that specific error.