fix extends
This commit is contained in:
@@ -784,13 +784,13 @@ interface ExtensionCallback {
|
|||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ExtensionExtends {
|
type ExtensionExtends = {
|
||||||
name: string
|
name: string
|
||||||
options: AnyObject
|
options: AnyObject
|
||||||
commands: (params: ExtensionCallback) => CommandSpec
|
commands: (params: ExtensionCallback) => CommandSpec
|
||||||
}
|
}
|
||||||
|
|
||||||
class ExtensionTest<Options, Extends extends ExtensionExtends> {
|
class ExtensionTest<Options, Extends extends ExtensionExtends = ExtensionExtends> {
|
||||||
type = 'extension'
|
type = 'extension'
|
||||||
configs: any = {}
|
configs: any = {}
|
||||||
usedOptions: Partial<Options> = {}
|
usedOptions: Partial<Options> = {}
|
||||||
@@ -823,7 +823,7 @@ class ExtensionTest<Options, Extends extends ExtensionExtends> {
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
public commands(value: NodeExtends['commands']) {
|
public commands(value: Extends['commands']) {
|
||||||
this.storeConfig('commands', value, 'overwrite')
|
this.storeConfig('commands', value, 'overwrite')
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
@@ -884,9 +884,9 @@ const Suggestion = new NodeTest<TestOptions>()
|
|||||||
}))
|
}))
|
||||||
.create()
|
.create()
|
||||||
|
|
||||||
// const Blub = new ExtensionTest<TestOptions, ExtensionExtends>()
|
const Blub = new ExtensionTest<TestOptions>()
|
||||||
// .name('blub')
|
.name('bla')
|
||||||
// .create()
|
.create()
|
||||||
|
|
||||||
console.log(Suggestion(), Suggestion().topNode().options({ trigger: 'jo' }))
|
console.log(Suggestion(), Suggestion().topNode().options({ trigger: 'jo' }))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user