@types/prop-types
Advanced tools
Comparing version 15.5.7 to 15.5.8
@@ -8,7 +8,11 @@ // Type definitions for prop-types 15.5 | ||
export type ReactComponentLike = | ||
| string | ||
| ((props: any, context?: any) => any) | ||
| (new (props: any, context?: any) => any); | ||
export interface ReactElementLike { | ||
type: string | ((...args: any[]) => ReactElementLike); | ||
type: ReactComponentLike; | ||
props: any; | ||
key: string | number | null; | ||
children?: ReactNodeLike; | ||
} | ||
@@ -32,5 +36,5 @@ | ||
export type RequiredKeys<V> = { [K in keyof V]: V[K] extends Validator<infer T> ? IsOptional<T> extends true ? never : K : never }[keyof V]; | ||
export type RequiredKeys<V> = { [K in keyof V]-?: Exclude<V[K], undefined> extends Validator<infer T> ? IsOptional<T> extends true ? never : K : never }[keyof V]; | ||
export type OptionalKeys<V> = Exclude<keyof V, RequiredKeys<V>>; | ||
export type InferPropsInner<V> = { [K in keyof V]: InferType<V[K]>; }; | ||
export type InferPropsInner<V> = { [K in keyof V]-?: InferType<V[K]>; }; | ||
@@ -50,4 +54,4 @@ export interface Validator<T> { | ||
export type InferProps<V> = | ||
& (RequiredKeys<V> extends undefined ? {} : InferPropsInner<Pick<V, RequiredKeys<V>>>) | ||
& (OptionalKeys<V> extends undefined ? {} : Partial<InferPropsInner<Pick<V, OptionalKeys<V>>>>); | ||
& InferPropsInner<Pick<V, RequiredKeys<V>>> | ||
& Partial<InferPropsInner<Pick<V, OptionalKeys<V>>>>; | ||
@@ -54,0 +58,0 @@ export const any: Requireable<any>; |
{ | ||
"name": "@types/prop-types", | ||
"version": "15.5.7", | ||
"version": "15.5.8", | ||
"description": "TypeScript definitions for prop-types", | ||
@@ -26,4 +26,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "a4bc5d33236effcfdbed1befbe90ef45317b1586b55897fd7e33369660888533", | ||
"typesPublisherContentHash": "79627fb9a29cb55f41f004816facc84485b90cd1a53633a372dd88a74a7df06f", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Fri, 07 Dec 2018 21:50:02 GMT | ||
* Last updated: Wed, 12 Dec 2018 19:18:24 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: none |
5974
70