TypedApiContract<TApi>
The ApiContract of a named API: one entry per function member, each typed against that member. Both schemas are REQUIRED here, so a typed contract is a full description of every signature and a {} entry does not compile. Only the loose form leaves them optional.
Import:
import type { TypedApiContract } from '@mnaoumov/typescript-lib/api-contract';Signature:
export type TypedApiContract<TApi extends object>Signature:
type TypedApiContract<TApi> = { readonly [TKey in ApiMethodName<TApi>]-?: TApi[TKey] extends (...arguments_: infer TParameters) => infer TReturnValue ? Required<ApiMethodContract<TParameters, Awaited<TReturnValue>>> : never;}Type: { readonly [TKey in ApiMethodName<TApi>]-?: TApi[TKey] extends (…arguments_: infer TParameters) => infer TReturnValue ? Required<ApiMethodContract<TParameters, Awaited<TReturnValue>>> : never; }
Links to this page: