From 2d55bb107cbaadd08b3dccc72ae30e64588ffcbd Mon Sep 17 00:00:00 2001 From: Jerome Indefenzo Date: Sat, 29 Jun 2019 05:38:22 +0800 Subject: [PATCH] allow arbitrary fields on NodeSpec and MarkSpec (#36062) * allow null on attrs for NodeType.create methods * allow arbitrary fields on NodeSpec and MarkSpec --- types/prosemirror-model/index.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/types/prosemirror-model/index.d.ts b/types/prosemirror-model/index.d.ts index aa6cdaea9a..7eebacbbbc 100644 --- a/types/prosemirror-model/index.d.ts +++ b/types/prosemirror-model/index.d.ts @@ -1245,6 +1245,10 @@ export interface NodeSpec { * to a string representation for debugging (e.g. in error messages). */ toDebugString?: ((node: ProsemirrorNode) => string) | null; + /** + * Allow specifying arbitrary fields on a NodeSpec. + */ + [key: string]: any; } export interface MarkSpec { /** @@ -1293,6 +1297,10 @@ export interface MarkSpec { * `mark` field in the rules is implied. */ parseDOM?: ParseRule[] | null; + /** + * Allow specifying arbitrary fields on a MarkSpec. + */ + [key: string]: any; } /** * Used to [define](#model.NodeSpec.attrs) attributes on nodes or