-
-
Notifications
You must be signed in to change notification settings - Fork 62
/
single-spa-react.d.cts
63 lines (54 loc) · 1.67 KB
/
single-spa-react.d.cts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import * as React from "react";
import { AppProps, CustomProps, LifeCycleFn } from "single-spa";
declare const SingleSpaContext: React.Context<CustomProps & AppProps>;
type DeprecatedRenderTypes =
| "createBlockingRoot"
| "unstable_createRoot"
| "unstable_createBlockingRoot";
type LegacyRenderType = "hydrate" | "render";
type RenderType = "createRoot" | "hydrateRoot" | LegacyRenderType;
interface SingleSpaReactOpts<RootComponentProps> {
React: any;
ReactDOM?: {
[T in LegacyRenderType]?: any;
};
ReactDOMClient?: {
[T in RenderType]?: any;
};
rootComponent?:
| React.ComponentClass<RootComponentProps, any>
| React.FunctionComponent<RootComponentProps>;
loadRootComponent?: (
props?: RootComponentProps
) => Promise<React.ElementType<typeof props>>;
errorBoundary?: (
err: Error,
errInfo: React.ErrorInfo,
props: RootComponentProps
) => React.ReactElement;
errorBoundaryClass?: React.ComponentClass<RootComponentProps>;
parcelCanUpdate?: boolean;
suppressComponentDidCatchWarning?: boolean;
domElementGetter?: (props: RootComponentProps) => HTMLElement;
renderType?: RenderType | (() => RenderType);
}
interface ReactAppOrParcel<ExtraProps> {
bootstrap: LifeCycleFn<ExtraProps>;
mount: LifeCycleFn<ExtraProps>;
unmount: LifeCycleFn<ExtraProps>;
update?: LifeCycleFn<ExtraProps>;
}
declare function singleSpaReact<ExtraProps = {}>(
opts: SingleSpaReactOpts<ExtraProps & AppProps>
): ReactAppOrParcel<ExtraProps>;
export = singleSpaReact;
declare namespace singleSpaReact {
export {
SingleSpaContext,
DeprecatedRenderTypes,
LegacyRenderType,
RenderType,
SingleSpaReactOpts,
ReactAppOrParcel,
};
}