release: update 3.8.0
This commit is contained in:
270
types/global.d.ts
vendored
270
types/global.d.ts
vendored
@@ -1,24 +1,21 @@
|
||||
import type {
|
||||
ComponentRenderProxy,
|
||||
VNode,
|
||||
ComponentPublicInstance,
|
||||
FunctionalComponent,
|
||||
PropType as VuePropType
|
||||
PropType as VuePropType,
|
||||
ComponentPublicInstance
|
||||
} from "vue";
|
||||
import type { ECharts } from "echarts";
|
||||
import { type ResponsiveStorage } from "./index";
|
||||
|
||||
// GlobalComponents for Volar
|
||||
declare module "vue" {
|
||||
export interface GlobalComponents {
|
||||
IconifyIconOffline: typeof import("../src/components/ReIcon")["IconifyIconOffline"];
|
||||
IconifyIconOnline: typeof import("../src/components/ReIcon")["IconifyIconOnline"];
|
||||
FontIcon: typeof import("../src/components/ReIcon")["FontIcon"];
|
||||
Auth: typeof import("../src/components/ReAuth")["Auth"];
|
||||
}
|
||||
}
|
||||
import type { ResponsiveStorage } from "./index";
|
||||
import type { TableColumns } from "@pureadmin/table";
|
||||
import { type RouteComponent, type RouteLocationNormalized } from "vue-router";
|
||||
|
||||
/**
|
||||
* 全局类型声明,无需引入直接在 `.vue` 、`.ts` 、`.tsx` 文件使用即可获得类型提示
|
||||
*/
|
||||
declare global {
|
||||
/**
|
||||
* 平台的名称、版本、依赖、最后构建时间的类型提示
|
||||
*/
|
||||
const __APP_INFO__: {
|
||||
pkg: {
|
||||
name: string;
|
||||
@@ -28,6 +25,10 @@ declare global {
|
||||
};
|
||||
lastBuildTime: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* Window 的类型提示
|
||||
*/
|
||||
interface Window {
|
||||
// Global vue app instance
|
||||
__APP__: App<Element>;
|
||||
@@ -41,39 +42,9 @@ declare global {
|
||||
msRequestAnimationFrame: (callback: FrameRequestCallback) => number;
|
||||
}
|
||||
|
||||
// vue
|
||||
type PropType<T> = VuePropType<T>;
|
||||
|
||||
type Writable<T> = {
|
||||
-readonly [P in keyof T]: T[P];
|
||||
};
|
||||
|
||||
type Nullable<T> = T | null;
|
||||
type NonNullable<T> = T extends null | undefined ? never : T;
|
||||
type Recordable<T = any> = Record<string, T>;
|
||||
type ReadonlyRecordable<T = any> = {
|
||||
readonly [key: string]: T;
|
||||
};
|
||||
type Indexable<T = any> = {
|
||||
[key: string]: T;
|
||||
};
|
||||
type DeepPartial<T> = {
|
||||
[P in keyof T]?: DeepPartial<T[P]>;
|
||||
};
|
||||
type TimeoutHandle = ReturnType<typeof setTimeout>;
|
||||
type IntervalHandle = ReturnType<typeof setInterval>;
|
||||
|
||||
interface ChangeEvent extends Event {
|
||||
target: HTMLInputElement;
|
||||
}
|
||||
|
||||
interface WheelEvent {
|
||||
path?: EventTarget[];
|
||||
}
|
||||
interface ImportMetaEnv extends ViteEnv {
|
||||
__: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* 打包压缩格式的类型声明
|
||||
*/
|
||||
type ViteCompression =
|
||||
| "none"
|
||||
| "gzip"
|
||||
@@ -83,22 +54,35 @@ declare global {
|
||||
| "brotli-clear"
|
||||
| "both-clear";
|
||||
|
||||
declare interface ViteEnv {
|
||||
/**
|
||||
* 全局自定义环境变量的类型声明
|
||||
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#%E5%85%B7%E4%BD%93%E9%85%8D%E7%BD%AE}
|
||||
*/
|
||||
interface ViteEnv {
|
||||
VITE_PORT: number;
|
||||
VITE_PUBLIC_PATH: string;
|
||||
VITE_ROUTER_HISTORY: string;
|
||||
VITE_LEGACY: boolean;
|
||||
VITE_CDN: boolean;
|
||||
VITE_COMPRESSION: ViteCompression;
|
||||
}
|
||||
|
||||
declare interface ServerConfigs {
|
||||
/**
|
||||
* 继承 `@pureadmin/table` 的 `TableColumns` ,方便全局直接调用
|
||||
*/
|
||||
interface TableColumnList extends Array<TableColumns> {}
|
||||
|
||||
/**
|
||||
* 对应 `public/serverConfig.json` 文件的类型声明
|
||||
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#serverconfig-json}
|
||||
*/
|
||||
interface ServerConfigs {
|
||||
Version?: string;
|
||||
Title?: string;
|
||||
FixedHeader?: boolean;
|
||||
HiddenSideBar?: boolean;
|
||||
MultiTagsCache?: boolean;
|
||||
KeepAlive?: boolean;
|
||||
Locale?: string;
|
||||
Layout?: string;
|
||||
Theme?: string;
|
||||
DarkMode?: boolean;
|
||||
@@ -109,6 +93,7 @@ declare global {
|
||||
EpThemeColor?: string;
|
||||
ShowLogo?: boolean;
|
||||
ShowModel?: string;
|
||||
MenuArrowIconNoTransition?: boolean;
|
||||
MapConfigure?: {
|
||||
amapKey?: string;
|
||||
options: {
|
||||
@@ -119,29 +104,176 @@ declare global {
|
||||
};
|
||||
}
|
||||
|
||||
declare interface GlobalPropertiesApi {
|
||||
/**
|
||||
* 与 `ServerConfigs` 类型不同,这里是缓存到浏览器本地存储的类型声明
|
||||
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/config/#serverconfig-json}
|
||||
*/
|
||||
interface StorageConfigs {
|
||||
version?: string;
|
||||
title?: string;
|
||||
fixedHeader?: boolean;
|
||||
hiddenSideBar?: boolean;
|
||||
multiTagsCache?: boolean;
|
||||
keepAlive?: boolean;
|
||||
locale?: string;
|
||||
layout?: string;
|
||||
theme?: string;
|
||||
darkMode?: boolean;
|
||||
grey?: boolean;
|
||||
weak?: boolean;
|
||||
hideTabs?: boolean;
|
||||
sidebarStatus?: boolean;
|
||||
epThemeColor?: string;
|
||||
showLogo?: boolean;
|
||||
showModel?: string;
|
||||
mapConfigure?: {
|
||||
amapKey?: string;
|
||||
options: {
|
||||
resizeEnable?: boolean;
|
||||
center?: number[];
|
||||
zoom?: number;
|
||||
};
|
||||
};
|
||||
username?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* `responsive-storage` 本地响应式 `storage` 的类型声明
|
||||
*/
|
||||
interface ResponsiveStorage {
|
||||
locale: {
|
||||
locale?: string;
|
||||
};
|
||||
layout: {
|
||||
layout?: string;
|
||||
theme?: string;
|
||||
darkMode?: boolean;
|
||||
sidebarStatus?: boolean;
|
||||
epThemeColor?: string;
|
||||
};
|
||||
configure: {
|
||||
grey?: boolean;
|
||||
weak?: boolean;
|
||||
hideTabs?: boolean;
|
||||
showLogo?: boolean;
|
||||
showModel?: string;
|
||||
multiTagsCache?: boolean;
|
||||
};
|
||||
tags?: Array<any>;
|
||||
}
|
||||
|
||||
/**
|
||||
* `src/router` 文件夹里的类型声明
|
||||
*/
|
||||
interface toRouteType extends RouteLocationNormalized {
|
||||
meta: {
|
||||
roles: Array<string>;
|
||||
keepAlive?: boolean;
|
||||
dynamicLevel?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 完整子路由配置表
|
||||
*/
|
||||
interface RouteChildrenConfigsTable {
|
||||
/** 子路由地址 `必填` */
|
||||
path: string;
|
||||
/** 路由名字(对应不要重复,和当前组件的`name`保持一致)`必填` */
|
||||
name?: string;
|
||||
/** 路由重定向 `可选` */
|
||||
redirect?: string;
|
||||
/** 按需加载组件 `可选` */
|
||||
component?: RouteComponent;
|
||||
meta?: {
|
||||
/** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加) `必填` */
|
||||
title: string;
|
||||
/** 菜单图标 `可选` */
|
||||
icon?: string | FunctionalComponent;
|
||||
/** 菜单名称右侧的额外图标,支持`fontawesome`、`iconfont`、`element-plus-icon` `可选` */
|
||||
extraIcon?: {
|
||||
svg?: boolean;
|
||||
name?: string;
|
||||
};
|
||||
/** 是否在菜单中显示(默认`true`)`可选` */
|
||||
showLink?: boolean;
|
||||
/** 是否显示父级菜单 `可选` */
|
||||
showParent?: boolean;
|
||||
/** 页面级别权限设置 `可选` */
|
||||
roles?: Array<string>;
|
||||
/** 按钮级别权限设置 `可选` */
|
||||
auths?: Array<string>;
|
||||
/** 路由组件缓存(开启 `true`、关闭 `false`)`可选` */
|
||||
keepAlive?: boolean;
|
||||
/** 内嵌的`iframe`链接 `可选` */
|
||||
frameSrc?: string;
|
||||
/** `iframe`页是否开启首次加载动画(默认`true`)`可选` */
|
||||
frameLoading?: boolean;
|
||||
/** 页面加载动画(有两种形式,一种直接采用vue内置的`transitions`动画,另一种是使用`animate.css`写进、离场动画)`可选` */
|
||||
transition?: {
|
||||
/**
|
||||
* @description 当前路由动画效果
|
||||
* @see {@link https://next.router.vuejs.org/guide/advanced/transitions.html#transitions}
|
||||
*/
|
||||
name?: string;
|
||||
/** 进场动画 */
|
||||
enterTransition?: string;
|
||||
/** 离场动画 */
|
||||
leaveTransition?: string;
|
||||
};
|
||||
// 是否不添加信息到标签页,(默认`false`)
|
||||
hiddenTag?: boolean;
|
||||
/** 动态路由可打开的最大数量 `可选` */
|
||||
dynamicLevel?: number;
|
||||
};
|
||||
/** 子路由配置项 */
|
||||
children?: Array<RouteChildrenConfigsTable>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 整体路由配置表(包括完整子路由)
|
||||
*/
|
||||
interface RouteConfigsTable {
|
||||
/** 路由地址 `必填` */
|
||||
path: string;
|
||||
/** 路由名字(保持唯一)`可选` */
|
||||
name?: string;
|
||||
/** `Layout`组件 `可选` */
|
||||
component?: RouteComponent;
|
||||
/** 路由重定向 `可选` */
|
||||
redirect?: string;
|
||||
meta?: {
|
||||
/** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加)`必填` */
|
||||
title: string;
|
||||
/** 菜单图标 `可选` */
|
||||
icon?: string | FunctionalComponent;
|
||||
/** 是否在菜单中显示(默认`true`)`可选` */
|
||||
showLink?: boolean;
|
||||
/** 菜单升序排序,值越高排的越后(只针对顶级路由)`可选` */
|
||||
rank?: number;
|
||||
};
|
||||
/** 子路由配置项 */
|
||||
children?: Array<RouteChildrenConfigsTable>;
|
||||
}
|
||||
|
||||
/**
|
||||
* 平台里所有组件实例都能访问到的全局属性对象的类型声明
|
||||
*/
|
||||
interface GlobalPropertiesApi {
|
||||
$echarts: ECharts;
|
||||
$storage: ResponsiveStorage;
|
||||
$config: ServerConfigs;
|
||||
}
|
||||
}
|
||||
|
||||
function parseInt(s: string | number, radix?: number): number;
|
||||
|
||||
function parseFloat(string: string | number): number;
|
||||
|
||||
namespace JSX {
|
||||
// tslint:disable no-empty-interface
|
||||
type Element = VNode;
|
||||
// tslint:disable no-empty-interface
|
||||
type ElementClass = ComponentRenderProxy;
|
||||
interface ElementAttributesProperty {
|
||||
$props: any;
|
||||
}
|
||||
interface IntrinsicElements {
|
||||
[elem: string]: any;
|
||||
}
|
||||
interface IntrinsicAttributes {
|
||||
[elem: string]: any;
|
||||
}
|
||||
declare module "vue" {
|
||||
/**
|
||||
* 自定义全局组件获得 Volar 提示(自定义的全局组件需要在这里声明下才能获得 Volar 类型提示哦)
|
||||
*/
|
||||
export interface GlobalComponents {
|
||||
IconifyIconOffline: typeof import("../src/components/ReIcon")["IconifyIconOffline"];
|
||||
IconifyIconOnline: typeof import("../src/components/ReIcon")["IconifyIconOnline"];
|
||||
FontIcon: typeof import("../src/components/ReIcon")["FontIcon"];
|
||||
Auth: typeof import("../src/components/ReAuth")["Auth"];
|
||||
}
|
||||
}
|
||||
|
87
types/index.d.ts
vendored
87
types/index.d.ts
vendored
@@ -1,33 +1,74 @@
|
||||
declare interface Fn<T = any, R = T> {
|
||||
(...arg: T[]): R;
|
||||
}
|
||||
// 此文件跟同级目录的 global.d.ts 文件一样也是全局类型声明,只不过这里存放一些零散的全局类型,无需引入直接在 .vue 、.ts 、.tsx 文件使用即可获得类型提示
|
||||
|
||||
declare interface PromiseFn<T = any, R = T> {
|
||||
(...arg: T[]): Promise<R>;
|
||||
}
|
||||
type RefType<T> = T | null;
|
||||
|
||||
declare type RefType<T> = T | null;
|
||||
type EmitType = (event: string, ...args: any[]) => void;
|
||||
|
||||
declare type LabelValueOptions = {
|
||||
label: string;
|
||||
value: any;
|
||||
}[];
|
||||
type TargetContext = "_self" | "_blank";
|
||||
|
||||
declare type EmitType = (event: string, ...args: any[]) => void;
|
||||
|
||||
declare type TargetContext = "_self" | "_blank";
|
||||
|
||||
declare interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {
|
||||
$el: T;
|
||||
}
|
||||
|
||||
declare type ComponentRef<T extends HTMLElement = HTMLDivElement> =
|
||||
type ComponentRef<T extends HTMLElement = HTMLDivElement> =
|
||||
ComponentElRef<T> | null;
|
||||
|
||||
declare type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
|
||||
type ElRef<T extends HTMLElement = HTMLDivElement> = Nullable<T>;
|
||||
|
||||
declare type ForDataType<T> = {
|
||||
type ForDataType<T> = {
|
||||
[P in T]?: ForDataType<T[P]>;
|
||||
};
|
||||
|
||||
declare type AnyFunction<T> = (...args: any[]) => T;
|
||||
type AnyFunction<T> = (...args: any[]) => T;
|
||||
|
||||
type PropType<T> = VuePropType<T>;
|
||||
|
||||
type Writable<T> = {
|
||||
-readonly [P in keyof T]: T[P];
|
||||
};
|
||||
|
||||
type Nullable<T> = T | null;
|
||||
|
||||
type NonNullable<T> = T extends null | undefined ? never : T;
|
||||
|
||||
type Recordable<T = any> = Record<string, T>;
|
||||
|
||||
type ReadonlyRecordable<T = any> = {
|
||||
readonly [key: string]: T;
|
||||
};
|
||||
|
||||
type Indexable<T = any> = {
|
||||
[key: string]: T;
|
||||
};
|
||||
|
||||
type DeepPartial<T> = {
|
||||
[P in keyof T]?: DeepPartial<T[P]>;
|
||||
};
|
||||
|
||||
type TimeoutHandle = ReturnType<typeof setTimeout>;
|
||||
|
||||
type IntervalHandle = ReturnType<typeof setInterval>;
|
||||
|
||||
interface ChangeEvent extends Event {
|
||||
target: HTMLInputElement;
|
||||
}
|
||||
|
||||
interface WheelEvent {
|
||||
path?: EventTarget[];
|
||||
}
|
||||
|
||||
interface ImportMetaEnv extends ViteEnv {
|
||||
__: unknown;
|
||||
}
|
||||
|
||||
interface Fn<T = any, R = T> {
|
||||
(...arg: T[]): R;
|
||||
}
|
||||
|
||||
interface PromiseFn<T = any, R = T> {
|
||||
(...arg: T[]): Promise<R>;
|
||||
}
|
||||
|
||||
interface ComponentElRef<T extends HTMLElement = HTMLDivElement> {
|
||||
$el: T;
|
||||
}
|
||||
|
||||
function parseInt(s: string | number, radix?: number): number;
|
||||
|
||||
function parseFloat(string: string | number): number;
|
||||
|
130
types/index.ts
130
types/index.ts
@@ -1,130 +0,0 @@
|
||||
import { type FunctionalComponent } from "vue";
|
||||
import { type RouteComponent } from "vue-router";
|
||||
|
||||
export interface StorageConfigs {
|
||||
version?: string;
|
||||
title?: string;
|
||||
fixedHeader?: boolean;
|
||||
hiddenSideBar?: boolean;
|
||||
multiTagsCache?: boolean;
|
||||
keepAlive?: boolean;
|
||||
layout?: string;
|
||||
theme?: string;
|
||||
darkMode?: boolean;
|
||||
grey?: boolean;
|
||||
weak?: boolean;
|
||||
hideTabs?: boolean;
|
||||
sidebarStatus?: boolean;
|
||||
epThemeColor?: string;
|
||||
showLogo?: boolean;
|
||||
showModel?: string;
|
||||
mapConfigure?: {
|
||||
amapKey?: string;
|
||||
options: {
|
||||
resizeEnable?: boolean;
|
||||
center?: number[];
|
||||
zoom?: number;
|
||||
};
|
||||
};
|
||||
username?: string;
|
||||
}
|
||||
|
||||
export interface ResponsiveStorage {
|
||||
layout: {
|
||||
layout?: string;
|
||||
theme?: string;
|
||||
darkMode?: boolean;
|
||||
sidebarStatus?: boolean;
|
||||
epThemeColor?: string;
|
||||
};
|
||||
configure: {
|
||||
grey?: boolean;
|
||||
weak?: boolean;
|
||||
hideTabs?: boolean;
|
||||
showLogo?: boolean;
|
||||
showModel?: string;
|
||||
multiTagsCache?: boolean;
|
||||
};
|
||||
tags?: Array<any>;
|
||||
}
|
||||
|
||||
export interface RouteChildrenConfigsTable {
|
||||
/** 子路由地址 `必填` */
|
||||
path: string;
|
||||
/** 路由名字(对应不要重复,和当前组件的`name`保持一致)`必填` */
|
||||
name?: string;
|
||||
/** 路由重定向 `可选` */
|
||||
redirect?: string;
|
||||
/** 按需加载组件 `可选` */
|
||||
component?: RouteComponent;
|
||||
meta?: {
|
||||
/** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加) `必填` */
|
||||
title: string;
|
||||
/** 菜单图标 `可选` */
|
||||
icon?: string | FunctionalComponent;
|
||||
/** 菜单名称右侧的额外图标,支持`fontawesome`、`iconfont`、`element-plus-icon` `可选` */
|
||||
extraIcon?: {
|
||||
svg?: boolean;
|
||||
name?: string;
|
||||
};
|
||||
/** 是否在菜单中显示(默认`true`)`可选` */
|
||||
showLink?: boolean;
|
||||
/** 是否显示父级菜单 `可选` */
|
||||
showParent?: boolean;
|
||||
/** 页面级别权限设置 `可选` */
|
||||
roles?: Array<string>;
|
||||
/** 按钮级别权限设置 `可选` */
|
||||
auths?: Array<string>;
|
||||
/** 路由组件缓存(开启 `true`、关闭 `false`)`可选` */
|
||||
keepAlive?: boolean;
|
||||
/** 内嵌的`iframe`链接 `可选` */
|
||||
frameSrc?: string;
|
||||
/** `iframe`页是否开启首次加载动画(默认`true`)`可选` */
|
||||
frameLoading?: boolean;
|
||||
/** 页面加载动画(有两种形式,一种直接采用vue内置的`transitions`动画,另一种是使用`animate.css`写进、离场动画)`可选` */
|
||||
transition?: {
|
||||
/**
|
||||
* @description 当前路由动画效果
|
||||
* @see {@link https://next.router.vuejs.org/guide/advanced/transitions.html#transitions}
|
||||
*/
|
||||
name?: string;
|
||||
/** 进场动画 */
|
||||
enterTransition?: string;
|
||||
/** 离场动画 */
|
||||
leaveTransition?: string;
|
||||
};
|
||||
// 是否不添加信息到标签页,(默认`false`)
|
||||
hiddenTag?: boolean;
|
||||
/** 动态路由可打开的最大数量 `可选` */
|
||||
dynamicLevel?: number;
|
||||
};
|
||||
/** 子路由配置项 */
|
||||
children?: Array<RouteChildrenConfigsTable>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 完整路由配置表
|
||||
* @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/782b6e/#%E4%B8%80-%E9%85%8D%E7%BD%AE%E9%A1%B9}
|
||||
*/
|
||||
export interface RouteConfigsTable {
|
||||
/** 路由地址 `必填` */
|
||||
path: string;
|
||||
/** 路由名字(保持唯一)`可选` */
|
||||
name?: string;
|
||||
/** `Layout`组件 `可选` */
|
||||
component?: RouteComponent;
|
||||
/** 路由重定向 `可选` */
|
||||
redirect?: string;
|
||||
meta?: {
|
||||
/** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加)`必填` */
|
||||
title: string;
|
||||
/** 菜单图标 `可选` */
|
||||
icon?: string | FunctionalComponent;
|
||||
/** 是否在菜单中显示(默认`true`)`可选` */
|
||||
showLink?: boolean;
|
||||
/** 菜单升序排序,值越高排的越后(只针对顶级路由)`可选` */
|
||||
rank?: number;
|
||||
};
|
||||
/** 子路由配置项 */
|
||||
children?: Array<RouteChildrenConfigsTable>;
|
||||
}
|
6
types/shims-tsx.d.ts
vendored
6
types/shims-tsx.d.ts
vendored
@@ -9,8 +9,14 @@ declare global {
|
||||
namespace JSX {
|
||||
interface Element extends VNode {}
|
||||
interface ElementClass extends Vue {}
|
||||
interface ElementAttributesProperty {
|
||||
$props: any;
|
||||
}
|
||||
interface IntrinsicElements {
|
||||
[elem: string]: any;
|
||||
}
|
||||
interface IntrinsicAttributes {
|
||||
[elem: string]: any;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
3
types/shims-vue.d.ts
vendored
3
types/shims-vue.d.ts
vendored
@@ -9,7 +9,6 @@ declare module "*.scss" {
|
||||
export default scss;
|
||||
}
|
||||
|
||||
declare module "vuedraggable/src/vuedraggable";
|
||||
declare module "@pureadmin/components";
|
||||
declare module "@pureadmin/theme";
|
||||
declare module "@pureadmin/components";
|
||||
declare module "@pureadmin/theme/dist/browser-utils";
|
||||
|
Reference in New Issue
Block a user