forked from gcanti/io-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
648 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
title: DecoderError.ts | ||
nav_order: 3 | ||
parent: Modules | ||
--- | ||
|
||
## DecoderError overview | ||
|
||
Added in v2.2.7 | ||
|
||
--- | ||
|
||
<h2 class="text-delta">Table of contents</h2> | ||
|
||
- [constructors](#constructors) | ||
- [leaf](#leaf) | ||
- [required](#required) | ||
- [destructors](#destructors) | ||
- [fold](#fold) | ||
- [instances](#instances) | ||
- [getSemigroup](#getsemigroup) | ||
- [model](#model) | ||
- [DecodeError (type alias)](#decodeerror-type-alias) | ||
- [Leaf (interface)](#leaf-interface) | ||
- [Required (interface)](#required-interface) | ||
|
||
--- | ||
|
||
# constructors | ||
|
||
## leaf | ||
|
||
**Signature** | ||
|
||
```ts | ||
export declare const leaf: (input: unknown, error: string) => DecodeError | ||
``` | ||
Added in v2.2.7 | ||
## required | ||
**Signature** | ||
```ts | ||
export declare const required: (key: string, errors: FS.FreeSemigroup<DecodeError>) => DecodeError | ||
``` | ||
Added in v2.2.7 | ||
# destructors | ||
## fold | ||
**Signature** | ||
```ts | ||
export declare const fold: <R>(patterns: { | ||
Leaf: (input: unknown, error: string) => R | ||
Required: (k: string, errors: FS.FreeSemigroup<DecodeError>) => R | ||
}) => (e: DecodeError) => R | ||
``` | ||
Added in v2.2.7 | ||
# instances | ||
## getSemigroup | ||
**Signature** | ||
```ts | ||
export declare function getSemigroup(): Semigroup<FS.FreeSemigroup<DecodeError>> | ||
``` | ||
|
||
Added in v2.2.7 | ||
|
||
# model | ||
|
||
## DecodeError (type alias) | ||
|
||
**Signature** | ||
|
||
```ts | ||
export type DecodeError = Leaf | Required | ||
``` | ||
|
||
Added in v2.2.7 | ||
|
||
## Leaf (interface) | ||
|
||
**Signature** | ||
|
||
```ts | ||
export interface Leaf { | ||
readonly _tag: 'Leaf' | ||
readonly input: unknown | ||
readonly error: string | ||
} | ||
``` | ||
|
||
Added in v2.2.7 | ||
|
||
## Required (interface) | ||
|
||
**Signature** | ||
|
||
```ts | ||
export interface Required { | ||
readonly _tag: 'Required' | ||
readonly key: string | ||
readonly errors: FS.FreeSemigroup<DecodeError> | ||
} | ||
``` | ||
|
||
Added in v2.2.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: DecoderT.ts | ||
nav_order: 3 | ||
nav_order: 4 | ||
parent: Modules | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Encoder.ts | ||
nav_order: 4 | ||
nav_order: 5 | ||
parent: Modules | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Eq.ts | ||
nav_order: 5 | ||
nav_order: 6 | ||
parent: Modules | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
title: FreeDecoder.ts | ||
nav_order: 7 | ||
parent: Modules | ||
--- | ||
|
||
## FreeDecoder overview | ||
|
||
Added in v2.2.7 | ||
|
||
--- | ||
|
||
<h2 class="text-delta">Table of contents</h2> | ||
|
||
- [utils](#utils) | ||
- [FreeDecoder (interface)](#freedecoder-interface) | ||
- [UnknownRecord](#unknownrecord) | ||
- [number](#number) | ||
- [string](#string) | ||
- [toForest](#toforest) | ||
- [type](#type) | ||
|
||
--- | ||
|
||
# utils | ||
|
||
## FreeDecoder (interface) | ||
|
||
**Signature** | ||
|
||
```ts | ||
export interface FreeDecoder<A> extends DT.DecoderT<E.URI, FS.FreeSemigroup<DE.DecodeError>, A> {} | ||
``` | ||
|
||
Added in v2.2.7 | ||
|
||
## UnknownRecord | ||
|
||
**Signature** | ||
|
||
```ts | ||
export declare const UnknownRecord: FreeDecoder<Record<string, unknown>> | ||
``` | ||
Added in v2.2.7 | ||
## number | ||
**Signature** | ||
```ts | ||
export declare const number: FreeDecoder<number> | ||
``` | ||
Added in v2.2.7 | ||
## string | ||
**Signature** | ||
```ts | ||
export declare const string: FreeDecoder<string> | ||
``` | ||
Added in v2.2.7 | ||
## toForest | ||
**Signature** | ||
```ts | ||
export declare function toForest(s: FS.FreeSemigroup<DE.DecodeError>): NEA.NonEmptyArray<T.Tree<string>> | ||
``` | ||
|
||
Added in v2.2.7 | ||
|
||
## type | ||
|
||
**Signature** | ||
|
||
```ts | ||
export declare const type: <A>( | ||
properties: { [K in keyof A]: FreeDecoder<A[K]> } | ||
) => FreeDecoder<{ [K in keyof A]: A[K] }> | ||
``` | ||
|
||
Added in v2.2.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
--- | ||
title: FreeSemigroup.ts | ||
nav_order: 8 | ||
parent: Modules | ||
--- | ||
|
||
## FreeSemigroup overview | ||
|
||
Added in v2.2.7 | ||
|
||
--- | ||
|
||
<h2 class="text-delta">Table of contents</h2> | ||
|
||
- [consrtuctors](#consrtuctors) | ||
- [concat](#concat) | ||
- [of](#of) | ||
- [destructors](#destructors) | ||
- [fold](#fold) | ||
- [instances](#instances) | ||
- [getSemigroup](#getsemigroup) | ||
- [model](#model) | ||
- [Concat (interface)](#concat-interface) | ||
- [FreeSemigroup (type alias)](#freesemigroup-type-alias) | ||
- [Of (interface)](#of-interface) | ||
|
||
--- | ||
|
||
# consrtuctors | ||
|
||
## concat | ||
|
||
**Signature** | ||
|
||
```ts | ||
export declare const concat: <A>(left: FreeSemigroup<A>, right: FreeSemigroup<A>) => FreeSemigroup<A> | ||
``` | ||
Added in v2.2.7 | ||
## of | ||
**Signature** | ||
```ts | ||
export declare const of: <A>(a: A) => FreeSemigroup<A> | ||
``` | ||
Added in v2.2.7 | ||
# destructors | ||
## fold | ||
**Signature** | ||
```ts | ||
export declare const fold: <A, R>( | ||
onOf: (value: A) => R, | ||
onConcat: (left: FreeSemigroup<A>, right: FreeSemigroup<A>) => R | ||
) => (f: FreeSemigroup<A>) => R | ||
``` | ||
Added in v2.2.7 | ||
# instances | ||
## getSemigroup | ||
**Signature** | ||
```ts | ||
export declare function getSemigroup<A = never>(): Semigroup<FreeSemigroup<A>> | ||
``` | ||
|
||
Added in v2.2.7 | ||
|
||
# model | ||
|
||
## Concat (interface) | ||
|
||
**Signature** | ||
|
||
```ts | ||
export interface Concat<A> { | ||
readonly _tag: 'Concat' | ||
readonly left: FreeSemigroup<A> | ||
readonly right: FreeSemigroup<A> | ||
} | ||
``` | ||
|
||
Added in v2.2.7 | ||
|
||
## FreeSemigroup (type alias) | ||
|
||
**Signature** | ||
|
||
```ts | ||
export type FreeSemigroup<A> = Of<A> | Concat<A> | ||
``` | ||
|
||
Added in v2.2.7 | ||
|
||
## Of (interface) | ||
|
||
**Signature** | ||
|
||
```ts | ||
export interface Of<A> { | ||
readonly _tag: 'Of' | ||
readonly value: A | ||
} | ||
``` | ||
|
||
Added in v2.2.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Guard.ts | ||
nav_order: 6 | ||
nav_order: 9 | ||
parent: Modules | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: JsonCodec.ts | ||
nav_order: 8 | ||
nav_order: 11 | ||
parent: Modules | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: JsonEncoder.ts | ||
nav_order: 9 | ||
nav_order: 12 | ||
parent: Modules | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: PathReporter.ts | ||
nav_order: 10 | ||
nav_order: 13 | ||
parent: Modules | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Reporter.ts | ||
nav_order: 11 | ||
nav_order: 14 | ||
parent: Modules | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
title: Schema.ts | ||
nav_order: 12 | ||
nav_order: 15 | ||
parent: Modules | ||
--- | ||
|
||
|
Oops, something went wrong.