Skip to content

Commit

Permalink
fix: 优化类型 (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
winixt authored Feb 19, 2024
1 parent 5a4b458 commit cca6223
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
18 changes: 9 additions & 9 deletions packages/fes-plugin-access/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Router, RouteLocationNormalized, NavigationGuardNext, NavigationGuard } from 'vue-router';
import { Ref } from 'vue';
import type { NavigationGuard, NavigationGuardNext, RouteLocationNormalized, Router } from 'vue-router';
import type { Ref } from 'vue';

export const access: {
hasAccess(accessId: string | number): Promise<boolean>;
isDataReady(): boolean;
setRole(roleId: string | Promise<string>): void;
setAccess(accessIds: Array<string | number> | Promise<Array<string | number>>): void;
getAccess(): string[];
hasAccess: (accessId: string | number) => Promise<boolean>;
isDataReady: () => boolean;
setRole: (roleId: string | Promise<string>) => void;
setAccess: (accessIds: Array<string | number> | Promise<Array<string | number>>) => void;
getAccess: () => string[];
};

export function useAccess(accessId: string | number): Ref<boolean>;
Expand All @@ -26,8 +26,8 @@ declare module '@fesjs/fes' {
interface PluginBuildConfig {
access?:
| {
rules: Record<string, []>;
}
rules: Record<string, []>;
}
| false;
}

Expand Down
10 changes: 5 additions & 5 deletions packages/fes-plugin-enums/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ interface EnumExtend {
}

interface EnumApi {
get(name: string, key?: string, extend?: EnumExtend): any;
push(name: string, _enum?: [] | object, option?: { keyName: string; valueName: string }): any;
remove(name: string): void;
concat(name: string, _enum: [] | object, option?: { keyName: string; valueName: string; before: boolean; extend: EnumExtend }): any;
convert(name: string, _enum?: [] | object, option?: { keyName: string; valueName: string }): any;
get: (name: string, key?: string, extend?: EnumExtend) => any;
push: (name: string, _enum?: [] | object, option?: { keyName: string; valueName: string }) => any;
remove: (name: string) => void;
concat: (name: string, _enum: [] | object, option?: { keyName: string; valueName: string; before: boolean; extend: EnumExtend }) => any;
convert: (name: string, _enum?: [] | object, option?: { keyName: string; valueName: string }) => any;
}

export const enums: EnumApi;
Expand Down
18 changes: 9 additions & 9 deletions packages/fes-plugin-locale/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
export { useI18n } from 'vue-i18n'
export { useI18n } from 'vue-i18n';

export const locale: {
setLocale({ locale }: { locale: string }): void;
addLocale({ locale, messages }: { locale: string; messages: object }): void;
getAllLocales(): string[];
setLocale: ({ locale }: { locale: string }) => void;
addLocale: ({ locale, messages }: { locale: string; messages: object }) => void;
getAllLocales: () => string[];
messages: Record<string, object>;
};

declare module '@fesjs/fes' {
interface PluginBuildConfig {
locale?:
| {
locale: string;
fallbackLocale: string;
baseNavigator: boolean;
legacy: boolean;
}
locale: string;
fallbackLocale: string;
baseNavigator: boolean;
legacy: boolean;
}
| false;
}
}

0 comments on commit cca6223

Please sign in to comment.