import {ProxiedClass} from "./Definitions"; import {ObjectProxyClient} from "./Client"; import {ObjectProxyServer} from "./Server"; interface TextModal { readonly events: { onHide: () => void; } sayHi() : Promise; } class TextModalImpl extends ProxiedClass implements TextModal { constructor(props) { super(props); } async sayHi(): Promise { this.events.onHide(); } } async function main() { let server = new ObjectProxyServer("", TextModalImpl); let client = new ObjectProxyClient(""); const instance = await client.createNewInstance(); await instance.sayHi(); instance.events.onHide = () => {}; }