import { HookAPI } from 'antd/es/modal/useModal'; import React from 'react'; import { Subject } from 'rxjs'; export declare const nid: (size?: number | undefined) => string; export declare const sizeUnit: (size: number) => string; export declare const copy: (data: T) => T; export declare const isMod: (e: MouseEvent | KeyboardEvent | React.KeyboardEvent | React.MouseEvent) => boolean; export declare function base64ToArrayBuffer(base64: string): ArrayBufferLike; export declare const getImageData: (filePath?: string) => string; export declare function toArrayBuffer(buffer: any): ArrayBuffer; export declare const download: (data: Blob | Uint8Array, fileName: string) => void; type ModalEvent = { type: K; params: Parameters[0]; }; export declare const modal$: Subject>; export declare const encodeHtml: (str: string) => string; export { isMarkdown } from './isMarkdown'; export declare function debounce(func: { (): void; apply?: any; }, delay: number | undefined): { (): void; flush(): void; cancel(): void; }; import { DependencyList } from 'react'; export type UseTimeoutFnReturn = [() => boolean | null, () => void, () => void]; /** * 创建一个延时执行函数的Hook。 * * @param fn - 需要延时执行的函数 * @param ms - 延时时间(毫秒),默认为0 * @returns 返回一个数组,包含三个元素: * - isReady - 用于检查定时器是否已经触发的函数 * - clear - 用于清除定时器的函数 * - set - 用于重新设置定时器的函数 * * @example * ```ts * const [isReady, clear, set] = useTimeoutFn(() => { * console.log('Timeout triggered'); * }, 1000); * ``` * * @remarks * - 当组件挂载时,定时器会自动启动 * - 当传入的函数(fn)发生变化时,会自动更新回调函数 * - 当延时时间(ms)发生变化时,定时器会自动重置 * - 当组件卸载时,定时器会自动清除 */ export declare function useTimeoutFn(fn: Function, ms?: number): UseTimeoutFnReturn; export type UseDebounceReturn = [() => boolean | null, () => void]; /** * 创建一个防抖函数的 Hook。 * * @param fn - 需要进行防抖处理的函数 * @param ms - 防抖延迟时间(毫秒)。默认为0 * @param deps - 依赖数组,当依赖项改变时会重置防抖计时器。默认为空数组 * @returns 返回一个元组 [isReady, cancel] * - isReady: 一个函数,用于检查防抖是否已经准备好执行 * - cancel: 一个函数,用于取消当前的防抖计时器 * * @example * ```typescript * const [isReady, cancel] = useDebounce(() => { * // 执行一些操作 * }, 1000); * ``` */ export declare function useDebounce(fn: Function, ms?: number, deps?: DependencyList): UseDebounceReturn; export default function useUpdate(): () => void; export declare const useGetSetState: (initialState?: T) => [() => T, (patch: Partial) => void]; export declare function throttle(fn: any, wait: number): { (): void; flush(): void; cancel(): void; }; export declare const debugLog: (path: string, ...msg: any[]) => void; /** * Markdown 编辑器事件常量对象 * @constant * @description 包含编辑器的主要事件名称 * @property {string} SELECTIONCHANGE - 当编辑器选区发生变化时触发的事件名 * @property {string} FOCUS - 当编辑器获得焦点时触发的事件名 * @property {string} BLUR - 当编辑器失去焦点时触发的事件名 */ export declare const MARKDOWN_EDITOR_EVENTS: { SELECTIONCHANGE: string; FOCUS: string; BLUR: string; }; export * from '../parser/parserSlateNodeToMarkdown'; export * from './editorUtils'; export * from './keyboard'; export * from './media'; export * from './path'; export * from './useLocalState';