Files
outline/shared/editor/nodes/Node.ts
Tom Moor bf45e97641 chore: Enforce type import consistency (#10968)
* Update types

* fix circular dep

* type imports

* lint type imports and --fix
2025-12-19 23:07:02 -05:00

50 lines
1.1 KiB
TypeScript

import type { InputRule } from "prosemirror-inputrules";
import type { ParseSpec } from "prosemirror-markdown";
import type {
NodeSpec,
Node as ProsemirrorNode,
NodeType,
Schema,
} from "prosemirror-model";
import type { Command } from "prosemirror-state";
import type { CommandFactory } from "../lib/Extension";
import Extension from "../lib/Extension";
import type { MarkdownSerializerState } from "../lib/markdown/serializer";
export default abstract class Node extends Extension {
get type() {
return "node";
}
get schema(): NodeSpec {
return {};
}
get markdownToken(): string {
return "";
}
inputRules(_options: { type: NodeType; schema: Schema }): InputRule[] {
return [];
}
keys(_options: { type: NodeType; schema: Schema }): Record<string, Command> {
return {};
}
commands(_options: {
type: NodeType;
schema: Schema;
}): Record<string, CommandFactory> | CommandFactory {
return {};
}
toMarkdown(_state: MarkdownSerializerState, _node: ProsemirrorNode) {
throw new Error("toMarkdown not implemented");
}
parseMarkdown(): ParseSpec | void {
return undefined;
}
}