Comparing version 0.1.0 to 0.1.1
@@ -73,9 +73,8 @@ import { Either } from 'fp-ts/lib/Either'; | ||
}; | ||
export declare class InterfaceType<P extends Props> extends Type<{ | ||
export declare type InterfaceOf<P extends Props> = { | ||
[K in keyof P]: TypeOf<P[K]>; | ||
}> { | ||
}; | ||
export declare class InterfaceType<P extends Props> extends Type<InterfaceOf<P>> { | ||
readonly props: P; | ||
constructor(name: string, validate: Validate<{ | ||
[K in keyof P]: TypeOf<P[K]>; | ||
}>, props: P); | ||
constructor(name: string, validate: Validate<InterfaceOf<P>>, props: P); | ||
} | ||
@@ -82,0 +81,0 @@ declare function interfaceType<P extends Props>(props: P, name?: string): InterfaceType<P>; |
@@ -73,9 +73,8 @@ import { Either } from 'fp-ts/lib/Either'; | ||
}; | ||
export declare class InterfaceType<P extends Props> extends Type<{ | ||
export declare type InterfaceOf<P extends Props> = { | ||
[K in keyof P]: TypeOf<P[K]>; | ||
}> { | ||
}; | ||
export declare class InterfaceType<P extends Props> extends Type<InterfaceOf<P>> { | ||
readonly props: P; | ||
constructor(name: string, validate: Validate<{ | ||
[K in keyof P]: TypeOf<P[K]>; | ||
}>, props: P); | ||
constructor(name: string, validate: Validate<InterfaceOf<P>>, props: P); | ||
} | ||
@@ -82,0 +81,0 @@ declare function interfaceType<P extends Props>(props: P, name?: string): InterfaceType<P>; |
{ | ||
"name": "io-ts", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "TypeScript compatible runtime type system for IO validation", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -144,1 +144,32 @@ # The idea | ||
| recursive types | | `t.recursion(name, definition)` | | ||
# Known issues | ||
Due to an upstream [bug](https://github.com/Microsoft/TypeScript/issues/14041), VS Code might display weird types for nested interfaces | ||
```ts | ||
const NestedInterface = t.interface({ | ||
foo: t.interface({ | ||
bar: t.string | ||
}) | ||
}); | ||
type NestedInterfaceType = t.TypeOf<typeof NestedInterface>; | ||
/* | ||
Hover on NestedInterfaceType will display | ||
type NestedInterfaceType = { | ||
foo: t.InterfaceOf<{ | ||
bar: t.Type<string>; | ||
}>; | ||
} | ||
instead of | ||
type NestedInterfaceType = { | ||
foo: { | ||
bar: string; | ||
}; | ||
} | ||
*/ | ||
``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
162301
175
0
1311