summaryrefslogtreecommitdiff
path: root/preact/compat/src/internal.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'preact/compat/src/internal.d.ts')
-rw-r--r--preact/compat/src/internal.d.ts47
1 files changed, 47 insertions, 0 deletions
diff --git a/preact/compat/src/internal.d.ts b/preact/compat/src/internal.d.ts
new file mode 100644
index 0000000..cb68ffa
--- /dev/null
+++ b/preact/compat/src/internal.d.ts
@@ -0,0 +1,47 @@
+import {
+ Component as PreactComponent,
+ VNode as PreactVNode,
+ FunctionComponent as PreactFunctionComponent
+} from '../../src/internal';
+import { SuspenseProps } from './suspense';
+
+export { ComponentChildren } from '../..';
+
+export { PreactElement } from '../../src/internal';
+
+export interface Component<P = {}, S = {}> extends PreactComponent<P, S> {
+ isReactComponent?: object;
+ isPureReactComponent?: true;
+ _patchedLifecycles?: true;
+
+ // Suspense internal properties
+ _childDidSuspend?(error: Promise<void>, suspendingVNode: VNode): void;
+ _suspended: (vnode: VNode) => (unsuspend: () => void) => void;
+ _onResolve?(): void;
+
+ // Portal internal properties
+ _temp: any;
+ _container: PreactElement;
+}
+
+export interface FunctionComponent<P = {}> extends PreactFunctionComponent<P> {
+ shouldComponentUpdate?(nextProps: Readonly<P>): boolean;
+ _forwarded?: boolean;
+ _patchedLifecycles?: true;
+}
+
+export interface VNode<T = any> extends PreactVNode<T> {
+ $$typeof?: symbol | string;
+ preactCompatNormalized?: boolean;
+}
+
+export interface SuspenseState {
+ _suspended?: null | VNode<any>;
+}
+
+export interface SuspenseComponent
+ extends PreactComponent<SuspenseProps, SuspenseState> {
+ _pendingSuspensionCount: number;
+ _suspenders: Component[];
+ _detachOnNextRender: null | VNode<any>;
+}