isomorfeus-preact 10.6.11 → 10.6.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/browser/event.rb +2 -0
- data/lib/isomorfeus/preact_view_helper.rb +3 -2
- data/lib/isomorfeus/props/validate_hash_proxy.rb +1 -1
- data/lib/isomorfeus/props/validator.rb +6 -4
- data/lib/isomorfeus-preact.rb +3 -3
- data/lib/isomorfeus_preact/lucid_component/api.rb +1 -1
- data/lib/isomorfeus_preact/lucid_component/initializer.rb +2 -2
- data/lib/isomorfeus_preact/lucid_func/initializer.rb +1 -1
- data/lib/isomorfeus_preact/preact/function_component/initializer.rb +1 -1
- data/lib/preact/component/api.rb +1 -1
- data/lib/preact/component/callbacks.rb +6 -6
- data/lib/preact/component/initializer.rb +2 -2
- data/lib/preact/component/native_component_constructor.rb +1 -1
- data/lib/preact/props.rb +51 -0
- data/lib/preact/state.rb +67 -0
- data/lib/preact/version.rb +1 -1
- data/lib/preact.rb +2 -2
- data/node_modules/.package-lock.json +3 -3
- data/node_modules/preact/LICENSE +21 -21
- data/node_modules/preact/README.md +187 -187
- data/node_modules/preact/compat/dist/compat.js +1 -1
- data/node_modules/preact/compat/dist/compat.js.map +1 -1
- data/node_modules/preact/compat/dist/compat.mjs +1 -1
- data/node_modules/preact/compat/dist/compat.module.js +1 -1
- data/node_modules/preact/compat/dist/compat.module.js.map +1 -1
- data/node_modules/preact/compat/dist/compat.umd.js +1 -1
- data/node_modules/preact/compat/dist/compat.umd.js.map +1 -1
- data/node_modules/preact/compat/jsx-dev-runtime.js +1 -1
- data/node_modules/preact/compat/jsx-dev-runtime.mjs +1 -1
- data/node_modules/preact/compat/jsx-runtime.js +1 -1
- data/node_modules/preact/compat/jsx-runtime.mjs +1 -1
- data/node_modules/preact/compat/package.json +19 -19
- data/node_modules/preact/compat/scheduler.js +15 -15
- data/node_modules/preact/compat/scheduler.mjs +23 -23
- data/node_modules/preact/compat/server.js +15 -15
- data/node_modules/preact/compat/server.mjs +4 -4
- data/node_modules/preact/compat/src/Children.js +21 -21
- data/node_modules/preact/compat/src/PureComponent.js +15 -15
- data/node_modules/preact/compat/src/forwardRef.js +51 -51
- data/node_modules/preact/compat/src/index.d.ts +141 -141
- data/node_modules/preact/compat/src/index.js +187 -187
- data/node_modules/preact/compat/src/internal.d.ts +47 -47
- data/node_modules/preact/compat/src/memo.js +34 -34
- data/node_modules/preact/compat/src/portals.js +80 -80
- data/node_modules/preact/compat/src/render.js +229 -230
- data/node_modules/preact/compat/src/suspense-list.d.ts +14 -14
- data/node_modules/preact/compat/src/suspense-list.js +126 -126
- data/node_modules/preact/compat/src/suspense.d.ts +15 -15
- data/node_modules/preact/compat/src/suspense.js +270 -270
- data/node_modules/preact/compat/src/util.js +28 -28
- data/node_modules/preact/compat/test-utils.js +1 -1
- data/node_modules/preact/debug/dist/debug.js.map +1 -1
- data/node_modules/preact/debug/dist/debug.module.js.map +1 -1
- data/node_modules/preact/debug/dist/debug.umd.js.map +1 -1
- data/node_modules/preact/debug/package.json +18 -18
- data/node_modules/preact/debug/src/check-props.js +54 -54
- data/node_modules/preact/debug/src/component-stack.js +146 -146
- data/node_modules/preact/debug/src/constants.js +3 -3
- data/node_modules/preact/debug/src/debug.js +442 -442
- data/node_modules/preact/debug/src/index.js +6 -6
- data/node_modules/preact/debug/src/internal.d.ts +82 -82
- data/node_modules/preact/debug/src/util.js +11 -11
- data/node_modules/preact/devtools/dist/devtools.js +1 -1
- data/node_modules/preact/devtools/dist/devtools.js.map +1 -1
- data/node_modules/preact/devtools/dist/devtools.mjs +1 -1
- data/node_modules/preact/devtools/dist/devtools.module.js +1 -1
- data/node_modules/preact/devtools/dist/devtools.module.js.map +1 -1
- data/node_modules/preact/devtools/dist/devtools.umd.js +1 -1
- data/node_modules/preact/devtools/dist/devtools.umd.js.map +1 -1
- data/node_modules/preact/devtools/package.json +16 -16
- data/node_modules/preact/devtools/src/devtools.js +10 -10
- data/node_modules/preact/devtools/src/index.d.ts +8 -8
- data/node_modules/preact/devtools/src/index.js +15 -15
- data/node_modules/preact/dist/preact.js.map +1 -1
- data/node_modules/preact/dist/preact.min.js.map +1 -1
- data/node_modules/preact/dist/preact.module.js.map +1 -1
- data/node_modules/preact/dist/preact.umd.js.map +1 -1
- data/node_modules/preact/hooks/dist/hooks.js +1 -1
- data/node_modules/preact/hooks/dist/hooks.js.map +1 -1
- data/node_modules/preact/hooks/dist/hooks.mjs +1 -1
- data/node_modules/preact/hooks/dist/hooks.module.js +1 -1
- data/node_modules/preact/hooks/dist/hooks.module.js.map +1 -1
- data/node_modules/preact/hooks/dist/hooks.umd.js +1 -1
- data/node_modules/preact/hooks/dist/hooks.umd.js.map +1 -1
- data/node_modules/preact/hooks/package.json +26 -26
- data/node_modules/preact/hooks/src/index.d.ts +139 -139
- data/node_modules/preact/hooks/src/index.js +386 -388
- data/node_modules/preact/hooks/src/internal.d.ts +75 -75
- data/node_modules/preact/jsx-runtime/dist/jsxRuntime.js.map +1 -1
- data/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js.map +1 -1
- data/node_modules/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +1 -1
- data/node_modules/preact/jsx-runtime/package.json +19 -19
- data/node_modules/preact/jsx-runtime/src/index.d.ts +50 -50
- data/node_modules/preact/jsx-runtime/src/index.js +77 -77
- data/node_modules/preact/package.json +291 -287
- data/node_modules/preact/src/cjs.js +3 -3
- data/node_modules/preact/src/clone-element.js +34 -34
- data/node_modules/preact/src/component.js +225 -225
- data/node_modules/preact/src/constants.js +3 -3
- data/node_modules/preact/src/create-context.js +68 -68
- data/node_modules/preact/src/create-element.js +98 -98
- data/node_modules/preact/src/diff/catch-error.js +38 -38
- data/node_modules/preact/src/diff/children.js +335 -335
- data/node_modules/preact/src/diff/index.js +516 -516
- data/node_modules/preact/src/diff/props.js +158 -158
- data/node_modules/preact/src/index.d.ts +310 -310
- data/node_modules/preact/src/index.js +13 -13
- data/node_modules/preact/src/internal.d.ts +146 -146
- data/node_modules/preact/src/jsx.d.ts +1005 -1005
- data/node_modules/preact/src/options.js +16 -16
- data/node_modules/preact/src/render.js +75 -75
- data/node_modules/preact/src/util.js +27 -27
- data/node_modules/preact/test-utils/dist/testUtils.js.map +1 -1
- data/node_modules/preact/test-utils/dist/testUtils.module.js.map +1 -1
- data/node_modules/preact/test-utils/dist/testUtils.umd.js.map +1 -1
- data/node_modules/preact/test-utils/package.json +19 -19
- data/node_modules/preact/test-utils/src/index.d.ts +3 -3
- data/node_modules/preact/test-utils/src/index.js +117 -117
- data/package.json +1 -1
- metadata +8 -8
- data/lib/preact/component/props.rb +0 -55
- data/lib/preact/component/state.rb +0 -58
@@ -1,51 +1,51 @@
|
|
1
|
-
import { options } from 'preact';
|
2
|
-
import { assign } from './util';
|
3
|
-
|
4
|
-
let oldDiffHook = options._diff;
|
5
|
-
options._diff = vnode => {
|
6
|
-
if (vnode.type && vnode.type._forwarded && vnode.ref) {
|
7
|
-
vnode.props.ref = vnode.ref;
|
8
|
-
vnode.ref = null;
|
9
|
-
}
|
10
|
-
if (oldDiffHook) oldDiffHook(vnode);
|
11
|
-
};
|
12
|
-
|
13
|
-
export const REACT_FORWARD_SYMBOL =
|
14
|
-
(typeof Symbol != 'undefined' &&
|
15
|
-
Symbol.for &&
|
16
|
-
Symbol.for('react.forward_ref')) ||
|
17
|
-
0xf47;
|
18
|
-
|
19
|
-
/**
|
20
|
-
* Pass ref down to a child. This is mainly used in libraries with HOCs that
|
21
|
-
* wrap components. Using `forwardRef` there is an easy way to get a reference
|
22
|
-
* of the wrapped component instead of one of the wrapper itself.
|
23
|
-
* @param {import('./index').ForwardFn} fn
|
24
|
-
* @returns {import('./internal').FunctionComponent}
|
25
|
-
*/
|
26
|
-
export function forwardRef(fn) {
|
27
|
-
// We always have ref in props.ref, except for
|
28
|
-
// mobx-react. It will call this function directly
|
29
|
-
// and always pass ref as the second argument.
|
30
|
-
function Forwarded(props, ref) {
|
31
|
-
let clone = assign({}, props);
|
32
|
-
delete clone.ref;
|
33
|
-
ref = props.ref || ref;
|
34
|
-
return fn(
|
35
|
-
clone,
|
36
|
-
!ref || (typeof ref === 'object' && !('current' in ref)) ? null : ref
|
37
|
-
);
|
38
|
-
}
|
39
|
-
|
40
|
-
// mobx-react checks for this being present
|
41
|
-
Forwarded.$$typeof = REACT_FORWARD_SYMBOL;
|
42
|
-
// mobx-react heavily relies on implementation details.
|
43
|
-
// It expects an object here with a `render` property,
|
44
|
-
// and prototype.render will fail. Without this
|
45
|
-
// mobx-react throws.
|
46
|
-
Forwarded.render = Forwarded;
|
47
|
-
|
48
|
-
Forwarded.prototype.isReactComponent = Forwarded._forwarded = true;
|
49
|
-
Forwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';
|
50
|
-
return Forwarded;
|
51
|
-
}
|
1
|
+
import { options } from 'preact';
|
2
|
+
import { assign } from './util';
|
3
|
+
|
4
|
+
let oldDiffHook = options._diff;
|
5
|
+
options._diff = vnode => {
|
6
|
+
if (vnode.type && vnode.type._forwarded && vnode.ref) {
|
7
|
+
vnode.props.ref = vnode.ref;
|
8
|
+
vnode.ref = null;
|
9
|
+
}
|
10
|
+
if (oldDiffHook) oldDiffHook(vnode);
|
11
|
+
};
|
12
|
+
|
13
|
+
export const REACT_FORWARD_SYMBOL =
|
14
|
+
(typeof Symbol != 'undefined' &&
|
15
|
+
Symbol.for &&
|
16
|
+
Symbol.for('react.forward_ref')) ||
|
17
|
+
0xf47;
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Pass ref down to a child. This is mainly used in libraries with HOCs that
|
21
|
+
* wrap components. Using `forwardRef` there is an easy way to get a reference
|
22
|
+
* of the wrapped component instead of one of the wrapper itself.
|
23
|
+
* @param {import('./index').ForwardFn} fn
|
24
|
+
* @returns {import('./internal').FunctionComponent}
|
25
|
+
*/
|
26
|
+
export function forwardRef(fn) {
|
27
|
+
// We always have ref in props.ref, except for
|
28
|
+
// mobx-react. It will call this function directly
|
29
|
+
// and always pass ref as the second argument.
|
30
|
+
function Forwarded(props, ref) {
|
31
|
+
let clone = assign({}, props);
|
32
|
+
delete clone.ref;
|
33
|
+
ref = props.ref || ref;
|
34
|
+
return fn(
|
35
|
+
clone,
|
36
|
+
!ref || (typeof ref === 'object' && !('current' in ref)) ? null : ref
|
37
|
+
);
|
38
|
+
}
|
39
|
+
|
40
|
+
// mobx-react checks for this being present
|
41
|
+
Forwarded.$$typeof = REACT_FORWARD_SYMBOL;
|
42
|
+
// mobx-react heavily relies on implementation details.
|
43
|
+
// It expects an object here with a `render` property,
|
44
|
+
// and prototype.render will fail. Without this
|
45
|
+
// mobx-react throws.
|
46
|
+
Forwarded.render = Forwarded;
|
47
|
+
|
48
|
+
Forwarded.prototype.isReactComponent = Forwarded._forwarded = true;
|
49
|
+
Forwarded.displayName = 'ForwardRef(' + (fn.displayName || fn.name) + ')';
|
50
|
+
return Forwarded;
|
51
|
+
}
|
@@ -1,141 +1,141 @@
|
|
1
|
-
import * as _hooks from '../../hooks';
|
2
|
-
import * as preact from '../../src';
|
3
|
-
import { JSXInternal } from '../../src/jsx';
|
4
|
-
import * as _Suspense from './suspense';
|
5
|
-
import * as _SuspenseList from './suspense-list';
|
6
|
-
|
7
|
-
// export default React;
|
8
|
-
export = React;
|
9
|
-
export as namespace React;
|
10
|
-
declare namespace React {
|
11
|
-
// Export JSX
|
12
|
-
export import JSX = JSXInternal;
|
13
|
-
|
14
|
-
// Hooks
|
15
|
-
export import CreateHandle = _hooks.CreateHandle;
|
16
|
-
export import EffectCallback = _hooks.EffectCallback;
|
17
|
-
export import Inputs = _hooks.Inputs;
|
18
|
-
export import PropRef = _hooks.PropRef;
|
19
|
-
export import Reducer = _hooks.Reducer;
|
20
|
-
export import Ref = _hooks.Ref;
|
21
|
-
export import StateUpdater = _hooks.StateUpdater;
|
22
|
-
export import useCallback = _hooks.useCallback;
|
23
|
-
export import useContext = _hooks.useContext;
|
24
|
-
export import useDebugValue = _hooks.useDebugValue;
|
25
|
-
export import useEffect = _hooks.useEffect;
|
26
|
-
export import useImperativeHandle = _hooks.useImperativeHandle;
|
27
|
-
export import useLayoutEffect = _hooks.useLayoutEffect;
|
28
|
-
export import useMemo = _hooks.useMemo;
|
29
|
-
export import useReducer = _hooks.useReducer;
|
30
|
-
export import useRef = _hooks.useRef;
|
31
|
-
export import useState = _hooks.useState;
|
32
|
-
|
33
|
-
// Preact Defaults
|
34
|
-
export import Component = preact.Component;
|
35
|
-
export import FunctionComponent = preact.FunctionComponent;
|
36
|
-
export import FC = preact.FunctionComponent;
|
37
|
-
export import createContext = preact.createContext;
|
38
|
-
export import createRef = preact.createRef;
|
39
|
-
export import Fragment = preact.Fragment;
|
40
|
-
export import createElement = preact.createElement;
|
41
|
-
export import cloneElement = preact.cloneElement;
|
42
|
-
export import ComponentProps = preact.ComponentProps;
|
43
|
-
|
44
|
-
// Suspense
|
45
|
-
export import Suspense = _Suspense.Suspense;
|
46
|
-
export import lazy = _Suspense.lazy;
|
47
|
-
export import SuspenseList = _SuspenseList.SuspenseList;
|
48
|
-
|
49
|
-
// Compat
|
50
|
-
export import StrictMode = preact.Fragment;
|
51
|
-
export const version: string;
|
52
|
-
|
53
|
-
export function createPortal(
|
54
|
-
vnode: preact.VNode,
|
55
|
-
container: Element
|
56
|
-
): preact.VNode<any>;
|
57
|
-
|
58
|
-
export function render(
|
59
|
-
vnode: preact.VNode<any>,
|
60
|
-
parent: Element,
|
61
|
-
callback?: () => void
|
62
|
-
): Component | null;
|
63
|
-
|
64
|
-
export function hydrate(
|
65
|
-
vnode: preact.VNode<any>,
|
66
|
-
parent: Element,
|
67
|
-
callback?: () => void
|
68
|
-
): Component | null;
|
69
|
-
|
70
|
-
export function unmountComponentAtNode(
|
71
|
-
container: Element | Document | ShadowRoot | DocumentFragment
|
72
|
-
): boolean;
|
73
|
-
|
74
|
-
export function createFactory(
|
75
|
-
type: preact.VNode<any>['type']
|
76
|
-
): (
|
77
|
-
props?: any,
|
78
|
-
...children: preact.ComponentChildren[]
|
79
|
-
) => preact.VNode<any>;
|
80
|
-
export function isValidElement(element: any): boolean;
|
81
|
-
export function findDOMNode(component: preact.Component): Element | null;
|
82
|
-
|
83
|
-
export abstract class PureComponent<P = {}, S = {}> extends preact.Component<
|
84
|
-
P,
|
85
|
-
S
|
86
|
-
> {
|
87
|
-
isPureReactComponent: boolean;
|
88
|
-
}
|
89
|
-
|
90
|
-
export function memo<P = {}>(
|
91
|
-
component: preact.FunctionalComponent<P>,
|
92
|
-
comparer?: (prev: P, next: P) => boolean
|
93
|
-
): preact.FunctionComponent<P>;
|
94
|
-
export function memo<C extends preact.FunctionalComponent<any>>(
|
95
|
-
component: C,
|
96
|
-
comparer?: (
|
97
|
-
prev: preact.ComponentProps<C>,
|
98
|
-
next: preact.ComponentProps<C>
|
99
|
-
) => boolean
|
100
|
-
): C;
|
101
|
-
|
102
|
-
export interface ForwardFn<P = {}, T = any> {
|
103
|
-
(props: P, ref: Ref<T>): preact.ComponentChild;
|
104
|
-
displayName?: string;
|
105
|
-
}
|
106
|
-
|
107
|
-
export function forwardRef<R, P = {}>(
|
108
|
-
fn: ForwardFn<P, R>
|
109
|
-
): preact.FunctionalComponent<Omit<P, 'ref'> & { ref?: preact.Ref<R> }>;
|
110
|
-
|
111
|
-
export function unstable_batchedUpdates(
|
112
|
-
callback: (arg?: any) => void,
|
113
|
-
arg?: any
|
114
|
-
): void;
|
115
|
-
|
116
|
-
export const Children: {
|
117
|
-
map<T extends preact.ComponentChild, R>(
|
118
|
-
children: T | T[],
|
119
|
-
fn: (child: T, i: number) => R
|
120
|
-
): R[];
|
121
|
-
forEach<T extends preact.ComponentChild>(
|
122
|
-
children: T | T[],
|
123
|
-
fn: (child: T, i: number) => void
|
124
|
-
): void;
|
125
|
-
count: (children: preact.ComponentChildren) => number;
|
126
|
-
only: (children: preact.ComponentChildren) => preact.ComponentChild;
|
127
|
-
toArray: (children: preact.ComponentChildren) => preact.VNode<{}>[];
|
128
|
-
};
|
129
|
-
|
130
|
-
// scheduler
|
131
|
-
export const unstable_ImmediatePriority: number;
|
132
|
-
export const unstable_UserBlockingPriority: number;
|
133
|
-
export const unstable_NormalPriority: number;
|
134
|
-
export const unstable_LowPriority: number;
|
135
|
-
export const unstable_IdlePriority: number;
|
136
|
-
export function unstable_runWithPriority(
|
137
|
-
priority: number,
|
138
|
-
callback: () => void
|
139
|
-
): void;
|
140
|
-
export const unstable_now: () => number;
|
141
|
-
}
|
1
|
+
import * as _hooks from '../../hooks';
|
2
|
+
import * as preact from '../../src';
|
3
|
+
import { JSXInternal } from '../../src/jsx';
|
4
|
+
import * as _Suspense from './suspense';
|
5
|
+
import * as _SuspenseList from './suspense-list';
|
6
|
+
|
7
|
+
// export default React;
|
8
|
+
export = React;
|
9
|
+
export as namespace React;
|
10
|
+
declare namespace React {
|
11
|
+
// Export JSX
|
12
|
+
export import JSX = JSXInternal;
|
13
|
+
|
14
|
+
// Hooks
|
15
|
+
export import CreateHandle = _hooks.CreateHandle;
|
16
|
+
export import EffectCallback = _hooks.EffectCallback;
|
17
|
+
export import Inputs = _hooks.Inputs;
|
18
|
+
export import PropRef = _hooks.PropRef;
|
19
|
+
export import Reducer = _hooks.Reducer;
|
20
|
+
export import Ref = _hooks.Ref;
|
21
|
+
export import StateUpdater = _hooks.StateUpdater;
|
22
|
+
export import useCallback = _hooks.useCallback;
|
23
|
+
export import useContext = _hooks.useContext;
|
24
|
+
export import useDebugValue = _hooks.useDebugValue;
|
25
|
+
export import useEffect = _hooks.useEffect;
|
26
|
+
export import useImperativeHandle = _hooks.useImperativeHandle;
|
27
|
+
export import useLayoutEffect = _hooks.useLayoutEffect;
|
28
|
+
export import useMemo = _hooks.useMemo;
|
29
|
+
export import useReducer = _hooks.useReducer;
|
30
|
+
export import useRef = _hooks.useRef;
|
31
|
+
export import useState = _hooks.useState;
|
32
|
+
|
33
|
+
// Preact Defaults
|
34
|
+
export import Component = preact.Component;
|
35
|
+
export import FunctionComponent = preact.FunctionComponent;
|
36
|
+
export import FC = preact.FunctionComponent;
|
37
|
+
export import createContext = preact.createContext;
|
38
|
+
export import createRef = preact.createRef;
|
39
|
+
export import Fragment = preact.Fragment;
|
40
|
+
export import createElement = preact.createElement;
|
41
|
+
export import cloneElement = preact.cloneElement;
|
42
|
+
export import ComponentProps = preact.ComponentProps;
|
43
|
+
|
44
|
+
// Suspense
|
45
|
+
export import Suspense = _Suspense.Suspense;
|
46
|
+
export import lazy = _Suspense.lazy;
|
47
|
+
export import SuspenseList = _SuspenseList.SuspenseList;
|
48
|
+
|
49
|
+
// Compat
|
50
|
+
export import StrictMode = preact.Fragment;
|
51
|
+
export const version: string;
|
52
|
+
|
53
|
+
export function createPortal(
|
54
|
+
vnode: preact.VNode,
|
55
|
+
container: Element
|
56
|
+
): preact.VNode<any>;
|
57
|
+
|
58
|
+
export function render(
|
59
|
+
vnode: preact.VNode<any>,
|
60
|
+
parent: Element,
|
61
|
+
callback?: () => void
|
62
|
+
): Component | null;
|
63
|
+
|
64
|
+
export function hydrate(
|
65
|
+
vnode: preact.VNode<any>,
|
66
|
+
parent: Element,
|
67
|
+
callback?: () => void
|
68
|
+
): Component | null;
|
69
|
+
|
70
|
+
export function unmountComponentAtNode(
|
71
|
+
container: Element | Document | ShadowRoot | DocumentFragment
|
72
|
+
): boolean;
|
73
|
+
|
74
|
+
export function createFactory(
|
75
|
+
type: preact.VNode<any>['type']
|
76
|
+
): (
|
77
|
+
props?: any,
|
78
|
+
...children: preact.ComponentChildren[]
|
79
|
+
) => preact.VNode<any>;
|
80
|
+
export function isValidElement(element: any): boolean;
|
81
|
+
export function findDOMNode(component: preact.Component): Element | null;
|
82
|
+
|
83
|
+
export abstract class PureComponent<P = {}, S = {}> extends preact.Component<
|
84
|
+
P,
|
85
|
+
S
|
86
|
+
> {
|
87
|
+
isPureReactComponent: boolean;
|
88
|
+
}
|
89
|
+
|
90
|
+
export function memo<P = {}>(
|
91
|
+
component: preact.FunctionalComponent<P>,
|
92
|
+
comparer?: (prev: P, next: P) => boolean
|
93
|
+
): preact.FunctionComponent<P>;
|
94
|
+
export function memo<C extends preact.FunctionalComponent<any>>(
|
95
|
+
component: C,
|
96
|
+
comparer?: (
|
97
|
+
prev: preact.ComponentProps<C>,
|
98
|
+
next: preact.ComponentProps<C>
|
99
|
+
) => boolean
|
100
|
+
): C;
|
101
|
+
|
102
|
+
export interface ForwardFn<P = {}, T = any> {
|
103
|
+
(props: P, ref: Ref<T>): preact.ComponentChild;
|
104
|
+
displayName?: string;
|
105
|
+
}
|
106
|
+
|
107
|
+
export function forwardRef<R, P = {}>(
|
108
|
+
fn: ForwardFn<P, R>
|
109
|
+
): preact.FunctionalComponent<Omit<P, 'ref'> & { ref?: preact.Ref<R> }>;
|
110
|
+
|
111
|
+
export function unstable_batchedUpdates(
|
112
|
+
callback: (arg?: any) => void,
|
113
|
+
arg?: any
|
114
|
+
): void;
|
115
|
+
|
116
|
+
export const Children: {
|
117
|
+
map<T extends preact.ComponentChild, R>(
|
118
|
+
children: T | T[],
|
119
|
+
fn: (child: T, i: number) => R
|
120
|
+
): R[];
|
121
|
+
forEach<T extends preact.ComponentChild>(
|
122
|
+
children: T | T[],
|
123
|
+
fn: (child: T, i: number) => void
|
124
|
+
): void;
|
125
|
+
count: (children: preact.ComponentChildren) => number;
|
126
|
+
only: (children: preact.ComponentChildren) => preact.ComponentChild;
|
127
|
+
toArray: (children: preact.ComponentChildren) => preact.VNode<{}>[];
|
128
|
+
};
|
129
|
+
|
130
|
+
// scheduler
|
131
|
+
export const unstable_ImmediatePriority: number;
|
132
|
+
export const unstable_UserBlockingPriority: number;
|
133
|
+
export const unstable_NormalPriority: number;
|
134
|
+
export const unstable_LowPriority: number;
|
135
|
+
export const unstable_IdlePriority: number;
|
136
|
+
export function unstable_runWithPriority(
|
137
|
+
priority: number,
|
138
|
+
callback: () => void
|
139
|
+
): void;
|
140
|
+
export const unstable_now: () => number;
|
141
|
+
}
|