single-spa
Advanced tools
Comparing version 4.3.3 to 4.3.4
{ | ||
"name": "single-spa", | ||
"version": "4.3.3", | ||
"version": "4.3.4", | ||
"description": "Multiple applications, one page", | ||
"main": "lib/umd/single-spa.min.js", | ||
"types": "typings/single-spa.d.ts", | ||
"module:": "lib/esm/single-spa.min.js", | ||
"module": "lib/esm/single-spa.min.js", | ||
"scripts": { | ||
@@ -48,3 +48,3 @@ "build": "yarn clean && rollup -c --environment NODE_ENV:'production'", | ||
"custom-event": "^1.0.1", | ||
"eslint": "5.15.3", | ||
"eslint": "5.16.0", | ||
"eslint-config-canopy": "2.3.0", | ||
@@ -54,7 +54,7 @@ "husky": "^2.2.0", | ||
"jest": "^24.5.0", | ||
"rollup": "^1.7.3", | ||
"rollup": "^1.12.3", | ||
"rollup-plugin-analyzer": "^3.0.0", | ||
"rollup-plugin-babel": "^4.3.2", | ||
"rollup-plugin-commonjs": "^9.2.2", | ||
"rollup-plugin-node-resolve": "^4.0.1", | ||
"rollup-plugin-commonjs": "^10.0.0", | ||
"rollup-plugin-node-resolve": "^5.0.0", | ||
"rollup-plugin-terser": "^4.0.4" | ||
@@ -61,0 +61,0 @@ }, |
declare module "single-spa" { | ||
type Splat<T> = { | ||
[p in keyof T]: Array<T[p]> | ||
}; | ||
type AppProps = { | ||
name: string, | ||
mountParcel(): any, | ||
singleSpa: any, | ||
}; | ||
type LifeCycles<T = {}> = { | ||
bootstrap: (config: T & AppProps) => Promise<any>, | ||
mount: (config: T & AppProps) => Promise<any>, | ||
unmount: (config: T & AppProps) => Promise<any>, | ||
}; | ||
// ./start.js | ||
@@ -19,7 +36,7 @@ export function start(): void; | ||
// ./applications/apps.js | ||
export function registerApplication( | ||
export function registerApplication<T extends object = {}>( | ||
appName: string, | ||
applicationOrLoadingFn: Function | Promise<any>, | ||
applicationOrLoadingFn: LifeCycles<T> | ((config: T & AppProps) => Promise<LifeCycles<T> | Splat<LifeCycles<T>>>), | ||
activityFn: (location: Location) => boolean, | ||
customProps?: Object | ||
customProps?: T, | ||
): void; | ||
@@ -26,0 +43,0 @@ |
334763
1626