diff --git a/src/client/packages/@reactpy/client/package.json b/src/client/packages/@reactpy/client/package.json index 51b59fed1..ab4bd34ad 100644 --- a/src/client/packages/@reactpy/client/package.json +++ b/src/client/packages/@reactpy/client/package.json @@ -6,7 +6,7 @@ "license": "MIT", "name": "@reactpy/client", "type": "module", - "version": "0.3.0", + "version": "0.3.1", "dependencies": { "event-to-object": "^0.1.2", "json-pointer": "^0.6.2" diff --git a/src/client/packages/@reactpy/client/src/reactpy-client.ts b/src/client/packages/@reactpy/client/src/reactpy-client.ts index 5b9ad89b1..6f37b55a1 100644 --- a/src/client/packages/@reactpy/client/src/reactpy-client.ts +++ b/src/client/packages/@reactpy/client/src/reactpy-client.ts @@ -21,17 +21,17 @@ export interface ReactPyClient { * * @param message The message to send. Messages must have a `type` property. */ - sendMessage: (message: any) => void; + sendMessage(message: any): void; /** * Load a module from the server. * @param moduleName The name of the module to load. * @returns A promise that resolves to the module. */ - loadModule: (moduleName: string) => Promise; + loadModule(moduleName: string): Promise; } -export class BaseReactPyClient implements Partial { +export abstract class BaseReactPyClient implements ReactPyClient { private readonly handlers: { [key: string]: ((message: any) => void)[] } = {}; protected readonly ready: Promise; private resolveReady: (value: undefined) => void; @@ -49,6 +49,9 @@ export class BaseReactPyClient implements Partial { }; } + abstract sendMessage(message: any): void; + abstract loadModule(moduleName: string): Promise; + /** * Handle an incoming message. * diff --git a/src/client/tsconfig.package.json b/src/client/tsconfig.package.json index 02840dc95..9e7fe5f74 100644 --- a/src/client/tsconfig.package.json +++ b/src/client/tsconfig.package.json @@ -4,15 +4,18 @@ "allowSyntheticDefaultImports": true, "declaration": true, "declarationMap": true, - "esModuleInterop": false, + "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "isolatedModules": true, "jsx": "react", "lib": ["DOM", "DOM.Iterable", "esnext"], "module": "esnext", "moduleResolution": "node", + "noEmitOnError": true, + "noUnusedLocals": true, "resolveJsonModule": true, "skipLibCheck": false, + "sourceMap": true, "strict": true, "target": "esnext" }