DefinitelyTyped/types/single-spa-react/index.d.ts
Ferdy Budhidharma 1d9679b2dc [react] add library managed attributes and upgrade TS requirement to 2.8 (#27901)
* feat(react): add library managed attributes and upgrade to 2.8

* fix broken tests

* fix lint errors
2018-08-06 18:51:26 +01:00

30 lines
979 B
TypeScript

// Type definitions for single-spa-react 2.8
// Project: https://github.com/CanopyTax/single-spa-react
// Definitions by: Garrett Smith <https://github.com/Garrett-Smith-iq>
// 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;
loadRootComponent?: () => Promise<React.ComponentClass>;
domElementGetter?: () => Element;
suppressComponentDidCatchWarning?: boolean;
parcelCanUpdate?: boolean;
}
interface Lifecycles {
bootstrap: (opts: Options, props: any) => Promise<void>;
mount: (opts: Options, props: any) => Promise<void>;
unmount: (opts: Options, props: any) => Promise<void>;
}
}