// CSS modules type CSSModuleClasses = { readonly [key: string]: string } declare type ToastType = 'text' | 'html' | 'loading' | 'success' | 'fail'; declare type ToastPosition = 'top' | 'middle' | 'bottom'; declare type ToastOptions = { type: ToastType, position: ToastPosition, message: string, duration: number, classname?: string, idname?: string, fn?: Function } declare type OType = { [key: string | number]: T } declare module '*.ejs' { const ejs: string; export default ejs; } declare module '*.css' { const classes: CSSModuleClasses; export default classes; } declare type DialogAlignClass = 'center' | 'left' | 'right'; declare type DialogAction = 'cancel' | 'confirm'; declare type DialogOptions = { title?: string, widthclass?: string, // 自定义包含宽度的样式类 message: string, msgAlign?: DialogAlignClass, // center msgClassAlign?: string, showCancelButton?: boolean, //false cancelButtonText?: string, // 取消 showConfirmButton?: boolean, // true confirmButtonText?: string, // 确认 beforeClose?: (value: DialogAction) => Promise, } interface IWin extends Window { readonly mozRequestAnimationFrame?: any; readonly webkitRequestAnimationFrame?: any; readonly msRequestAnimationFrame?: any; readonly mozCancelAnimationFrame?: any; XMLHttpRequest?: any; XDomainRequest?: any; WebSocket?: any; ProgressEvent?: any; } declare type PaceOptions = { options?: any, trigger?: any, ignore?: any, track?: any, running?: any, restart?: any, sources?: any, bar?: any, stop?: any, start?: any, go?: any, } declare type NoTargetErrorAndRequestInterceptType = { [key: string]: any, __super__?: any } declare type Ctor = { new(): any, } declare type AjaxMonitorType = { (): void, watch?: any } declare type DateFormatType = 'yyyy-mm-dd hh:mi:ss' | 'yyyy-mm-dd' | 'yyyy-mm-dd hh:mi:ss.ms' | 'yyyy-mm-dd hh:mi' | 'yyyy-mm-dd hh:mi:ss wk' | 'yy-mm-dd hh:mi:ss' | 'yy-mm-dd' | 'yy-mm-dd hh:mi:ss.ms' | 'yy-mm-dd hh:mi' | 'yy-mm-dd hh:mi:ss wk'; declare type NotifyType = 'primary' | 'success' | 'danger' | 'warning'; declare type NotifyPosition = 'top' | 'bottom'; declare type NotifyOptions = { type?: NotifyType, // danger message: string, duration?: number, // 2000 position?: NotifyPosition, // top color?: string, // white background?: string, unclick?: boolean } declare type RuleOptions = { require?: boolean, pattern?: RegExp, message?: string | ((value, rule) => string), validator?: (value, rule) => boolean | string | Promise } declare type RuleObject = { [key: string]: RuleOptions[] } /* 模板 */ declare type FormatMessageOptions = { name: string, source?: string, path: string, line?: number, column?: number, generated?: string, message: string, stack: string } declare type ArtDefaults = { // 是否启用模板 debug; debug?: boolean; // 模板路径 id or url path?: string; // 模板内容 source?: string; // 模板语法规则列表 rules?: OType[] // 是否开启对模板输出语句自动编码功能。为 false 则关闭编码输出功能 // escape 可以防范 XSS 攻击 escape?: boolean; // 子模板编译适配器 include?: (source: string, data: OType, options: ArtDefaults) => any; // 忽略的变量。被模板编译器忽略的模板变量列表 ignore?: any[]; // 子模版 sublist?: OType; // 编译出错时是否重试 recompile?: boolean; // 导入的模板变量 imports?: { [key: string]: Function }; } declare type RenderFn = { (data: OType): string; mappings: []; sourcesContent: string[]; toString: Function; }