File tree Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Expand file tree Collapse file tree 4 files changed +30
-3
lines changed Original file line number Diff line number Diff line change @@ -3659,6 +3659,16 @@ export interface ReactBasedUiSystem {
3659
3659
3660
3660
// @public (undocumented)
3661
3661
export namespace ReactEcs {
3662
+ // (undocumented)
3663
+ export type DependencyList = ReadonlyArray <any >;
3664
+ const // (undocumented)
3665
+ createElement : any ;
3666
+ // (undocumented)
3667
+ export type Dispatch <T > = (action : SetStateAction <T >) => void ;
3668
+ // (undocumented)
3669
+ export type EffectCallback = () => void | (() => void | undefined );
3670
+ // (undocumented)
3671
+ export type EffectHook = (effect : EffectCallback , deps ? : DependencyList ) => void ;
3662
3672
// (undocumented)
3663
3673
export namespace JSX {
3664
3674
export interface Component {
@@ -3671,8 +3681,15 @@ export namespace ReactEcs {
3671
3681
// (undocumented)
3672
3682
export type ReactNode = Element | ReactElement | string | number | boolean | null | undefined | ReactNode [];
3673
3683
}
3684
+ // (undocumented)
3685
+ export type SetStateAction <T > = T | ((prevState : T ) => T );
3686
+ // (undocumented)
3687
+ export type StateHook = <T >(initialState : T | (() => T )) => [T , Dispatch <T >];
3674
3688
const // (undocumented)
3675
- createElement : any ;
3689
+ useEffect : EffectHook ;
3690
+ const // (undocumented)
3691
+ useState : StateHook ;
3692
+ {};
3676
3693
}
3677
3694
3678
3695
// Warning: (tsdoc-at-sign-in-word) The "@" character looks like part of a TSDoc tag; use a backslash to escape it
Original file line number Diff line number Diff line change @@ -74,4 +74,14 @@ export namespace ReactEcs {
74
74
export interface Component { }
75
75
}
76
76
export const createElement = ( React as any ) . createElement
77
+ type SetStateAction < T > = T | ( ( prevState : T ) => T )
78
+ type Dispatch < T > = ( action : SetStateAction < T > ) => void
79
+ type StateHook = < T > ( initialState : T | ( ( ) => T ) ) => [ T , Dispatch < T > ]
80
+
81
+ // Type for useEffect
82
+ type DependencyList = ReadonlyArray < any >
83
+ type EffectCallback = ( ) => void | ( ( ) => void | undefined )
84
+ type EffectHook = ( effect : EffectCallback , deps ?: DependencyList ) => void
85
+ export const useEffect : EffectHook = ( React as any ) . useEffect
86
+ export const useState : StateHook = ( React as any ) . useState
77
87
}
Original file line number Diff line number Diff line change @@ -65,4 +65,4 @@ CALL onUpdate(0.1)
65
65
OPCODES ~= 65k
66
66
MALLOC_COUNT = 0
67
67
ALIVE_OBJS_DELTA ~= 0.00k
68
- MEMORY_USAGE_COUNT ~= 1708.06k bytes
68
+ MEMORY_USAGE_COUNT ~= 1708.08k bytes
You can’t perform that action at this time.
0 commit comments