sinotron
Version:
Simple framework for Typescript Electron projects
40 lines (39 loc) • 815 B
JavaScript
export {};
// export abstract class IpcAPI {
// constructor(readonly name: string) {}
//
// scoped(value: string) {
// return `${this.name}:${value}`;
// }
//
// abstract expose(): Promise<void>;
//
// abstract implement(): Promise<void>;
// }
//
// export type TApiRegistry = {
// [k: string]: IpcAPI;
// };
//
// export class ApiRegistry {
// private static readonly _registry: TApiRegistry = {};
//
// static register(api: IpcAPI) {
// const name = api.name;
// const registeredKeys = Object.keys(ApiRegistry._registry);
// if (registeredKeys.includes(name)) {
// throw new Error(`Api "${name}" already registered`);
// }
//
// ApiRegistry._registry[name] = api;
// }
// }
//
// class ApiExposer<T> {
//
// expose() {
//
// }
// }
//
// class ApiHandler<T> {}