// Generated by dts-bundle v0.7.3 // Dependencies for this module: // ../react // ../nib-core/src/types/prosemirror // ../prosemirror-state // ../nib-core/src/types/common // ../prosemirror-view // ../prosemirror-model declare module 'nib-core' { import Editor from 'nib-core/src/components/Editor'; export default Editor; } declare module 'nib-core/src/components/Editor' { import { FunctionComponent } from 'react'; import { EditorTheme } from 'nib-core/src/types/editor-theme'; import { EditorStyleConfig } from 'nib-core/src/types/editor-style'; import { EditorConfig } from 'nib-core/src/types/editor-config'; import { Addon } from 'nib-core/src/types/addon'; import { ProsemirrorDoc } from 'nib-core/src/types/prosemirror'; interface EditorProps { addons?: Addon[]; autoFocus?: boolean; config?: EditorConfig; defaultValue?: ProsemirrorDoc; licenseKey?: string; onChange?: (doc: ProsemirrorDoc) => void; spellCheck?: boolean; styleConfig?: EditorStyleConfig; theme?: EditorTheme; } const Editor: FunctionComponent; export default Editor; } declare module 'nib-core/src/types/editor-theme' { import { KeyValue } from 'nib-core/src/types/common'; export interface EditorTheme { color: KeyValue; fontSize: KeyValue; fontWeight: KeyValue; borderRadius: KeyValue; border: KeyValue; boxShadow: KeyValue; } } declare module 'nib-core/src/types/editor-style' { import { KeyValue } from 'nib-core/src/types/common'; import { EditorTheme } from 'nib-core/src/types/editor-theme'; interface StyleFunction { ({ theme }: { theme: EditorTheme; }): KeyValue | void; } export interface EditorStyleConfig { wrapper?: StyleFunction; editor?: StyleFunction; toolbar?: { top?: StyleFunction; inline?: StyleFunction; }; separator?: StyleFunction; spinner?: StyleFunction; select?: { wrapper?: StyleFunction; label?: StyleFunction; menu?: StyleFunction; option?: StyleFunction; }; popup?: { wrapper?: StyleFunction; arrowTop?: StyleFunction; arrowBottom?: StyleFunction; }; modal?: { wrapper?: StyleFunction; title?: StyleFunction; header?: StyleFunction; main?: StyleFunction; }; input?: { wrapper?: StyleFunction; input?: StyleFunction; }; icon?: StyleFunction; button?: { toolbar?: StyleFunction; primary?: StyleFunction; }; table?: { table?: StyleFunction; cellMenu?: { wrapper?: StyleFunction; icon?: StyleFunction; option?: StyleFunction; }; }; } export interface EditorStyle extends EditorStyleConfig { constants: EditorTheme; } export {}; } declare module 'nib-core/src/types/editor-config' { interface PluginConfig { options?: string; color?: { colors: string[]; }; } type ToolbarType = { options?: string; block?: { options?: string; grouped?: boolean; }; inline?: { options?: string; }; } & { [prop: string]: any; }; interface ToolbarConfig { options?: string; top?: ToolbarType; inline?: ToolbarType; } export interface EditorConfig { plugins?: PluginConfig; toolbar?: ToolbarConfig; } export {}; } declare module 'nib-core/src/types/addon' { import { ElementType, ReactElement } from 'react'; import { EditorPopup } from 'nib-core/src/types/components'; import { ProsemirrorDoc } from 'nib-core/src/types/prosemirror'; import { EditorState, Transaction } from 'prosemirror-state'; import { KeyValue } from 'nib-core/src/types/common'; import { EditorView } from 'prosemirror-view'; import { KeymapDataMap } from 'nib-core/src/types/application'; export interface Addon { createStateFromDoc?: (fn: (doc: ProsemirrorDoc) => void) => void; dispatchTransactionCallback?: (editorState: EditorState, tr: Transaction) => EditorState; getSerializableState?: () => KeyValue; init?: (defaultValue: KeyValue) => void; name: string; updateLicenseInfo?: (editorRef: HTMLDivElement, licenseKey?: string) => void; viewUpdateCallback?: (view: EditorView) => void; popups?: EditorPopup[]; portals?: ReactElement[]; toolbar: ElementType[]; KeymapInfo?: KeymapDataMap; } } declare module 'nib-core/src/types/prosemirror' { import { KeyValue } from 'nib-core/src/types/common'; import { EditorView } from 'prosemirror-view'; import { EditorState, Transaction } from 'prosemirror-state'; export interface ProsemirrorDoc extends KeyValue { } export interface ProsemirrorEditorState { pmview: EditorView; } export interface ProsemirrorCommand { (state: EditorState, dispatch: ProsemirrorDispatch): boolean | void; } export interface ProsemirrorViewProvider { (): EditorView | undefined; } export interface ProsemirrorDispatch { (tr: Transaction): void; } } declare module 'nib-core/src/types/common' { export interface KeyValue { [key: string]: any; } } declare module 'nib-core/src/types/components' { import { ElementType, MutableRefObject } from 'react'; import { EditorState } from 'prosemirror-state'; import { EditorView } from 'prosemirror-view'; export interface EditorPopup { name: string; getMarker: (editorWrapper: MutableRefObject, pmview?: EditorView) => Element | null; condition?: ({ state }: { state: EditorState; }) => boolean; component: ElementType; } } declare module 'nib-core/src/types/application' { import { ElementType } from 'react'; import { Plugin } from 'prosemirror-state'; import { NodeType, MarkType } from 'prosemirror-model'; import { EditorStyle } from 'nib-core/src/types/editor-style'; import { ProsemirrorCommand, ProsemirrorViewProvider } from 'nib-core/src/types/prosemirror'; export interface KeymapData { key: string; label?: string; } export interface KeymapDataMap { [key: string]: KeymapData; } export interface PluginStyleFn { (theme: EditorStyle): string; } export interface EditorKeymap { (viewProvider?: ProsemirrorViewProvider): { [key: string]: ProsemirrorCommand; }; } export interface EditorKeymapCommand { [key: string]: ProsemirrorCommand; } interface PluginSchem { nodes?: { [key: string]: NodeType; }; marks?: { [key: string]: MarkType; }; } export interface EditorPlugin { name: string; toolbarComponent?: ElementType; keymaps?: EditorKeymap; KeymapInfo?: KeymapDataMap; pmPlugins?: Plugin[]; pmPlugin?: Plugin; schema?: PluginSchem; styles?: PluginStyleFn; } export {}; }