/** The global namespace for the app */ declare namespace App { /** Theme namespace */ namespace Theme { type ColorPaletteNumber = import('@sa/color').ColorPaletteNumber; /** Theme setting */ interface ThemeSetting { /** Theme scheme */ themeScheme: UnionKey.ThemeScheme; /** grayscale mode */ grayscale: boolean; /** colour weakness mode */ colourWeakness: boolean; /** Whether to recommend color */ recommendColor: boolean; /** Theme color */ themeColor: string; /** Other color */ otherColor: OtherColor; /** Whether info color is followed by the primary color */ isInfoFollowPrimary: boolean; /** Reset cache strategy */ resetCacheStrategy: UnionKey.ResetCacheStrategy; /** Layout */ layout: { /** Layout mode */ mode: UnionKey.ThemeLayoutMode; /** Scroll mode */ scrollMode: UnionKey.ThemeScrollMode; }; /** Page */ page: { /** Whether to show the page transition */ animate: boolean; /** Page animate mode */ animateMode: UnionKey.ThemePageAnimateMode; }; /** Header */ header: { /** Header height */ height: number; /** Header breadcrumb */ breadcrumb: { /** Whether to show the breadcrumb */ visible: boolean; /** Whether to show the breadcrumb icon */ showIcon: boolean; }; /** Multilingual */ multilingual: { /** Whether to show the multilingual */ visible: boolean; }; globalSearch: { /** Whether to show the GlobalSearch */ visible: boolean; }; }; /** Tab */ tab: { /** Whether to show the tab */ visible: boolean; /** * Whether to cache the tab * * If cache, the tabs will get from the local storage when the page is refreshed */ cache: boolean; /** Tab height */ height: number; /** Tab mode */ mode: UnionKey.ThemeTabMode; }; /** Fixed header and tab */ fixedHeaderAndTab: boolean; /** Sider */ sider: { /** Inverted sider */ inverted: boolean; /** Sider width */ width: number; /** Collapsed sider width */ collapsedWidth: number; /** Sider width when the layout is 'vertical-mix', 'top-hybrid-sidebar-first', or 'top-hybrid-header-first' */ mixWidth: number; /** * Collapsed sider width when the layout is 'vertical-mix', 'top-hybrid-sidebar-first', or * 'top-hybrid-header-first' */ mixCollapsedWidth: number; /** Child menu width when the layout is 'vertical-mix', 'top-hybrid-sidebar-first', or 'top-hybrid-header-first' */ mixChildMenuWidth: number; }; /** Footer */ footer: { /** Whether to show the footer */ visible: boolean; /** Whether fixed the footer */ fixed: boolean; /** Footer height */ height: number; /** * Whether float the footer to the right when the layout is 'top-hybrid-sidebar-first' or * 'top-hybrid-header-first' */ right: boolean; }; /** Watermark */ watermark: { /** Whether to show the watermark */ visible: boolean; /** Watermark text */ text: string; /** Whether to use user name as watermark text */ enableUserName: boolean; /** Whether to use current time as watermark text */ enableTime: boolean; /** Time format for watermark text */ timeFormat: string; }; table: { /** Whether to show the table border */ bordered: boolean; /** Whether to show the table bottom border */ bottomBordered: boolean; /** Whether to show the table single column */ singleColumn: boolean; /** Whether to show the table single line */ singleLine: boolean; /** Whether to show the table size */ size: UnionKey.ThemeTableSize; /** Whether to show the table striped */ striped: boolean; }; /** define some theme settings tokens, will transform to css variables */ tokens: { light: ThemeSettingToken; dark?: { [K in keyof ThemeSettingToken]?: Partial; }; }; } interface OtherColor { info: string; success: string; warning: string; error: string; } interface ThemeColor extends OtherColor { primary: string; } type ThemeColorKey = keyof ThemeColor; type ThemePaletteColor = { [key in ThemeColorKey | `${ThemeColorKey}-${ColorPaletteNumber}`]: string; }; type BaseToken = Record>; interface ThemeSettingTokenColor { /** the progress bar color, if not set, will use the primary color */ nprogress?: string; container: string; layout: string; inverted: string; 'base-text': string; } interface ThemeSettingTokenBoxShadow { header: string; sider: string; tab: string; } interface ThemeSettingToken { colors: ThemeSettingTokenColor; boxShadow: ThemeSettingTokenBoxShadow; } type ThemeTokenColor = ThemePaletteColor & ThemeSettingTokenColor; /** Theme token CSS variables */ type ThemeTokenCSSVars = { colors: ThemeTokenColor & { [key: string]: string }; boxShadow: ThemeSettingTokenBoxShadow & { [key: string]: string }; }; } /** Global namespace */ namespace Global { type VNode = import('vue').VNode; type RouteLocationNormalizedLoaded = import('vue-router').RouteLocationNormalizedLoaded; type RouteKey = import('@elegant-router/types').RouteKey; type RouteMap = import('@elegant-router/types').RouteMap; type RoutePath = import('@elegant-router/types').RoutePath; type LastLevelRouteKey = import('@elegant-router/types').LastLevelRouteKey; /** The router push options */ type RouterPushOptions = { query?: Record; params?: Record; }; /** The global header props */ interface HeaderProps { /** Whether to show the logo */ showLogo?: boolean; /** Whether to show the menu toggler */ showMenuToggler?: boolean; /** Whether to show the menu */ showMenu?: boolean; } /** The global menu */ type Menu = { /** * The menu key * * Equal to the route key */ key: string; /** The menu label */ label: string; /** The menu i18n key */ i18nKey?: I18n.I18nKey | null; /** The route key */ routeKey: RouteKey; /** The route path */ routePath: RoutePath; /** The menu icon */ icon?: () => VNode; /** The menu children */ children?: Menu[]; }; type Breadcrumb = Omit & { options?: Breadcrumb[]; }; /** Tab route */ type TabRoute = Pick & Partial>; /** The global tab */ type Tab = { /** The tab id */ id: string; /** The tab label */ label: string; /** * The new tab label * * If set, the tab label will be replaced by this value */ newLabel?: string; /** * The old tab label * * when reset the tab label, the tab label will be replaced by this value */ oldLabel?: string; /** The tab route key */ routeKey: LastLevelRouteKey; /** The tab route path */ routePath: RouteMap[LastLevelRouteKey]; /** The tab route full path */ fullPath: string; /** The tab fixed index */ fixedIndex?: number | null; /** * Tab icon * * Iconify icon */ icon?: string; /** * Tab local icon * * Local icon */ localIcon?: string; /** I18n key */ i18nKey?: I18n.I18nKey | null; }; /** Form rule */ type FormRule = import('naive-ui').FormItemRule; /** The global dropdown key */ type DropdownKey = 'closeCurrent' | 'closeOther' | 'closeLeft' | 'closeRight' | 'closeAll'; } /** * I18n namespace * * Locales type */ namespace I18n { type RouteKey = import('@elegant-router/types').RouteKey; type LangType = 'en-US' | 'zh-CN'; type LangOption = { label: string; key: LangType; }; type I18nRouteKey = Exclude; type FormMsg = { required: string; invalid: string; tooltip?: string; }; type Schema = { system: { title: string; updateTitle: string; updateContent: string; updateConfirm: string; updateCancel: string; }; common: { action: string; add: string; addSuccess: string; backToHome: string; batchDelete: string; import: string; export: string; importSuccess: string; importFail: string; importTemplate: string; downloadTemplate: string; importResult: string; importEnd: string; importFormat: string; importSize: string; importTip: string; exportSuccess: string; exportFail: string; updateExisting: string; cancel: string; close: string; check: string; expandColumn: string; columnSetting: string; config: string; login: string; confirm: string; save: string; delete: string; deleteSuccess: string; confirmDelete: string; edit: string; download: string; warning: string; error: string; index: string; keywordSearch: string; logout: string; logoutConfirm: string; lookForward: string; modify: string; modifySuccess: string; noData: string; operate: string; pleaseCheckValue: string; refresh: string; reset: string; search: string; switch: string; tip: string; trigger: string; update: string; updateSuccess: string; saveSuccess: string; noChange: string; userCenter: string; yesOrNo: { yes: string; no: string; }; second: string; selected: string; anyRecords: string; clear: string; noSelectRecord: string; }; request: { logout: string; logoutMsg: string; logoutWithModal: string; logoutWithModalMsg: string; refreshToken: string; tokenExpired: string; }; theme: { themeDrawerTitle: string; tabs: { appearance: string; layout: string; general: string; }; appearance: { themeSchema: { title: string } & Record; grayscale: string; colourWeakness: string; themeColor: { title: string; followPrimary: string; } & Theme.ThemeColor; recommendColor: string; recommendColorDesc: string; }; layout: { layoutMode: { title: string } & Record & { [K in `${UnionKey.ThemeLayoutMode}_detail`]: string; }; tab: { title: string; visible: string; cache: string; cacheTip: string; height: string; mode: { title: string } & Record; }; header: { title: string; height: string; breadcrumb: { visible: string; showIcon: string; }; }; sider: { title: string; inverted: string; width: string; collapsedWidth: string; mixWidth: string; mixCollapsedWidth: string; mixChildMenuWidth: string; }; footer: { title: string; visible: string; fixed: string; height: string; right: string; }; content: { title: string; scrollMode: { title: string; tip: string } & Record; page: { animate: string; mode: { title: string } & Record; }; fixedHeaderAndTab: string; }; resetCacheStrategy: { title: string } & Record; }; general: { title: string; watermark: { title: string; visible: string; text: string; enableUserName: string; enableTime: string; timeFormat: string; }; multilingual: { title: string; visible: string; }; globalSearch: { title: string; visible: string; }; }; configOperation: { copyConfig: string; copySuccessMsg: string; resetConfig: string; resetSuccessMsg: string; }; tablePropsTitle: string; table: { size: { title: string } & Record; bordered: string; bottomBordered: string; singleColumn: string; singleLine: string; striped: string; }; }; route: Record; menu: Record; dict: Record>; page: { common: { id: string; createBy: string; createTime: string; updateBy: string; updateTime: string; remark: string; form: { remark: FormMsg; }; }; login: { common: { loginOrRegister: string; register: string; userNamePlaceholder: string; phonePlaceholder: string; codePlaceholder: string; passwordPlaceholder: string; confirmPasswordPlaceholder: string; codeLogin: string; confirm: string; back: string; validateSuccess: string; loginSuccess: string; welcomeBack: string; }; pwdLogin: { title: string; rememberMe: string; forgetPassword: string; register: string; otherAccountLogin: string; otherLoginMode: string; superAdmin: string; admin: string; user: string; }; codeLogin: { title: string; getCode: string; reGetCode: string; sendCodeSuccess: string; imageCodePlaceholder: string; }; register: { title: string; agreement: string; protocol: string; policy: string; }; resetPwd: { title: string; }; bindWeChat: { title: string; }; }; home: { branchDesc: string; greeting: string; weatherDesc: string; projectCount: string; todo: string; message: string; downloadCount: string; registerCount: string; schedule: string; study: string; work: string; rest: string; entertainment: string; visitCount: string; turnover: string; dealCount: string; projectNews: { title: string; moreNews: string; desc1: string; desc2: string; desc3: string; desc4: string; desc5: string; }; creativity: string; }; system: { client: { title: string; clientId: string; clientKey: string; clientSecret: string; grantTypeList: string; deviceType: string; activeTimeout: string; timeout: string; status: string; form: { clientId: FormMsg; clientKey: FormMsg; clientSecret: FormMsg; grantTypeList: FormMsg; deviceType: FormMsg; activeTimeout: FormMsg; timeout: FormMsg; status: FormMsg; }; addClient: string; editClient: string; }; config: { title: string; configName: string; configKey: string; configValue: string; configType: string; remark: string; createTime: string; refreshCache: string; refreshCacheSuccess: string; form: { configId: FormMsg; configName: FormMsg; configKey: FormMsg; configValue: FormMsg; configType: FormMsg; remark: FormMsg; }; addConfig: string; editConfig: string; }; dept: { empty: string; title: string; parentId: string; deptName: string; orderNum: string; deptCategory: string; leader: string; phone: string; email: string; status: string; sort: string; createTime: string; expandAll: string; collapseAll: string; form: { parentId: FormMsg; deptName: FormMsg; orderNum: FormMsg; deptCategory: FormMsg; leader: FormMsg; phone: FormMsg; email: FormMsg; status: FormMsg; sort: FormMsg; deptId: FormMsg; }; error: { getDeptDataFail: string; getDeptUserDataFail: string; }; placeholder: { defaultLeaderPlaceHolder: string; addDataLeaderPlaceHolder: string; deptUserIsEmptyLeaderPlaceHolder: string; }; addDept: string; editDept: string; }; dict: { title: string; dictTypeTitle: string; dictName: string; dictType: string; status: string; remark: string; createTime: string; refreshCacheSuccess: string; refreshCache: string; confirmDeleteDictType: string; data: { title: string; label: string; value: string; dictSort: string; isDefault: string; listClass: string; cssClass: string; status: string; remark: string; createTime: string; }; form: { dictId: FormMsg; dictCode: FormMsg; dictName: FormMsg; dictType: FormMsg; status: FormMsg; remark: FormMsg; dictLabel: FormMsg; dictValue: FormMsg; dictSort: FormMsg; isDefault: FormMsg; listClass: FormMsg; cssClass: FormMsg; }; addDict: string; editDict: string; addDictData: string; editDictData: string; addDictType: string; editDictType: string; exportDictType: string; refreshDictType: string; dictTypeIsEmpty: string; }; menu: { title: string; parentId: string; iconType: string; menuName: string; icon: string; orderNum: string; perms: string; component: string; path: string; externalPath: string; query: string; iframeQuery: string; isFrame: string; isCache: string; menuType: string; visible: string; status: string; createTime: string; cache: string; noCache: string; rootName: string; buttonPermissionList: string; emptyMenu: string; menuDetail: string; cascadeDeleteContent: string; iconifyTip: string; isFrameTip: string; isCacheTip: string; visibleTip: string; statusTip: string; permsTip: string; componentTip: string; pathTip: string; form: { parentId: FormMsg; menuType: FormMsg; menuIds: FormMsg; icon: FormMsg; menuName: FormMsg; orderNum: FormMsg; perms: FormMsg; isFrame: FormMsg; path: FormMsg; component: FormMsg; query: FormMsg; isCache: FormMsg; visible: FormMsg; status: FormMsg; permission: FormMsg; }; placeholder: { iconifyIconPlaceholder: string; localIconPlaceholder: string; queryKey: string; queryValue: string; queryIframe: string; }; directory: string; menu: string; button: string; addMenu: string; addChildMenu: string; editMenu: string; cascadeDelete: string; }; notice: { title: string; noticeTitle: string; noticeType: string; noticeContent: string; status: string; createTime: string; form: { noticeTitle: FormMsg; noticeType: FormMsg; noticeContent: FormMsg; status: FormMsg; }; addNotice: string; editNotice: string; }; oss: { title: string; fileName: string; originalName: string; fileSuffix: string; url: string; createTime: string; service: string; form: { file: FormMsg; }; upload: string; preview: string; download: string; copy: string; copySuccess: string; }; ossConfig: { title: string; configKey: string; accessKey: string; secretKey: string; bucketName: string; prefix: string; endpoint: string; domain: string; isHttps: string; region: string; status: string; remark: string; createTime: string; form: { configKey: FormMsg; accessKey: FormMsg; secretKey: FormMsg; bucketName: FormMsg; prefix: FormMsg; endpoint: FormMsg; domain: FormMsg; isHttps: FormMsg; region: FormMsg; status: FormMsg; remark: FormMsg; }; addOssConfig: string; editOssConfig: string; }; post: { title: string; postCode: string; postName: string; postSort: string; status: string; remark: string; createTime: string; form: { postCode: FormMsg; postName: FormMsg; postSort: FormMsg; status: FormMsg; remark: FormMsg; }; addPost: string; editPost: string; }; role: { title: string; roleName: string; roleKey: string; roleSort: string; status: string; remark: string; menuPermission: string; dataScope: string; createTime: string; form: { roleName: FormMsg; roleKey: FormMsg; roleSort: FormMsg; status: FormMsg; remark: FormMsg; menuIds: FormMsg; deptIds: FormMsg; }; addRole: string; editRole: string; configPermission: string; authorizedUsers: string; selectMenuPermission: string; selectDataScope: string; selectDeptPermission: string; }; tenant: { title: string; tenantName: string; tenantId: string; contactUserName: string; contactPhone: string; companyName: string; licenseNumber: string; address: string; intro: string; domain: string; packageId: string; expireTime: string; accountCount: string; status: string; createTime: string; form: { tenantName: FormMsg; contactUserName: FormMsg; contactPhone: FormMsg; companyName: FormMsg; licenseNumber: FormMsg; address: FormMsg; intro: FormMsg; domain: FormMsg; packageId: FormMsg; expireTime: FormMsg; accountCount: FormMsg; status: FormMsg; }; addTenant: string; editTenant: string; }; tenantPackage: { title: string; packageName: string; menuIds: string; remark: string; status: string; createTime: string; form: { packageName: FormMsg; menuIds: FormMsg; status: FormMsg; remark: FormMsg; }; addTenantPackage: string; editTenantPackage: string; statusChangeSuccess: string; }; user: { title: string; userName: string; nickName: string; deptName: string; phonenumber: string; status: string; createTime: string; password: string; confirmPassword: string; sex: string; roleIds: string; postIds: string; email: string; avatar: string; remark: string; form: { userName: FormMsg; nickName: FormMsg; deptId: FormMsg; phonenumber: FormMsg; status: FormMsg; password: FormMsg; confirmPassword: FormMsg; sex: FormMsg; roleIds: FormMsg; postIds: FormMsg; email: FormMsg; remark: FormMsg; }; addUser: string; editUser: string; resetPassword: string; importUsers: string; exportTemplate: string; importSuccess: string; statusChangeSuccess: string; }; }; }; form: { required: string; userName: FormMsg; phone: FormMsg; pwd: FormMsg; confirmPwd: FormMsg; code: FormMsg; email: FormMsg; }; dropdown: Record; icon: { themeConfig: string; themeSchema: string; lang: string; fullscreen: string; fullscreenExit: string; reload: string; collapse: string; expand: string; pin: string; unpin: string; }; datatable: { itemCount: string; }; }; type GetI18nKey, K extends keyof T = keyof T> = K extends string ? T[K] extends Record ? `${K}.${GetI18nKey}` : K : never; type I18nKey = GetI18nKey; type TranslateOptions = import('vue-i18n').TranslateOptions; interface $T { (key: I18nKey): string; (key: I18nKey, plural: number, options?: TranslateOptions): string; (key: I18nKey, defaultMsg: string, options?: TranslateOptions): string; (key: I18nKey, list: unknown[], options?: TranslateOptions): string; (key: I18nKey, list: unknown[], plural: number): string; (key: I18nKey, list: unknown[], defaultMsg: string): string; (key: I18nKey, named: Record, options?: TranslateOptions): string; (key: I18nKey, named: Record, plural: number): string; (key: I18nKey, named: Record, defaultMsg: string): string; } } /** Service namespace */ namespace Service { /** Other baseURL key */ type OtherBaseURLKey = 'demo'; interface ServiceConfigItem { /** The backend service base url */ baseURL: string; /** The proxy pattern of the backend service base url */ proxyPattern: string; ws?: boolean; } interface OtherServiceConfigItem extends ServiceConfigItem { key: OtherBaseURLKey; } /** The backend service config */ interface ServiceConfig extends ServiceConfigItem { /** Other backend service config */ other: OtherServiceConfigItem[]; } interface SimpleServiceConfig extends Pick { other: Record; } /** The backend service response data */ type Response = { /** The backend service response code */ code: string; /** The backend service response message */ msg: string; /** The backend service response data */ data: T; rows?: any[]; total?: number; }; /** The demo backend service response data */ type DemoResponse = { /** The backend service response code */ status: string; /** The backend service response message */ message: string; /** The backend service response data */ result: T; }; } }