import { OnChainTableProps } from '.'; import { ClipboardArray } from '../../typings'; type PasteInto = 'child' | 'sibling'; export interface Clipboard { setDataSource: (type: 'shear' | 'copy' | 'paste', data: T[]) => void; pasteInto?: PasteInto; /** 子所在的属性名称,默认`children` */ childKeyName?: string; /** 是否使用红线标记,默认`true` */ isMark?: boolean; /** 剪切前触发 */ onBeforeShear?: (rows: T[]) => Promise; /** 剪切后触发 */ onAfterShear?: (rows: T[]) => void; /** 剪切的数据删除前触发 */ onBeforeDeleteShear?: (params: { /** 是否在中一个table内 */ isSameSpace: boolean; deletes: T[]; }) => Promise; /** * 剪切的数据删除后触发 * ```js * if(isSameSpace) { * // 当前table内触发的剪切删除 * } else { * // 其他table内触发的剪切删除 * runSave() * } * ``` */ onAfterDeleteShear?: (params: { /** 是否在中一个table内 */ isSameSpace: boolean; deletes: T[]; }) => Promise; /** 复制前触发 */ onBeforeCopy?: (rows: T[]) => Promise; /** 复制后触发 */ onAfterCopy?: (rows: T[]) => void; /** 粘贴前触发 */ onBeforePaste?: (params: { target: T; rows: T[]; type: PasteInto; }) => Promise; /** 粘贴后触发 */ onAfterPaste?: (params: { target: T; type: PasteInto; }) => void; /** 回调设置值 */ setInitialState?: (data: any) => any; /** 初始值 */ initialState?: any; } export declare const useClipboard: (params: OnChainTableProps, namespace: string) => { namespace: string; isGainFocus: boolean; focus: () => void; shear: (clipboard: Clipboard, data: any[]) => Promise; copy: (clipboard: Clipboard, data: any[]) => Promise; paste: (clipboard: Clipboard, { pasteData, pasteTarget, }: { pasteData: ClipboardArray; pasteTarget: React.Key[]; }) => Promise; FocusDom: import("react/jsx-runtime").JSX.Element; }; export {};