allow arbitrary fields on NodeSpec and MarkSpec (#36062)

* allow null on attrs for NodeType.create methods

* allow arbitrary fields on NodeSpec and MarkSpec
This commit is contained in:
Jerome Indefenzo
2019-06-29 05:38:22 +08:00
committed by Ben Lichtman
parent 1be50fa5c5
commit 2d55bb107c

View File

@@ -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