Skip to content

Commit

Permalink
fix(core): update the typing of addOptions, addStorage to have an…
Browse files Browse the repository at this point in the history
… optional parent #5768 (#5770)
  • Loading branch information
nperez0111 authored Oct 28, 2024
1 parent cc4b826 commit d2f366d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/happy-vans-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@tiptap/core": patch
---

Updates the types of `addOptions` and `addStorage` to have the parent be possibly undefined which is the most accurate typing
4 changes: 2 additions & 2 deletions packages/core/src/Extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ declare module '@tiptap/core' {
*/
addOptions?: (this: {
name: string
parent: Exclude<ParentConfig<ExtensionConfig<Options, Storage>>['addOptions'], undefined>
parent: ParentConfig<ExtensionConfig<Options, Storage>>['addOptions']
}) => Options

/**
Expand All @@ -76,7 +76,7 @@ declare module '@tiptap/core' {
addStorage?: (this: {
name: string
options: Options
parent: Exclude<ParentConfig<ExtensionConfig<Options, Storage>>['addStorage'], undefined>
parent: ParentConfig<ExtensionConfig<Options, Storage>>['addStorage']
}) => Storage

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/Mark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ declare module '@tiptap/core' {
*/
addOptions?: (this: {
name: string
parent: Exclude<ParentConfig<MarkConfig<Options, Storage>>['addOptions'], undefined>
parent: ParentConfig<MarkConfig<Options, Storage>>['addOptions']
}) => Options

/**
Expand All @@ -79,7 +79,7 @@ declare module '@tiptap/core' {
addStorage?: (this: {
name: string
options: Options
parent: Exclude<ParentConfig<MarkConfig<Options, Storage>>['addStorage'], undefined>
parent: ParentConfig<MarkConfig<Options, Storage>>['addStorage']
}) => Storage

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/Node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ declare module '@tiptap/core' {
*/
addOptions?: (this: {
name: string
parent: Exclude<ParentConfig<NodeConfig<Options, Storage>>['addOptions'], undefined>
parent: ParentConfig<NodeConfig<Options, Storage>>['addOptions']
}) => Options

/**
Expand All @@ -80,7 +80,7 @@ declare module '@tiptap/core' {
addStorage?: (this: {
name: string
options: Options
parent: Exclude<ParentConfig<NodeConfig<Options, Storage>>['addStorage'], undefined>
parent: ParentConfig<NodeConfig<Options, Storage>>['addStorage']
}) => Storage

/**
Expand Down

0 comments on commit d2f366d

Please sign in to comment.