diff --git a/.changeset/fluffy-panthers-yell.md b/.changeset/fluffy-panthers-yell.md new file mode 100644 index 000000000..1e763dfc9 --- /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 fa649aa34..ae5870837 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 ea57edd7f..3200f705f 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 567e0eef7..05ef81539 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