Skip to content

ApiMethodContract<TParameters = unknown, TReturnValue = unknown>

The payload schemas for a single API method. Both halves are optional: a method may declare only its input, only its output, neither (the entry then just declares that the method must exist), or both.

Import:

import type { ApiMethodContract } from '@mnaoumov/typescript-lib/api-contract';

Signature:

export interface ApiMethodContract<TParameters = unknown, TReturnValue = unknown>

Properties

PropertyTypeDescription
input?StandardSchemaV1<unknown, TParameters>Validates the method's arguments, as an array.
output?StandardSchemaV1<unknown, TReturnValue>Validates the method's return value, or, when the method returns a thenable, the value it resolves to.

Links to this page: