diff --git a/.changeset/fluffy-panthers-yell.md b/.changeset/fluffy-panthers-yell.md new file mode 100644 index 0000000000..1e763dfc9e --- /dev/null +++ b/.changeset/fluffy-panthers-yell.md @@ -0,0 +1,5 @@ +--- +"@tiptap/core": patch +--- + +Update TypeScript types to allow options to be optional diff --git a/packages/core/src/Extension.ts b/packages/core/src/Extension.ts index fa649aa34c..ae58708372 100644 --- a/packages/core/src/Extension.ts +++ b/packages/core/src/Extension.ts @@ -474,9 +474,9 @@ export class Extension { } extend( - extendedConfig: Partial> = {}, + extendedConfig: Partial, Partial>> = {}, ) { - const extension = new Extension({ ...this.config, ...extendedConfig }) + const extension = new Extension({ ...this.config, ...extendedConfig } as ExtensionConfig) extension.parent = this diff --git a/packages/core/src/Mark.ts b/packages/core/src/Mark.ts index ea57edd7f3..3200f705fa 100644 --- a/packages/core/src/Mark.ts +++ b/packages/core/src/Mark.ts @@ -606,9 +606,9 @@ export class Mark { } extend( - extendedConfig: Partial> = {}, + extendedConfig: Partial, Partial>> = {}, ) { - const extension = new Mark(extendedConfig) + const extension = new Mark(extendedConfig as MarkConfig) extension.parent = this diff --git a/packages/core/src/Node.ts b/packages/core/src/Node.ts index 567e0eef7d..05ef81539a 100644 --- a/packages/core/src/Node.ts +++ b/packages/core/src/Node.ts @@ -816,9 +816,9 @@ export class Node { } extend( - extendedConfig: Partial> = {}, + extendedConfig: Partial, Partial>> = {}, ) { - const extension = new Node(extendedConfig) + const extension = new Node(extendedConfig as NodeConfig) extension.parent = this