UNPKG

495 BTypeScriptView Raw
1/**
2 * @since 0.5.0
3 */
4import * as t from 'io-ts'
5/**
6 * @since 0.5.0
7 */
8export interface DateFromNumberC extends t.Type<Date, number, unknown> {}
9/**
10 * @example
11 * import { DateFromNumber } from 'io-ts-types/lib/DateFromNumber'
12 * import { right } from 'fp-ts/lib/Either'
13 *
14 * const date = new Date(1973, 10, 30)
15 * const input = date.getTime()
16 * assert.deepStrictEqual(DateFromNumber.decode(input), right(date))
17 *
18 * @since 0.5.0
19 */
20export declare const DateFromNumber: DateFromNumberC