electron-ipc-module
    Preparing search index...

    Type Alias IpcChannelValidator<TArgs>

    IpcChannelValidator:
        | (
            (
                args: readonly unknown[],
                event: IpcMainEvent | IpcMainInvokeEvent,
                context: IpcChannelContext,
            ) => MaybePromise<void>
        )
        | StandardSchemaV1<readonly unknown[], TArgs>

    A runtime guard for one channel's payload — either a callback that throws to reject, or any Standard Schema (Zod, Valibot, ArkType, …).

    A schema's output replaces the arguments handed to the channel callback, so parsing and coercion carry through. TArgs is the callback's declared parameter tuple, which makes a schema that no longer matches its handler a compile error rather than a runtime surprise.

    A value carrying ~standard is always treated as a schema, even when it is also callable, so a callable schema is never mistaken for a callback.

    Type Parameters

    • TArgs extends readonly unknown[] = readonly unknown[]