UNPKG

1.1 kBTypeScriptView Raw
1/**
2 * **This module is experimental**
3 *
4 * Experimental features are published in order to get early feedback from the community, see these tracking
5 * [issues](https://github.com/gcanti/io-ts/issues?q=label%3Av2.2+) for further discussions and enhancements.
6 *
7 * A feature tagged as _Experimental_ is in a high state of flux, you're at risk of it changing without notice.
8 *
9 * @since 2.2.0
10 */
11import { HKT, Kind, Kind2, URIS, URIS2 } from 'fp-ts/es6/HKT'
12import { Schemable, Schemable1, Schemable2C } from './Schemable'
13/**
14 * @category model
15 * @since 2.2.0
16 */
17export interface Schema<A> {
18 <S>(S: Schemable<S>): HKT<S, A>
19}
20/**
21 * @category constructors
22 * @since 2.2.0
23 */
24export declare function make<A>(schema: Schema<A>): Schema<A>
25/**
26 * @since 2.2.0
27 */
28export declare type TypeOf<S> = S extends Schema<infer A> ? A : never
29/**
30 * @since 2.2.3
31 */
32export declare function interpreter<S extends URIS2>(
33 S: Schemable2C<S, unknown>
34): <A>(schema: Schema<A>) => Kind2<S, unknown, A>
35export declare function interpreter<S extends URIS>(S: Schemable1<S>): <A>(schema: Schema<A>) => Kind<S, A>
36
\No newline at end of file