@cainiaofe/cn-ui-m
Version:
86 lines (85 loc) • 2.44 kB
TypeScript
import { Service } from 'ahooks/lib/useRequest/src/types';
import { CnRequestConfig } from 'cn-request';
import * as React from 'react';
export type BasicComponentProps = React.HTMLAttributes<HTMLDivElement>;
export interface StyleOverrides {
/**
* 自定义内联样式
*/
style?: React.CSSProperties;
/**
* 自定义类名
*/
className?: string;
}
export interface Object {
[key: string]: unknown;
}
export type CSSSelector = string;
export type ScrollContainerElement = HTMLElement;
export type ScrollContainer = (() => ScrollContainerElement) | CSSSelector;
export declare type BasicSizeType = 'small' | 'medium' | 'large';
export interface IRequestConfig extends CnRequestConfig {
manual?: boolean;
onBefore?: (params: any) => void;
onSuccess?: (data: any, params: any) => void;
onError?: (e: Error, params: any) => void;
onFinally?: (params: any, data?: any, e?: Error) => void;
defaultParams?: any;
formatResult?: (data?: any) => any;
formatParam?: (params?: any) => any;
service?: Service<any, any>;
refreshDeps?: any;
refreshDepsAction?: () => void;
loadingDelay?: number;
pollingInterval?: number;
pollingWhenHidden?: boolean;
pollingErrorRetryCount?: number;
refreshOnWindowFocus?: boolean;
focusTimespan?: number;
debounceWait?: number;
debounceLeading?: boolean;
debounceTrailing?: boolean;
debounceMaxWait?: number;
throttleWait?: number;
throttleLeading?: boolean;
throttleTrailing?: boolean;
cacheKey?: string;
cacheTime?: number;
staleTime?: number;
setCache?: (data: any) => void;
getCache?: (params: any) => any;
retryCount?: number;
retryInterval?: number;
ready?: boolean;
}
export interface BaseFieldPreviewProps {
/**
* 是否为预览态
*/
isPreview?: boolean;
/**
* 预览态模式下渲染的内容
*/
renderPreview?: (value?: any) => React.ReactNode | React.ReactNode[];
/**
* 预览态模式下渲染的类名
*/
previewClassName?: string;
/**
* 预览态模式下渲染的样式
*/
previewStyle?: React.CSSProperties;
}
/**
* common dateSource item
*/
export interface DataSourceItemProps {
label?: string;
text?: string;
value?: any;
disabled?: boolean;
checked?: boolean;
style?: React.CSSProperties;
children?: DataSourceItemProps[];
}