@peersyst/react-types
Advanced tools
Comparing version 1.5.1 to 1.5.2
# Versions | ||
## 1.5.2 | ||
[ReactChild] Add `ReactChild` type as it is deprecated in the react package | ||
## 1.3.4 | ||
@@ -4,0 +8,0 @@ |
@@ -1,4 +0,7 @@ | ||
import { CSSProperties } from "react"; | ||
import { CSSProperties, ReactElement } from "react"; | ||
/** | ||
* REACT TYPES | ||
*/ | ||
/** | ||
* Generates a type that passes some styling props to be evaluated and | ||
@@ -9,3 +12,8 @@ * generate a style or a simple style ignoring passed props. | ||
export type ReactChild = ReactElement | string | number; | ||
/** | ||
* COMMON TYPES | ||
*/ | ||
/** | ||
* Generate a set of string literal types with the given default record `T` and | ||
@@ -17,4 +25,6 @@ * override record `U`. | ||
*/ | ||
export type OverridableStringUnion<T extends string | number, U = Record<string, any>> = | ||
GenerateStringUnion<Overwrite<Record<T, true>, U>>; | ||
export type OverridableStringUnion< | ||
T extends string | number, | ||
U = Record<string, any>, | ||
> = GenerateStringUnion<Overwrite<Record<T, true>, U>>; | ||
@@ -130,10 +140,12 @@ /** | ||
type FlattenedNestedKeys<T extends object> = FlattenedCoreNestedKeys<T>; | ||
type FlattenedCoreNestedKeys<T extends object, I extends number = MaxRecursiveIterations> = | ||
I extends 0 | ||
? never | ||
: { | ||
[Key in keyof T]: T[Key] extends object | ||
? `${Key}.${CoreNestedKeys<T[Key], Iterations[I]>}` | ||
: Key; | ||
}[Extract<keyof T, string>]; | ||
type FlattenedCoreNestedKeys< | ||
T extends object, | ||
I extends number = MaxRecursiveIterations, | ||
> = I extends 0 | ||
? never | ||
: { | ||
[Key in keyof T]: T[Key] extends object | ||
? `${Key}.${CoreNestedKeys<T[Key], Iterations[I]>}` | ||
: Key; | ||
}[Extract<keyof T, string>]; | ||
@@ -144,7 +156,10 @@ /** | ||
type DeepPick<T extends object, K extends NestedKeys<T>> = CoreDeepPick<T, K>; | ||
type CoreDeepPick<T extends object, K extends string, I extends number = MaxRecursiveIterations> = | ||
I extends 0 | ||
? never | ||
: K extends `${infer FirstKey}.${infer RestKey}` | ||
? CoreDeepPick<T[FirstKey], RestKey, Iterations[I]> | ||
: T[K]; | ||
type CoreDeepPick< | ||
T extends object, | ||
K extends string, | ||
I extends number = MaxRecursiveIterations, | ||
> = I extends 0 | ||
? never | ||
: K extends `${infer FirstKey}.${infer RestKey}` | ||
? CoreDeepPick<T[FirstKey], RestKey, Iterations[I]> | ||
: T[K]; |
{ | ||
"name": "@peersyst/react-types", | ||
"author": "Peersyst", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "types": "./index.d.ts", |
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
6083
140