Skip to content

Commit bcabec0

Browse files
author
Joel Denning
authored
Add props to appOptions and handleInstance types. Resolves #81 (#82)
1 parent df35e23 commit bcabec0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

types/single-spa-vue.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ declare module "single-spa-vue" {
1010
};
1111

1212
interface BaseSingleSpaVueOptions {
13-
appOptions: AppOptions | ((props?: object) => Promise<AppOptions>);
13+
appOptions:
14+
| AppOptions
15+
| ((
16+
opts: SingleSpaOptsVue2 | SingleSpaOptsVue3,
17+
props: object
18+
) => Promise<AppOptions>);
1419
template?: string;
1520
loadRootComponent?(): Promise<any>;
1621
}
@@ -21,7 +26,7 @@ declare module "single-spa-vue" {
2126

2227
type SingleSpaOptsVue3 = BaseSingleSpaVueOptions & {
2328
createApp: any;
24-
handleInstance?(instance: any): void;
29+
handleInstance?(instance: any, props: object): void;
2530
};
2631

2732
type SingleSpaVueOpts = SingleSpaOptsVue2 | SingleSpaOptsVue3;

types/single-spa-vue.test-d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ singleSpaVue(optsVue2);
1919
const createApp = () => {};
2020
const optsVue3: SingleSpaOptsVue3 = {
2121
createApp,
22-
appOptions,
23-
handleInstance: (instance: any) => {},
22+
appOptions: (opts: object, props: object) => Promise.resolve(),
23+
handleInstance: (instance: any, props: object) => {},
2424
};
2525
expectAssignable<SingleSpaVueOpts>(optsVue3);
2626
singleSpaVue(optsVue3);

0 commit comments

Comments
 (0)