@hrnec06/util 1.6.1 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/types.d.ts +3 -0
- package/dist/esm/types.d.ts +3 -0
- package/package.json +1 -1
package/dist/cjs/types.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export type Nullable<T> = T | null;
|
|
|
4
4
|
export type Promiseable<T> = T | Promise<T>;
|
|
5
5
|
export type Voidable<T> = T | void;
|
|
6
6
|
export type CanBeReadonly<T> = T | Readonly<T>;
|
|
7
|
+
export type NonOptional<T> = Exclude<T, undefined>;
|
|
8
|
+
export type NonNullable<T> = Exclude<T, null>;
|
|
7
9
|
export type Vector2<T = number> = [T, T];
|
|
8
10
|
export type Vector3<T = number> = [T, T, T];
|
|
9
11
|
export type Primitive = string | number | boolean;
|
|
@@ -34,4 +36,5 @@ export type ClassInitializer<C extends abstract new (...args: any) => any, Stric
|
|
|
34
36
|
export declare namespace ReactUtils {
|
|
35
37
|
type SetState<T> = React.Dispatch<React.SetStateAction<T>>;
|
|
36
38
|
type State<T> = [T, SetState<T>];
|
|
39
|
+
type Props<Interface, Element extends Nullable<HTMLElement> = null> = Interface & (Element extends null ? {} : Omit<React.HTMLProps<Element>, keyof Interface>);
|
|
37
40
|
}
|
package/dist/esm/types.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export type Nullable<T> = T | null;
|
|
|
4
4
|
export type Promiseable<T> = T | Promise<T>;
|
|
5
5
|
export type Voidable<T> = T | void;
|
|
6
6
|
export type CanBeReadonly<T> = T | Readonly<T>;
|
|
7
|
+
export type NonOptional<T> = Exclude<T, undefined>;
|
|
8
|
+
export type NonNullable<T> = Exclude<T, null>;
|
|
7
9
|
export type Vector2<T = number> = [T, T];
|
|
8
10
|
export type Vector3<T = number> = [T, T, T];
|
|
9
11
|
export type Primitive = string | number | boolean;
|
|
@@ -34,4 +36,5 @@ export type ClassInitializer<C extends abstract new (...args: any) => any, Stric
|
|
|
34
36
|
export declare namespace ReactUtils {
|
|
35
37
|
type SetState<T> = React.Dispatch<React.SetStateAction<T>>;
|
|
36
38
|
type State<T> = [T, SetState<T>];
|
|
39
|
+
type Props<Interface, Element extends Nullable<HTMLElement> = null> = Interface & (Element extends null ? {} : Omit<React.HTMLProps<Element>, keyof Interface>);
|
|
37
40
|
}
|