jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
82 lines (81 loc) • 2.37 kB
TypeScript
/**
* amis导出适配器
* 通过访问https://regexr.com/, 输入正则匹配: import.s*\{([\s\S]*?)\}
* 然后在List里选择`$1,`即可过滤出所有可导出的项
*/
import type { Moment } from 'moment';
import type moment from 'moment';
import type { IScopedContext, RendererEnv, ValidateFn } from 'jamis-core';
import type * as AmisLib from '../index';
import type { AppRenderer } from '../index';
import type { JarvisHelper } from './Helper';
interface ImportMetaEnv {
readonly VITE_RELEASE_TIME: string;
}
export interface ImportMeta {
readonly env: ImportMetaEnv;
}
export interface ApiResPayload<RowItemType = any> {
status: number;
msg: string;
data: {
rows?: RowItemType[] | RowItemType;
count: number;
paging?: number;
message?: string;
};
}
/** form里的校验规则类型 */
export interface ValidateRule {
ruleName: string;
fn: ValidateFn;
message: string;
}
type RuleName = string;
type ErrMessage = string;
export type ValidateRuleTuple = [RuleName, ValidateFn, ErrMessage];
export interface ValidateRegexp {
express: RegExp;
errMsg: string;
}
export interface SelectOption {
label: string;
value: string;
[key: string]: any;
}
export type { moment, Moment };
declare global {
/** amis sdk自动注入 */
const amisRequire: (modName: string) => any;
/**
* 不要再使用了!!!
* @deprecated 请使用amisScoped.getDataScope和amisScoped.updateDataScope来替代
*/
const jarvis: JarvisHelper;
/**
* amis框架中导出来的lib对象, 提供了toast, confirm等方法
*/
const amisLib: typeof AmisLib;
/**
* 根数据域对象
*/
const amisScoped: IScopedContext;
/**
* @deprecated 请使用rootScoped.getRootRenderer()替代
*
* 根组件的renderer实例, 可通过它获取env等属性
*/
const rootRenderer: typeof AppRenderer;
/**
* 通过根元素获取到的组件环境配置信息, 用于发起fetcher请求等, 也可以通过`amisScoped.env`来访问
*/
const amisEnv: RendererEnv;
/**
* @deprecated 请使用amisLib.axios替代
*/
const axios: JarvisHelper['axios'];
/**
* @deprecated 请使用 amisLib.history.createBrowserHistory
*/
const BrowserHistory: JarvisHelper['BrowserHistory'];
}