DefinitelyTyped/types/single-spa-react/index.d.ts
Bence 4204134f27
[ @types/single-spa-react ] Fix: update added to lifecycles and added React.FunctionComponent as acceptable loadComponent option (#43369)
* fix: update added to lifecycles options

* refactor: React.FunctionComponent added as component option

* docs: Mention me in desc

* docs: Version updated

* fix: fixed typescript version

* fix: Make update to optional based on doc
2020-03-26 22:20:34 -07:00

35 lines
1.3 KiB
TypeScript

// Type definitions for single-spa-react 2.12
// Project: https://github.com/CanopyTax/single-spa-react, https://github.com/joeldenning/single-spa-react
// Definitions by: Garrett Smith <https://github.com/Garrett-Smith-iq>
// Chris Dopuch <https://github.com/chrisdopuch>
// Bence Czeii <https://github.com/benceczeili>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import * as React from "react";
import * as ReactDOM from "react-dom";
export = SingleSpaReact;
declare function SingleSpaReact(
opts: SingleSpaReact.Options
): SingleSpaReact.Lifecycles;
declare namespace SingleSpaReact {
interface Options {
React: typeof React;
ReactDOM: typeof ReactDOM;
rootComponent?: React.ComponentClass<any, any> | React.FunctionComponent<any>;
loadRootComponent?: () => Promise<React.ComponentClass<any, any>> | Promise<React.FunctionComponent<any>>;
domElementGetter?: () => Element;
suppressComponentDidCatchWarning?: boolean;
parcelCanUpdate?: boolean;
}
interface Lifecycles {
bootstrap: (props: any) => Promise<void>;
mount: (props: any) => Promise<void>;
unmount: (props: any) => Promise<void>;
update?: (props: any) => Promise<void>;
}
}