@edtr-io/plugin-text
Version:
49 lines • 1.94 kB
TypeScript
import { Editor, MarkJSON, NodeJSON, Range as CoreRange } from 'slate';
import { Rule } from 'slate-html-serializer';
import { EditorProps, Plugin, RenderMarkProps, RenderNodeProps } from 'slate-react';
import { PluginThemeFactory } from '@edtr-io/ui';
export declare type MarkEditorProps = RenderMarkProps;
export interface MarkRendererProps {
mark: MarkJSON;
}
export declare type NodeEditorProps = RenderNodeProps;
export declare type NodeControlsProps = EditorProps & {
editor: Editor;
};
export interface NodeRendererProps {
node: NodeJSON;
}
export declare type TextPlugin = Plugin & Rule & {
commands?: {
[key: string]: (editor: Editor, ...args: any[]) => Editor;
};
};
export declare const textPlugin: import("@edtr-io/core/src").StatefulPlugin<import("@edtr-io/core/src/plugin-state").StateDescriptor<import("slate").ValueJSON, import("slate").ValueJSON, {
(): import("slate").ValueJSON;
value: import("slate").ValueJSON;
set(value: import("slate").ValueJSON | ((currentValue: import("slate").ValueJSON) => import("slate").ValueJSON)): void;
}>, import("./factory/editor").SlateEditorAdditionalProps>;
export interface TextTheme {
backgroundColor: string;
color: string;
hoverColor: string;
active: {
backgroundColor: string;
color: string;
};
dropDown: {
backgroundColor: string;
};
plugins: {
colors: {
colors: string[];
defaultColor: string;
};
};
}
export declare const textPluginThemeFactory: PluginThemeFactory<TextTheme>;
export declare const createTextPluginTheme: (pluginName: string, theme: import("../../ui/src").Theme) => TextTheme;
export declare function trimSelection(editor: Editor): void;
export declare function getTrimmedSelectionRange(editor: Editor): CoreRange;
export * from './factory';
//# sourceMappingURL=index.d.ts.map