UNPKG

2.87 kBTypeScriptView Raw
1import Vue from 'vue'
2
3import { ModalController } from '../modal'
4import { SaveFileFunction, ReadFileFunction, PrintFunction } from '../export'
5
6import { VxeGlobalRenderer } from './renderer'
7import { VxeGlobalInterceptor } from './interceptor'
8import { VxeGlobalCommands } from './commands'
9import { VxeGlobalFormats } from './formats'
10import { VxeGlobalMenus } from './menus'
11import { VxeGlobalSetup } from './setup'
12
13export type VxeGlobalI18n = (key: string, args?: any) => number | string;
14export type VxeGlobalTranslate = (key: string, args?: any) => string;
15export type VxeGlobalUse = (plugin: VXETablePluginObject, ...options: any[]) => VXETableCore;
16
17export const setup: VxeGlobalSetup;
18export const interceptor: VxeGlobalInterceptor;
19export const renderer: VxeGlobalRenderer;
20export const commands: VxeGlobalCommands;
21export const formats: VxeGlobalFormats;
22export const menus: VxeGlobalMenus;
23export const modal: ModalController;
24export const saveFile: SaveFileFunction;
25export const readFile: ReadFileFunction;
26export const print: PrintFunction;
27export const t: VxeGlobalI18n;
28export const _t: VxeGlobalTranslate;
29export const use: VxeGlobalUse;
30
31export interface VXETablePluginObject {
32 install(vxetable: VXETableCore, ...options: any[]): void;
33 [key: string]: any;
34}
35
36export type VXETableVersion = 'v1' | 'v2' | 'v3' | 'v4'
37
38export const v: VXETableVersion
39
40export interface VXETableCore {
41 v: VXETableVersion;
42 /**
43 * 设置全局参数/获取所有参数
44 */
45 setup: VxeGlobalSetup;
46 /**
47 * Table interceptor
48 */
49 interceptor: VxeGlobalInterceptor;
50 /**
51 * Table renderer
52 */
53 renderer: VxeGlobalRenderer;
54 /**
55 * Table commands
56 */
57 commands: VxeGlobalCommands;
58 /**
59 * Table column formatter
60 */
61 formats: VxeGlobalFormats;
62 /**
63 * Table context menu
64 */
65 menus: VxeGlobalMenus;
66 /**
67 * 弹窗
68 */
69 modal: ModalController;
70 /**
71 * 读取本地文件
72 */
73 saveFile: SaveFileFunction;
74 /**
75 * 读取本地文件
76 */
77 readFile: ReadFileFunction;
78 /**
79 * 打印
80 */
81 print: PrintFunction;
82 /**
83 * 安装插件
84 * @param plugin
85 * @param options
86 */
87 use: VxeGlobalUse;
88 /**
89 * 读取内置国际化
90 */
91 t: VxeGlobalI18n;
92 _t: VxeGlobalTranslate;
93}
94
95/**
96 * 一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟滚动、懒加载、快捷菜单、数据校验、树形结构、打印导出、表单渲染、数据分页、虚拟列表、弹窗、自定义模板、渲染器、贼灵活的配置项、扩展接口等...
97 */
98 export const VXETable: VXETableCore
99
100 export * from './renderer'
101 export * from './interceptor'
102 export * from './commands'
103 export * from './formats'
104 export * from './menus'
105 export * from './setup'
106
107 export default VXETable
108
\No newline at end of file