import { Component, ComponentConstructorOptions, SvelteComponent } from "svelte"; import { CoreMarkView, CoreMarkViewSpec, CoreMarkViewUserOptions, CoreNodeView, CoreNodeViewSpec, CoreNodeViewUserOptions, CorePluginView, CorePluginViewSpec, CorePluginViewUserOptions, CoreWidgetView, CoreWidgetViewSpec, CoreWidgetViewUserOptions, PluginViewSpec, WidgetDecorationFactory, WidgetDecorationSpec } from "@prosemirror-adapter/core"; import { Writable } from "svelte/store"; import { Decoration, DecorationSource, EditorView, MarkViewConstructor, NodeViewConstructor } from "prosemirror-view"; import { Attrs, Mark, Node } from "prosemirror-model"; import { EditorState } from "prosemirror-state"; //#region src/types.d.ts type AnyRecord = Record; type SvelteClassComponentConstructor = new (options: ComponentConstructorOptions) => SvelteComponent; type SvelteComponentConstructor = SvelteClassComponentConstructor | Component; /** * @internal */ interface SvelteRenderOptions { context: Map; } //#endregion //#region src/markView/SvelteMarkViewOptions.d.ts type SvelteMarkViewComponent = SvelteComponentConstructor; type SvelteMarkViewSpec = CoreMarkViewSpec; type SvelteMarkViewUserOptions = CoreMarkViewUserOptions; //#endregion //#region src/markView/markViewContext.d.ts interface MarkViewContext { contentRef: (element: HTMLElement | null) => void; view: EditorView; mark: Writable; } declare function useMarkViewContext(key: Key): MarkViewContext[Key]; declare const markViewFactoryKey = "[ProsemirrorAdapter]useMarkViewFactory"; type MarkViewFactory = (options: SvelteMarkViewUserOptions) => MarkViewConstructor; declare const useMarkViewFactory: () => MarkViewFactory; //#endregion //#region src/SvelteRenderer.d.ts /** * @internal */ interface SvelteRenderer { key: string; context: Context; render: (options: SvelteRenderOptions) => VoidFunction; updateContext: () => void; } /** * @internal */ interface SvelteRendererResult { readonly renderSvelteRenderer: (renderer: SvelteRenderer, options: SvelteRenderOptions) => void; readonly removeSvelteRenderer: (renderer: SvelteRenderer) => void; } /** * @internal */ declare function useSvelteRenderer(): SvelteRendererResult; //#endregion //#region src/markView/SvelteMarkView.d.ts /** * @internal */ declare abstract class AbstractSvelteMarkView extends CoreMarkView implements SvelteRenderer { context: MarkViewContext; updateContext: () => void; abstract render: (options: SvelteRenderOptions) => VoidFunction; } declare class SvelteMarkView extends AbstractSvelteMarkView implements SvelteRenderer { render: (options: SvelteRenderOptions) => VoidFunction; } //#endregion //#region src/markView/useSvelteMarkViewCreator.d.ts /** * @internal */ declare function buildSvelteMarkViewCreator(renderSvelteRenderer: SvelteRendererResult['renderSvelteRenderer'], removeSvelteRenderer: SvelteRendererResult['removeSvelteRenderer'], SvelteMarkViewClass: new (spec: CoreMarkViewSpec) => AbstractSvelteMarkView, context: Map): (userOptions: CoreMarkViewUserOptions) => MarkViewConstructor; //#endregion //#region src/nodeView/SvelteNodeViewOptions.d.ts type SvelteNodeViewComponent = SvelteComponentConstructor; type SvelteNodeViewSpec = CoreNodeViewSpec; type SvelteNodeViewUserOptions = CoreNodeViewUserOptions; //#endregion //#region src/nodeView/nodeViewContext.d.ts interface NodeViewContext { contentRef: (element: HTMLElement | null) => void; view: EditorView; getPos: () => number | undefined; setAttrs: (attrs: Attrs) => void; node: Writable; selected: Writable; decorations: Writable; innerDecorations: Writable; } declare function useNodeViewContext(key: Key): NodeViewContext[Key]; declare const nodeViewFactoryKey = "[ProsemirrorAdapter]useNodeViewFactory"; type NodeViewFactory = (options: SvelteNodeViewUserOptions) => NodeViewConstructor; declare const useNodeViewFactory: () => NodeViewFactory; //#endregion //#region src/nodeView/SvelteNodeView.d.ts /** * @internal */ declare abstract class AbstractSvelteNodeView extends CoreNodeView implements SvelteRenderer { context: NodeViewContext; updateContext: () => void; abstract render: (options: SvelteRenderOptions) => VoidFunction; } declare class SvelteNodeView extends AbstractSvelteNodeView implements SvelteRenderer { render: (options: SvelteRenderOptions) => VoidFunction; } //#endregion //#region src/nodeView/useSvelteNodeViewCreator.d.ts /** * @internal */ declare function buildSvelteNodeViewCreator(renderSvelteRenderer: SvelteRendererResult['renderSvelteRenderer'], removeSvelteRenderer: SvelteRendererResult['removeSvelteRenderer'], SvelteNodeViewClass: new (spec: CoreNodeViewSpec) => AbstractSvelteNodeView, context: Map): (userOptions: CoreNodeViewUserOptions) => NodeViewConstructor; //#endregion //#region src/pluginView/SveltePluginViewOptions.d.ts type SveltePluginViewComponent = SvelteComponentConstructor; type SveltePluginViewSpec = CorePluginViewSpec; type SveltePluginViewUserOptions = CorePluginViewUserOptions; //#endregion //#region src/pluginView/pluginViewContext.d.ts type PluginViewContentRef = (element: HTMLElement | null) => void; interface PluginViewContext { view: Writable; prevState: Writable; } declare function usePluginViewContext(key: Key): PluginViewContext[Key]; type PluginViewFactory = (options: SveltePluginViewUserOptions) => PluginViewSpec; declare const pluginViewFactoryKey = "[ProsemirrorAdapter]usePluginViewFactory"; declare const usePluginViewFactory: () => PluginViewFactory; //#endregion //#region src/pluginView/SveltePluginView.d.ts declare class SveltePluginView extends CorePluginView implements SvelteRenderer { context: PluginViewContext; updateContext: () => void; render: (options: SvelteRenderOptions) => VoidFunction; } //#endregion //#region src/Provider.d.ts declare function useProsemirrorAdapterProvider(): void; //#endregion //#region src/widgetView/SvelteWidgetViewOptions.d.ts type SvelteWidgetViewComponent = SvelteComponentConstructor; type SvelteWidgetViewSpec = CoreWidgetViewSpec; type SvelteWidgetViewUserOptions = CoreWidgetViewUserOptions; //#endregion //#region src/widgetView/widgetViewContext.d.ts interface WidgetViewContext { view: EditorView; getPos: () => number | undefined; spec?: WidgetDecorationSpec; } declare function useWidgetViewContext(key: Key): WidgetViewContext[Key]; type WidgetViewFactory = (options: SvelteWidgetViewUserOptions) => WidgetDecorationFactory; declare const widgetViewFactoryKey = "[ProsemirrorAdapter]useWidgetViewFactory"; declare const useWidgetViewFactory: () => WidgetViewFactory; //#endregion //#region src/widgetView/SvelteWidgetView.d.ts declare class SvelteWidgetView extends CoreWidgetView implements SvelteRenderer { context: WidgetViewContext; updateContext: () => void; render: (options: SvelteRenderOptions) => VoidFunction; } //#endregion export { AbstractSvelteMarkView, AbstractSvelteNodeView, type MarkViewContext, type MarkViewFactory, type NodeViewContext, type NodeViewFactory, type PluginViewContentRef, type PluginViewContext, type PluginViewFactory, SvelteMarkView, type SvelteMarkViewComponent, type SvelteMarkViewSpec, type SvelteMarkViewUserOptions, SvelteNodeView, type SvelteNodeViewComponent, type SvelteNodeViewSpec, type SvelteNodeViewUserOptions, SveltePluginView, type SveltePluginViewComponent, type SveltePluginViewSpec, type SveltePluginViewUserOptions, type SvelteRenderer, type SvelteRendererResult, SvelteWidgetView, type SvelteWidgetViewComponent, type SvelteWidgetViewSpec, type SvelteWidgetViewUserOptions, type WidgetViewContext, type WidgetViewFactory, buildSvelteMarkViewCreator, buildSvelteNodeViewCreator, markViewFactoryKey, nodeViewFactoryKey, pluginViewFactoryKey, useMarkViewContext, useMarkViewFactory, useNodeViewContext, useNodeViewFactory, usePluginViewContext, usePluginViewFactory, useProsemirrorAdapterProvider, useSvelteRenderer, useWidgetViewContext, useWidgetViewFactory, widgetViewFactoryKey }; //# sourceMappingURL=index.d.ts.map