Restructured library.

This commit is contained in:
2019-03-22 12:54:57 +01:00
parent 1bc2deb4d3
commit d1efeeffa6
1912 changed files with 21424 additions and 21383 deletions
+30
View File
@@ -0,0 +1,30 @@
// In order to test this interface implementation run jsc interface.js
export default class Interface {
// Abstract interface that should be extended in interface subclasses.
// By convention all interfaces should start with an upper 'I'
static implementationError(klass) {
let interfaceKeys = Reflect.ownKeys(this.prototype)
let classKeys = Reflect.ownKeys(klass.prototype)
for(let key of interfaceKeys) {
let interfaceDesc = this.prototype[key]
let classDesc = klass.prototype[key]
if (typeof(classDesc) == 'undefined')
return 'Missing ' + key
}
return null
}
static implementedBy(klass) {
// In the first step only checks whether the methods of this
// interface are all implemented by the given class
let error = this.implementationError(klass)
return error == null
}
// TODO: Specify optional methods
// static optionalMethods() {
// return [this.onMouseWheel]
// }
}