New ziffers player

This commit is contained in:
2023-08-22 22:27:26 +03:00
parent 566d6ce79b
commit a844e0443d
8 changed files with 180 additions and 60 deletions

33
src/Rest.ts Normal file
View File

@ -0,0 +1,33 @@
import { type Editor } from './main';
import { Event } from "./Event";
export class Rest extends Event {
constructor(duration: number, app: Editor) {
super(app);
this.values["duration"] = duration;
}
_fallbackMethod = (): Event => {
return this;
}
public static createRestProxy = (duration: number, app: Editor) => {
const instance = new Rest(duration, app);
return new Proxy(instance, {
// @ts-ignore
get(target, propKey, receiver) {
// @ts-ignore
if (typeof target[propKey] === 'undefined') {
return target._fallbackMethod;
}
// @ts-ignore
return target[propKey];
},
});
}
out = (): void => {
// TODO?
}
}