import type { ProgressPromise } from '@prezly/progress-promise'; import type { OEmbedInfo } from '@prezly/sdk'; import type { AttachmentNode, ContactNode, CoverageNode, GalleryNode, ImageNode, StoryBookmarkNode, StoryEmbedNode } from '@prezly/slate-types'; import { PlaceholderNode } from './PlaceholderNode'; declare const Type: typeof PlaceholderNode.Type; type Type = PlaceholderNode.Type; type Uuid = PlaceholderNode['uuid']; interface Data { [Type.ATTACHMENT]: { file: AttachmentNode['file']; caption: string; trigger: 'placeholder' | 'paste'; }; [Type.CONTACT]: { contact: ContactNode['contact']; }; [Type.COVERAGE]: { coverage: CoverageNode['coverage']; }; [Type.EMBED]: { url: string; oembed?: OEmbedInfo; fallback?: 'link'; }; [Type.GALLERY]: { gallery: GalleryNode; operation: 'add' | 'edit'; }; [Type.GALLERY_BOOKMARK]: { url: string; oembed?: OEmbedInfo; }; [Type.IMAGE]: { image: ImageNode; operation: 'add' | 'replace' | 'crop'; trigger: 'image-menu' | 'placeholder' | 'paste' | 'paste-html' | 'oembed'; }; [Type.MEDIA]: { media: { type: 'image'; file: ImageNode['file']; caption: string; }; }; [Type.SOCIAL_POST]: { url: string; oembed?: OEmbedInfo; }; [Type.STORY_BOOKMARK]: { node: StoryBookmarkNode; }; [Type.STORY_EMBED]: { node: StoryEmbedNode; }; [Type.VIDEO]: { url: string; oembed?: OEmbedInfo; fallback?: 'link'; }; [Type.WEB_BOOKMARK]: { url: string; oembed?: OEmbedInfo; fallback?: 'link'; }; } type Identifier = { type: T; uuid: Uuid; }; type Callbacks = { onActivate: (active: boolean) => void; onTrigger?: () => void; onLoading: (loading: boolean) => void; onResolve: (data: Data[T]) => void; onReject: () => void; onProgress: (progress: number) => void; }; type Unfollow = () => void; export declare const PlaceholdersManager: { activate({ type, uuid }: Identifier): void; deactivate({ type, uuid }: Identifier): void; deactivateAll(): void; trigger({ type, uuid }: Identifier): void; register(type: T_3, uuid: Uuid, promise: Promise | ProgressPromise): void; follow(type: T_4, uuid: Uuid, callbacks: Partial>): Unfollow; }; export declare function usePlaceholderManagement(type: T, uuid: Uuid, callbacks: Partial, 'onTrigger' | 'onResolve' | 'onReject' | 'onProgress'>>): { isActive: boolean | undefined; isLoading: boolean; }; export {};