fix ts errors

This commit is contained in:
Philipp Kühn
2020-09-21 23:44:35 +02:00
parent 4da71ecfbb
commit 78ff453030
6 changed files with 19 additions and 20 deletions

View File

@@ -134,15 +134,16 @@ export class Editor extends EventEmitter {
tr,
}
const self = this
Object.defineProperty(props, 'commands', {
get: function() {
return Object.fromEntries(Object
.entries(this.commands)
.entries(self.commands)
.map(([name, command]) => {
return [name, (...args) => command(...args)(props)]
return [name, (...args: any[]) => command(...args)(props)]
}))
}.bind(this)
});
})
const callback = command(...args)(props)
@@ -154,7 +155,7 @@ export class Editor extends EventEmitter {
public chain() {
const { tr } = this.state
const callbacks = []
const callbacks: boolean[] = []
return new Proxy({}, {
get: (target, name: string, proxy) => {
@@ -179,12 +180,13 @@ export class Editor extends EventEmitter {
tr,
}
const self = this
Object.defineProperty(props, 'commands', {
get: function() {
return Object.fromEntries(Object
.entries(this.commands)
.entries(self.commands)
.map(([name, command]) => {
return [name, (...args) => command(...args)(props)]
return [name, (...args: any[]) => command(...args)(props)]
}))
}.bind(this)
});