UNPKG

@flatbiz/antd

Version:
48 lines (45 loc) 2.18 kB
import { useEffect } from 'react'; declare function createCtx<A extends object | null>(name?: string, defaultValue?: A): readonly [ () => A, import("react").Provider<A | undefined> ]; 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 type UseEffectParams = Parameters<typeof useEffect>; export type UseEffectReturn = ReturnType<typeof useEffect>; export type EffectCallback = UseEffectParams[0]; 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: (this: unknown, dataItem: T | T[], isUnshift?: boolean | undefined) => void; update: (this: unknown, index: number, dataItem: T) => void; delete: (this: unknown, index: number) => T[]; resetList: (this: unknown, dataList: T[]) => void; getList: (this: unknown) => T[]; } ]; usePrevious: typeof usePrevious; useResponsivePoint: () => string | undefined; useMemoCustom: <T>(fn: () => T, deps: import("react").DependencyList) => T; useCopyRemoveSpace: (props?: CopyRemoveSpaceProps) => void; useUuid: () => string; createCtx: typeof createCtx; useEffectOnce: (effect: EffectCallback, dep: any) => UseEffectReturn; }; export {};