kkrpc
    Preparing search index...

    Interface DefinedMethod<InputSchema, OutputSchema>

    The type of a function created by defineMethod().

    It is both callable (the handler) and carries ~validators metadata. The function signature is inferred from the schemas:

    • If the input schema's output type is a tuple, args are spread
    • Otherwise the schema output is wrapped in a single-element tuple

    extractValidators() reads the [~validators] property to build the validators map that RPCChannel needs.

    interface DefinedMethod<
        InputSchema extends StandardSchemaV1<any, any>,
        OutputSchema extends StandardSchemaV1<any, any>,
    > {
        "~validators": { input: InputSchema; output: OutputSchema };
        (
            ...args: InferOutput<InputSchema> extends readonly any[]
                ? InferOutput<InferOutput<InputSchema>>
                : [InferOutput<InputSchema>],
        ): Promise<InferOutput<OutputSchema>>;
    }

    Type Parameters

    Index

    Properties

    Properties

    "~validators": { input: InputSchema; output: OutputSchema }