title | nav_order | permalink |
---|---|---|
Schema.ts |
11 |
/schema/ |
The schemata-ts schema type
Added in v1.0.0
Signature
export declare const isSchema: (u: unknown) => u is Schema<unknown, unknown>
Added in v2.0.0
Signature
export declare class SchemaImplementation<I, O> {
protected constructor(runSchema: <S extends hkt.SchemableLambda>(S: Schemable<S>) => hkt.SchemableKind<S, I, O>)
}
Added in v2.1.0
Signature
readonly [SchemaSymbol]: typeof SchemaSymbol
Added in v2.0.0
Signature
readonly input: (_: I) => I
Added in v2.0.0
Signature
readonly output: (_: O) => O
Added in v2.0.0
Signature
readonly runSchema: <S extends hkt.SchemableLambda>(S: Schemable<S>) => hkt.SchemableKind<S, I, O>
Added in v2.0.0
Signature
export interface Schema<I, O = I> {
readonly [SchemaSymbol]: SchemaSymbol
readonly input: (_: I) => I
readonly output: (_: O) => O
readonly runSchema: <S extends hkt.SchemableLambda>(S: Schemable<S>) => hkt.SchemableKind<S, I, O>
}
Added in v1.0.0
Extract the input type of a schema.
Signature
export type InputOf<S> = S extends Schema<infer I, any> ? I : never
Added in v1.0.0
Extract the output of a schema.
Alias of TypeOf
Signature
export type OutputOf<S> = TypeOf<S>
Added in v1.0.0
Extract the output of a schema
Signature
export type TypeOf<S> = S extends Schema<any, infer A> ? A : never
Added in v1.0.0
Signature
export declare const memoize: <A, B>(f: (a: A) => B) => (a: A) => B
Added in v1.0.0