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 |
|
8 | export = React;
|
9 | export as namespace React;
|
10 | declare namespace React {
|
11 |
|
12 | export import JSX = JSXInternal;
|
13 |
|
14 |
|
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 |
|
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 |
|
43 |
|
44 | export import Suspense = _Suspense.Suspense;
|
45 | export import lazy = _Suspense.lazy;
|
46 | export import SuspenseList = _SuspenseList.SuspenseList;
|
47 |
|
48 |
|
49 | export import StrictMode = preact.Fragment;
|
50 | export const version: string;
|
51 |
|
52 | export function createPortal(
|
53 | vnode: preact.VNode,
|
54 | container: Element
|
55 | ): preact.VNode<any>;
|
56 |
|
57 | export function render(
|
58 | vnode: preact.VNode<any>,
|
59 | parent: Element,
|
60 | callback?: () => void
|
61 | ): Component | null;
|
62 |
|
63 | export function hydrate(
|
64 | vnode: preact.VNode<any>,
|
65 | parent: Element,
|
66 | callback?: () => void
|
67 | ): Component | null;
|
68 |
|
69 | export function unmountComponentAtNode(
|
70 | container: Element | Document | ShadowRoot | DocumentFragment
|
71 | ): boolean;
|
72 |
|
73 | export function createFactory(
|
74 | type: preact.VNode<any>['type']
|
75 | ): (
|
76 | props?: any,
|
77 | ...children: preact.ComponentChildren[]
|
78 | ) => preact.VNode<any>;
|
79 | export function isValidElement(element: any): boolean;
|
80 | export function findDOMNode(component: preact.Component): Element | null;
|
81 |
|
82 | export abstract class PureComponent<P = {}, S = {}> extends preact.Component<
|
83 | P,
|
84 | S
|
85 | > {
|
86 | isPureReactComponent: boolean;
|
87 | }
|
88 |
|
89 | export function memo<P = {}>(
|
90 | component: preact.FunctionalComponent<P>,
|
91 | comparer?: (prev: P, next: P) => boolean
|
92 | ): preact.FunctionComponent<P>;
|
93 | export function memo<C extends preact.FunctionalComponent<any>>(
|
94 | component: C,
|
95 | comparer?: (
|
96 | prev: preact.ComponentProps<C>,
|
97 | next: preact.ComponentProps<C>
|
98 | ) => boolean
|
99 | ): C;
|
100 |
|
101 | export interface ForwardFn<P = {}, T = any> {
|
102 | (props: P, ref: Ref<T>): preact.ComponentChild;
|
103 | displayName?: string;
|
104 | }
|
105 |
|
106 | export function forwardRef<R, P = {}>(
|
107 | fn: ForwardFn<P, R>
|
108 | ): preact.FunctionalComponent<P>;
|
109 |
|
110 | export function unstable_batchedUpdates(
|
111 | callback: (arg?: any) => void,
|
112 | arg?: any
|
113 | ): void;
|
114 |
|
115 | export const Children: {
|
116 | map<T extends preact.ComponentChild, R>(
|
117 | children: T | T[],
|
118 | fn: (child: T, i: number) => R
|
119 | ): R[];
|
120 | forEach<T extends preact.ComponentChild>(
|
121 | children: T | T[],
|
122 | fn: (child: T, i: number) => void
|
123 | ): void;
|
124 | count: (children: preact.ComponentChildren) => number;
|
125 | only: (children: preact.ComponentChildren) => preact.ComponentChild;
|
126 | toArray: (children: preact.ComponentChildren) => preact.VNode<{}>[];
|
127 | };
|
128 | }
|