UNPKG

arco-crud-types

Version:

通过链式语法生成 JSON Schema, 主要用于表单和表格的增删改查

189 lines (188 loc) 9.08 kB
export interface CrudOptions { parse: (options: {}) => CrudOptions; rowKey: (rowKey: string) => CrudOptions; fetchList: () => FetchListProps & CrudOptions; fetchItem: () => FetchListProps & CrudOptions; operaton: (btnText?: string) => AllOperationProps<CommonRequestProps<CrudOptions> & CrudOptions>; updateItemOperation: (btnText?: string) => NormalOperationProps<CommonRequestProps<CrudOptions> & CrudOptions>; saveItemOperation: (btnText?: string) => NormalOperationProps<CommonRequestProps<CrudOptions> & CrudOptions>; updateBatchOperation: (btnText?: string) => NormalOperationProps<CommonRequestProps<CrudOptions> & CrudOptions>; saveBatchOperation: (btnText?: string) => NormalOperationProps<CommonRequestProps<CrudOptions> & CrudOptions>; viewItemOperation: (btnText?: string) => NormalOperationProps<CommonRequestProps<CrudOptions> & CrudOptions>; removeItemOperation: (btnText?: string) => NormalOperationProps<CommonRequestProps<CrudOptions> & CrudOptions>; removeBatchOperation: (btnText?: string) => NormalOperationProps<CommonRequestProps<CrudOptions> & CrudOptions>; customOperation: (btnText?: string) => AllOperationProps<CommonRequestProps<CrudOptions> & CrudOptions>; validate: () => ValidateProps & CrudOptions; layout: () => LayoutProps & CrudOptions; column: () => ColumnProps & CrudOptions; row: () => RowProps & CrudOptions; header: (visible: boolean | string) => HeaderProps & CrudOptions; body: () => BodyProps & CrudOptions; span: () => SpanProps & CrudOptions; selection: () => SelectionProps & CrudOptions; loading: () => LoadingProps & CrudOptions; lazyload: () => CommonRequestProps<CrudOptions> & CrudOptions; virtualList: () => VirtualListProps & CrudOptions; scroll: () => ScrollProps & CrudOptions; expand: () => ExpandProps & CrudOptions; drag: () => DragProps & CrudOptions; edit: (enabled?: boolean | string) => EditProps & CrudOptions; } declare type EditProps = { enabled: (enabled?: boolean) => EditProps & CrudOptions; disabledKey: (disabledKey: string) => EditProps & CrudOptions; rowClick: () => EditProps & CrudOptions; cellClick: () => EditProps & CrudOptions; inlineMode: () => EditProps & CrudOptions; saveProtect: () => EditProps & CrudOptions; saveInstant: () => EditProps & CrudOptions; saveLater: () => EditProps & CrudOptions; }; declare type CommonRequestProps<T> = { getUrl: (url: string) => CommonRequestProps<T> & T; postUrl: (url: string) => CommonRequestProps<T> & T; url: (url: string) => CommonRequestProps<T> & T; get: () => CommonRequestProps<T> & T; post: () => CommonRequestProps<T> & T; delete: () => CommonRequestProps<T> & T; put: () => CommonRequestProps<T> & T; method: (method: string) => CommonRequestProps<T> & T; headerMapping: (params: {}) => CommonRequestProps<T> & T; paramsMapping: (params: {}) => CommonRequestProps<T> & T; withFileParam: (fileName: string) => CommonRequestProps<T> & T; withFileResult: (fileName: string) => CommonRequestProps<T> & T; resultMapping: (params: {}) => CommonRequestProps<T> & T; successMsg: (msg: string) => CommonRequestProps<T> & T; errorMsg: (msg: string) => CommonRequestProps<T> & T; throttle: (wait: number) => CommonRequestProps<T> & T; debounce: (wait: number) => CommonRequestProps<T> & T; }; declare type OperationButtonProps<T> = { idx: (index: number | string) => NormalOperationProps<T>; primaryBtn: (btnText?: string) => NormalOperationProps<T>; secondaryBtn: (btnText?: string) => NormalOperationProps<T>; dashedBtn: (btnText?: string) => NormalOperationProps<T>; outlineBtn: (btnText?: string) => NormalOperationProps<T>; textBtn: (btnText?: string) => NormalOperationProps<T>; text: (btnText: string) => NormalOperationProps<T>; success: () => NormalOperationProps<T>; warning: () => NormalOperationProps<T>; danger: () => NormalOperationProps<T>; icon: (icon: string) => NormalOperationProps<T>; }; declare type CommonOperationProps<T> = { saveBatch: () => NormalOperationProps<T>; modalMode: () => NormalOperationProps<T>; drawerMode: () => NormalOperationProps<T>; localData: () => NormalOperationProps<T>; remoteData: () => NormalOperationProps<T>; /** * 是否需要关闭按钮 */ needClose: (closable?: boolean) => NormalOperationProps<T>; /** * 是否需要加载按钮 */ needLoading: (loading?: boolean) => NormalOperationProps<T>; /** * 是否需要取消按钮 */ needCancel: (allowCancel?: boolean) => NormalOperationProps<T>; needConfirm: (needConfirm?: boolean) => NormalOperationProps<T>; confirmText: (text: string) => NormalOperationProps<T>; /** * 是否需要充值按钮 */ needReset: (allowReset?: boolean) => NormalOperationProps<T>; customType: () => AllOperationProps<T>; inOperation: (inOperation?: boolean | string) => AllOperationProps<T>; inToolbar: (inToolbar?: boolean | string) => ToolbarPositionProps<T> & AllOperationProps<T>; inSearchbar: (inSearchbar?: boolean | string) => AllOperationProps<T>; reloadEmit: () => AllOperationProps<T>; clickEmit: (eventName: string) => AllOperationProps<T>; }; declare type ToolbarPositionProps<T> = { left: () => AllOperationProps<T>; right: () => AllOperationProps<T>; }; declare type CustomOperationProps<T> = { slot: (content: string | []) => AllOperationProps<T>; }; declare type NormalOperationProps<T> = CommonOperationProps<T> & OperationButtonProps<T> & T; declare type AllOperationProps<T> = CommonOperationProps<T> & CustomOperationProps<T> & OperationButtonProps<T> & T; interface FetchListProps extends CommonRequestProps<FetchListProps & CrudOptions> { } declare type ValidateProps = { colon: (enabled?: boolean) => ValidateProps & CrudOptions; asterisk: (enabled?: boolean) => ValidateProps & CrudOptions; }; declare type LayoutProps = { vertical: () => LayoutProps & CrudOptions; horizontal: () => LayoutProps & CrudOptions; auto: () => LayoutProps & CrudOptions; fix: () => LayoutProps & CrudOptions; xs: (col: number) => LayoutProps & CrudOptions; sm: (col: number) => LayoutProps & CrudOptions; md: (col: number) => LayoutProps & CrudOptions; lg: (col: number) => LayoutProps & CrudOptions; xl: (col: number) => LayoutProps & CrudOptions; xxl: (col: number) => LayoutProps & CrudOptions; }; declare type ColumnProps = { highlight: () => ColumnProps & CrudOptions; resizable: () => ColumnProps & CrudOptions; }; declare type RowProps = { key: (rowKey: string) => RowProps & CrudOptions; border: () => RowProps & CrudOptions; hover: () => RowProps & CrudOptions; stripe: () => RowProps & CrudOptions; highlight: () => RowProps & CrudOptions; }; declare type HeaderProps = { visible: (visible: boolean | string) => HeaderProps & CrudOptions; sticky: () => HeaderProps & CrudOptions; top: (top: number) => HeaderProps & CrudOptions; group: ([]: Iterable<any>) => HeaderProps & CrudOptions; groupFlattern: ([]: Iterable<any>, []: Iterable<any>) => HeaderProps & CrudOptions; groupSemantic: ([]: Iterable<any>, []: Iterable<any>) => HeaderProps & CrudOptions; }; declare type BodyProps = { height: (height: number) => HeaderProps & CrudOptions; maxHeight: (maxHeight: number) => HeaderProps & CrudOptions; }; declare type SpanProps = { merge: (mergeCondition: []) => SpanProps & CrudOptions; }; declare type SelectionProps = { radioMode: () => SelectionProps & CrudOptions; checkboxMode: () => SelectionProps & SelectionCheckboxProps & CrudOptions; disabledKey: (disabledKey: string) => SelectionProps & CrudOptions; }; declare type SelectionCheckboxProps = { currentOnly: () => SelectionProps & SelectionCheckboxProps & CrudOptions; checkedAll: () => SelectionProps & SelectionCheckboxProps & CrudOptions; }; declare type VirtualListProps = { height: (height: number) => VirtualListProps & CrudOptions; }; declare type ScrollProps = { x: (x: number) => ScrollProps & CrudOptions; y: (y: number) => ScrollProps & CrudOptions; }; declare type ExpandProps = { title: (title: string) => ExpandProps & CrudOptions; width: (width: number) => ExpandProps & CrudOptions; expandAll: (expandAll: boolean) => ExpandProps & CrudOptions; renderIf: (renderConditon: {}) => ExpandProps & CrudOptions; }; declare type DragProps = { rowType: () => DragProps & CrudOptions; handleType: () => DragProps & CrudOptions; wdith: (width: number) => DragProps & CrudOptions; }; declare type LoadingProps = { text: (text: string) => LoadingProps & CrudOptions; emptyText: (text: string) => LoadingProps & CrudOptions; }; export {};