Skip to content

Commit

Permalink
refactor(vue3-bridge): fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
Dell-it committed Dec 8, 2024
1 parent 912f5dd commit 6d52726
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions apps/website-new/docs/en/practice/bridge/vue-bridge.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function createBridgeComponent(bridgeInfo: {
basename?: string;
memoryRoute?: { entryPath: string };
[key: string]: any;
}) => { router?: Router };
}) => { router?: Router } | void;
}): () => {
render(info: {
name?: string;
Expand Down Expand Up @@ -210,7 +210,7 @@ function createBridgeComponent(bridgeInfo: {
basename?: string;
memoryRoute?: { entryPath: string };
[key: string]: any;
}) => { router?: Router };
}) => { router?: Router } | void;
}): () => {
render(info: {
name?: string;
Expand Down
15 changes: 7 additions & 8 deletions packages/bridge/vue3-bridge/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@ import { getInstance } from '@module-federation/runtime';
declare const __APP_VERSION__: string;

type AddOptionsFnParams = {
rootComponent: Vue.Component;
appOptions: (params: {
app: Vue.App<Vue.Component>;
basename: RenderFnParams['basename'];
memoryRoute: RenderFnParams['memoryRoute'];
[key: string]: any;
}) => { router?: VueRouter.Router } | void;
app: Vue.App<Vue.Component>;
basename: RenderFnParams['basename'];
memoryRoute: RenderFnParams['memoryRoute'];
[key: string]: any;
};

export type ProviderFnParams = {
rootComponent: Vue.Component;
appOptions: (params: AddOptionsFnParams) => { router?: VueRouter.Router };
appOptions: (
params: AddOptionsFnParams,
) => { router?: VueRouter.Router } | void;
};

export function createBridgeComponent(bridgeInfo: ProviderFnParams) {
Expand Down

0 comments on commit 6d52726

Please sign in to comment.