import { ProviderFactory } from '@uidu/editor-common';
import type { Providers } from '@uidu/editor-common/provider-factory';
import { FileIdentifier, MediaClientConfig, MediaUploadOptions } from '@uidu/media-core';
import { MediaFile, MediaPickerProps } from '@uidu/media-picker';
import { NodeType } from 'prosemirror-model';
import { EditorView } from 'prosemirror-view';
import { MediaPluginState } from "./pm-plugins/types.js";
export interface MediaOptions {
    provider?: Providers['mediaProvider'];
    allowMediaSingle?: boolean | MediaSingleOptions;
    allowMediaGroup?: boolean;
    customDropzoneContainer?: HTMLElement;
    customMediaPicker?: CustomMediaPicker;
    allowResizing?: boolean;
    allowResizingInTables?: boolean;
    allowAnnotation?: boolean;
    allowLinking?: boolean;
    allowLazyLoading?: boolean;
    allowBreakoutSnapPoints?: boolean;
    allowAdvancedToolBarOptions?: boolean;
    allowMediaSingleEditable?: boolean;
    allowRemoteDimensionsFetch?: boolean;
    allowDropzoneDropLine?: boolean;
    allowMarkingUploadsAsIncomplete?: boolean;
    fullWidthEnabled?: boolean;
    uploadErrorHandler?: (state: MediaState) => void;
    waitForMediaUpload?: boolean;
    isCopyPasteEnabled?: boolean;
    allowAltTextOnImages?: boolean;
    altTextValidator?: (value: string) => string[];
    useForgePlugins?: boolean;
    useMediaPickerPopup?: boolean;
    mediaPickerProps?: (mediaState: MediaPluginState) => Omit<MediaPickerProps, 'uploadOptions'>;
}
export interface MediaSingleOptions {
    disableLayout?: boolean;
}
export interface MediaState {
    id: string;
    storage: string;
    metadata: {
        size?: number;
        filename: string;
        mime_type?: string;
        width: number | undefined;
        height: number | undefined;
    };
    scaleFactor?: number;
    error?: {
        name: string;
        description: string;
    };
    url: string;
}
export declare type Listener = (data: any) => void;
export interface CustomMediaPicker {
    on(event: string, cb: Listener): void;
    removeAllListeners(event: any): void;
    emit(event: string, data: any): void;
    destroy(): void;
    setUploadOptions(uploadOptions: MediaUploadOptions): void;
}
export declare type MobileUploadEndEventPayload = {
    readonly file: MediaFile & {
        readonly collectionName?: string;
        readonly publicId?: string;
    };
};
export declare type MediaEditorState = {
    mediaClientConfig?: MediaClientConfig;
    editor?: {
        pos: number;
        identifier: FileIdentifier;
    };
};
export declare type OpenMediaEditor = {
    type: 'open';
    pos: number;
    identifier: FileIdentifier;
};
export declare type UploadAnnotation = {
    type: 'upload';
    newIdentifier: FileIdentifier;
};
export declare type CloseMediaEditor = {
    type: 'close';
};
export declare type SetMediaMediaClientConfig = {
    type: 'setMediaClientConfig';
    mediaClientConfig?: MediaClientConfig;
};
export declare type MediaEditorAction = OpenMediaEditor | CloseMediaEditor | UploadAnnotation | SetMediaMediaClientConfig;
export declare type MediaToolbarBaseConfig = {
    title: string;
    getDomRef?: (view: EditorView) => HTMLElement | undefined;
    nodeType: NodeType | NodeType[];
};
export declare type MediaFloatingToolbarOptions = {
    providerFactory?: ProviderFactory;
    allowResizing?: boolean;
    allowAnnotation?: boolean;
    allowLinking?: boolean;
    allowAdvancedToolBarOptions?: boolean;
    allowResizingInTables?: boolean;
    allowAltTextOnImages?: boolean;
    altTextValidator?: (value: string) => string[];
};
