import { ContentBlock, Editor, ContentState, EditorState, RawDraftContentState } from 'draft-js'; import React, { ElementRef } from 'react'; declare const DRAFT_DEFAULT_MAX_DEPTH = 4; declare const DRAFT_DEFAULT_DEPTH_CLASS = "public-DraftStyleDefault-depth"; /** * Generates CSS styles for list items, for a given selector pattern. * @deprecated Use getListNestingStyles instead, which has the same signature. * @param {string} selectorPrefix * @param {number} minDepth * @param {number} maxDepth * @param {Array} counterStyles */ declare const generateListNestingStyles: (selectorPrefix: string, minDepth: number, maxDepth: number, counterStyles: string[]) => string; /** * Dynamically generates the right list nesting styles. * Can be wrapped as a pure component - to re-render only when `max` changes (eg. never). */ declare const getListNestingStyles: (maxDepth: number, minDepth?: number, selectorPrefix?: string, counterStyles?: string[]) => string; /** * Add depth classes that Draft.js doesn't provide. * See https://github.com/facebook/draft-js/blob/232791a4e92d94a52c869f853f9869367bdabdac/src/component/contents/DraftEditorContents-core.react.js#L58-L62. * @param {ContentBlock} block */ declare const blockDepthStyleFn: (block: ContentBlock) => string; declare const onDraftEditorCopy: (editor: Editor, e: React.ClipboardEvent) => void; declare const onDraftEditorCut: (editor: Editor, e: React.ClipboardEvent) => void; /** * Registers custom copy/cut event listeners on an editor. */ declare const registerCopySource: (ref: ElementRef) => { unregister(): void; }; /** * Returns pasted content coming from Draft.js editors set up to serialise * their Draft.js content within the HTML. */ declare const getDraftEditorPastedContent: (html: string | undefined) => ContentState | null; /** * Handles pastes coming from Draft.js editors set up to serialise * their Draft.js content within the HTML. * This SHOULD NOT be used for stripPastedStyles editor. */ declare const handleDraftEditorPastedText: (html: string | undefined, editorState: EditorState) => false | EditorState; interface DraftDecoratorType { /** * Given a `ContentBlock`, return an immutable List of decorator keys. */ getDecorations(block: ContentBlock, contentState: ContentState): Immutable.List; /** * Given a decorator key, return the component to use when rendering * this decorated range. */ getComponentForKey(key: string): Function; /** * Given a decorator key, optionally return the props to use when rendering * this decorated range. */ getPropsForKey(key: string): any; } /** * Creates a new EditorState from a RawDraftContentState, or an empty editor state by * passing `null`. Optionally takes a decorator. */ declare const createEditorStateFromRaw: (rawContentState: RawDraftContentState | null, decorator?: DraftDecoratorType) => EditorState; /** * Serialises the editorState using `convertToRaw`, but returns `null` if * the editor content is empty (no text, entities, styles). */ declare const serialiseEditorStateToRaw: (editorState: EditorState) => RawDraftContentState | null; export { DRAFT_DEFAULT_DEPTH_CLASS, DRAFT_DEFAULT_MAX_DEPTH, blockDepthStyleFn, createEditorStateFromRaw, generateListNestingStyles, getDraftEditorPastedContent, getListNestingStyles, handleDraftEditorPastedText, onDraftEditorCopy, onDraftEditorCut, registerCopySource, serialiseEditorStateToRaw };