@flatbiz/antd
Version:
40 lines (38 loc) • 1.77 kB
TypeScript
export type ShouldUpdateFunc<T> = (prev: T | undefined, next: T) => boolean;
declare function usePrevious<T>(state: T, shouldUpdate?: ShouldUpdateFunc<T>): T | undefined;
export type CopyRemoveSpaceProps = {
/** 设置监听复制范围,如果不设置则监听全局 */
target?: () => Element;
/**
* 忽略的class配置(不参与copy逻辑处理的class),例如:['ace_editor']
* ```
* 1. 某些控件(例如:ace编辑器、富文本等)内部自定义处理copy逻辑,此处不能进行拦截,通过配置class属性来忽略
* 2. ignoreClass可配置操作目标class、以及层层父节点class,通过目标节点以及层层父节点的class与ignoreClass匹配成功后,取消后续copy文案处理逻辑
* ```
*/
ignoreClass?: string[];
};
export declare const fbaHooks: {
useEffectCustom: (fn: import("react").EffectCallback, deps: import("react").DependencyList) => void;
useEffectCustomAsync: (fn: () => Promise<void>, deps: import("react").DependencyList) => void;
useThemeToken: () => import("antd").GlobalToken;
useArrayChange: <T>(defautDataList: Array<T>, forceUpdate?: boolean) => readonly [
T[],
{
add: (dataItem: T | Array<T>, isUnshift?: boolean) => void;
update: (index: number, dataItem: T) => void;
delete: (index: number) => T[];
resetList: (dataList: Array<T>) => void;
getList: () => T[];
}
];
usePrevious: typeof usePrevious;
useResponsivePoint: () => string | undefined;
useSafeState: <S extends undefined | unknown>(initialState?: S | (() => S)) => [
S,
import("react").Dispatch<import("react").SetStateAction<S>>
];
useMemoCustom: <T>(fn: () => T, deps: import("react").DependencyList) => T;
useCopyRemoveSpace: (props?: CopyRemoveSpaceProps) => void;
};
export {};