UNPKG

896 BTypeScriptView Raw
1/**
2 * @since 0.5.11
3 */
4import * as t from 'io-ts'
5/**
6 * @since 0.5.11
7 */
8export interface BigIntFromStringC extends t.Type<bigint, string, unknown> {}
9/**
10 * @example
11 * import { BigIntFromString } from 'io-ts-types/lib/BigIntFromString'
12 * import { right } from 'fp-ts/lib/Either'
13 * import { PathReporter } from 'io-ts/lib/PathReporter'
14 *
15 * assert.deepStrictEqual(BigIntFromString.decode('1'), right(BigInt(1)))
16 * assert.deepStrictEqual(PathReporter.report(BigIntFromString.decode('1.1')), ['Invalid value "1.1" supplied to : BigIntFromString'])
17 * assert.deepStrictEqual(PathReporter.report(BigIntFromString.decode('')), ['Invalid value "" supplied to : BigIntFromString'])
18 * assert.deepStrictEqual(PathReporter.report(BigIntFromString.decode(' ')), ['Invalid value " " supplied to : BigIntFromString'])
19 *
20 * @since 0.5.11
21 */
22export declare const BigIntFromString: BigIntFromStringC