mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
single-spa-react: typings (#27777)
* single-spa-react: typings * fix ts version
This commit is contained in:
committed by
Sheetal Nandi
parent
992112dedc
commit
a5544dce7b
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
// 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.6
|
||||
|
||||
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>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import singleSpaReact = require('single-spa-react');
|
||||
import { Lifecycles } from 'single-spa-react';
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
|
||||
// $ExpectType Lifecycles
|
||||
singleSpaReact({
|
||||
React,
|
||||
ReactDOM,
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"single-spa-react-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user