mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
fix(core): update the typings to be that options and storage are partials on an extended config #5852 (#5854)
Some checks are pending
build / lint (20) (push) Waiting to run
build / test (20, map[name:Demos/Examples spec:./demos/src/Examples/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/Experiments spec:./demos/src/Experiments/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/Extensions spec:./demos/src/Extensions/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/GuideContent spec:./demos/src/GuideContent/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/GuideGettingStarted spec:./demos/src/GuideGettingStarted/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/Marks spec:./demos/src/Marks/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/Nodes spec:./demos/src/Nodes/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Integration spec:./tests/cypress/integration/**/*.spec.{js,ts}]) (push) Waiting to run
build / build (20) (push) Blocked by required conditions
Publish / Release (20) (push) Waiting to run
Some checks are pending
build / lint (20) (push) Waiting to run
build / test (20, map[name:Demos/Examples spec:./demos/src/Examples/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/Experiments spec:./demos/src/Experiments/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/Extensions spec:./demos/src/Extensions/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/GuideContent spec:./demos/src/GuideContent/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/GuideGettingStarted spec:./demos/src/GuideGettingStarted/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/Marks spec:./demos/src/Marks/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Demos/Nodes spec:./demos/src/Nodes/**/*.spec.{js,ts}]) (push) Waiting to run
build / test (20, map[name:Integration spec:./tests/cypress/integration/**/*.spec.{js,ts}]) (push) Waiting to run
build / build (20) (push) Blocked by required conditions
Publish / Release (20) (push) Waiting to run
This commit is contained in:
parent
4b2de3394a
commit
87d63d8d17
5
.changeset/fluffy-panthers-yell.md
Normal file
5
.changeset/fluffy-panthers-yell.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@tiptap/core": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Update TypeScript types to allow options to be optional
|
@ -474,9 +474,9 @@ export class Extension<Options = any, Storage = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(
|
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(
|
||||||
extendedConfig: Partial<ExtensionConfig<ExtendedOptions, ExtendedStorage>> = {},
|
extendedConfig: Partial<ExtensionConfig<Partial<ExtendedOptions>, Partial<ExtendedStorage>>> = {},
|
||||||
) {
|
) {
|
||||||
const extension = new Extension<ExtendedOptions, ExtendedStorage>({ ...this.config, ...extendedConfig })
|
const extension = new Extension<ExtendedOptions, ExtendedStorage>({ ...this.config, ...extendedConfig } as ExtensionConfig)
|
||||||
|
|
||||||
extension.parent = this
|
extension.parent = this
|
||||||
|
|
||||||
|
@ -606,9 +606,9 @@ export class Mark<Options = any, Storage = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(
|
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(
|
||||||
extendedConfig: Partial<MarkConfig<ExtendedOptions, ExtendedStorage>> = {},
|
extendedConfig: Partial<MarkConfig<Partial<ExtendedOptions>, Partial<ExtendedStorage>>> = {},
|
||||||
) {
|
) {
|
||||||
const extension = new Mark<ExtendedOptions, ExtendedStorage>(extendedConfig)
|
const extension = new Mark<ExtendedOptions, ExtendedStorage>(extendedConfig as MarkConfig)
|
||||||
|
|
||||||
extension.parent = this
|
extension.parent = this
|
||||||
|
|
||||||
|
@ -816,9 +816,9 @@ export class Node<Options = any, Storage = any> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(
|
extend<ExtendedOptions = Options, ExtendedStorage = Storage>(
|
||||||
extendedConfig: Partial<NodeConfig<ExtendedOptions, ExtendedStorage>> = {},
|
extendedConfig: Partial<NodeConfig<Partial<ExtendedOptions>, Partial<ExtendedStorage>>> = {},
|
||||||
) {
|
) {
|
||||||
const extension = new Node<ExtendedOptions, ExtendedStorage>(extendedConfig)
|
const extension = new Node<ExtendedOptions, ExtendedStorage>(extendedConfig as NodeConfig)
|
||||||
|
|
||||||
extension.parent = this
|
extension.parent = this
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user