fix(core): update the typing of addOptions, addStorage to have an optional parent #5768 (#5770)

This commit is contained in:
Nick Perez 2024-10-28 21:44:47 +01:00 committed by GitHub
parent cc4b82654a
commit d2f366d6d4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 11 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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