@edtr-io/plugin-text
Version:
34 lines • 1.42 kB
TypeScript
import * as React from 'react';
import { Editor } from 'slate';
import { EditorProps } from 'slate-react';
import { SlatePluginClosure } from '../factory/types';
import { TextPlugin } from '..';
export declare enum VisibleControls {
All = 0,
Headings = 1,
Lists = 2,
Colors = 3
}
export interface ControlProps {
editor: Editor;
name: string;
pluginClosure: SlatePluginClosure;
readOnly?: boolean;
}
export interface SubControlProps extends ControlProps {
switchControls: (control: VisibleControls) => void;
onChange: (editor: Editor) => Editor;
}
export interface UiPluginOptions {
Component: React.ComponentType<Partial<EditorProps> & ControlProps>;
}
export declare const Controls: React.FunctionComponent<ControlProps>;
export declare function isTouchDevice(): boolean;
export declare const createUiPlugin: (options: UiPluginOptions) => (pluginClosure: React.RefObject<{
overlayContext: import("@edtr-io/editor-ui").OverlayContextValue;
name: string;
parent?: import("../factory/editor").SlateEditorAdditionalProps | undefined;
replace?: ((options?: import("@edtr-io/core").DocumentState | undefined) => void) | undefined;
plugins: Record<string, import("@edtr-io/core").Plugin<import("@edtr-io/core/dist/plugin-state").StateDescriptor<any, any, unknown>, any>>;
}>) => TextPlugin;
//# sourceMappingURL=index.d.ts.map