| string;
props: P & { children: ComponentChildren };
key: Key;
ref: Ref | null;
/**
* The time this `vnode` started rendering. Will only be set when
* the devtools are attached.
* Default value: `0`
*/
startTime?: number;
/**
* The time that the rendering of this `vnode` was completed. Will only be
* set when the devtools are attached.
* Default value: `-1`
*/
endTime?: number;
}
//
// Preact Component interface
// -----------------------------------
type Key = string | number | any;
type RefObject = { current?: T | null };
type RefCallback = (instance: T | null) => void;
type Ref = RefObject | RefCallback;
type ComponentChild =
| VNode
| object
| string
| number
| boolean
| null
| undefined;
type ComponentChildren = ComponentChild[] | ComponentChild;
interface Attributes {
key?: Key;
jsx?: boolean;
}
interface ClassAttributes extends Attributes {
ref?: Ref;
}
interface PreactDOMAttributes {
children?: ComponentChildren;
dangerouslySetInnerHTML?: {
__html: string;
};
}
type RenderableProps
= Readonly<
P & Attributes & { children?: ComponentChildren; ref?: Ref }
>;
type ComponentType
,
previousState: Readonly,
snapshot: any
): void;
componentDidCatch?(error: any, errorInfo: any): void;
}
abstract class Component
{
constructor(props?: P, context?: any);
static displayName?: string;
static defaultProps?: any;
static contextType?: Context;
// Static members cannot reference class type parameters. This is not
// supported in TypeScript. Reusing the same type arguments from `Component`
// will lead to an impossible state where one cannot satisfy the type
// constraint under no circumstances, see #1356.In general type arguments
// seem to be a bit buggy and not supported well at the time of this
// writing with TS 3.3.3333.
static getDerivedStateFromProps?(
props: Readonly