Dinh Long Nguyen 8 місяців тому
батько
коміт
cdbe08740f

+ 5 - 5
frontend/taipy-gui/base/src/exports.ts

@@ -1,7 +1,7 @@
+import { TaipyApp, createApp, OnChangeHandler, OnInitHandler } from "./app";
 import { WsAdapter } from "./wsAdapter";
 import { WsAdapter } from "./wsAdapter";
-// import { TaipyApp } from "./app";
+import { ModuleData } from "./dataManager";
 
 
-export {
-    WsAdapter,
-    // TaipyApp,
-};
+export default TaipyApp;
+export { TaipyApp, createApp, WsAdapter };
+export type { OnChangeHandler, OnInitHandler, ModuleData };

+ 12 - 4
frontend/taipy-gui/base/src/packaging/taipy-gui-base.d.ts

@@ -85,6 +85,10 @@ export interface WsMessage {
     module_context: string;
     module_context: string;
     ack_id?: string;
     ack_id?: string;
 }
 }
+export declare abstract class WsAdapter {
+    abstract supportedMessageTypes: string[];
+    abstract handleWsMessage(message: WsMessage, app: TaipyApp): boolean;
+}
 export type OnInitHandler = (taipyApp: TaipyApp) => void;
 export type OnInitHandler = (taipyApp: TaipyApp) => void;
 export type OnChangeHandler = (taipyApp: TaipyApp, encodedName: string, value: unknown, dataEventKey?: string) => void;
 export type OnChangeHandler = (taipyApp: TaipyApp, encodedName: string, value: unknown, dataEventKey?: string) => void;
 export type OnNotifyHandler = (taipyApp: TaipyApp, type: string, message: string) => void;
 export type OnNotifyHandler = (taipyApp: TaipyApp, type: string, message: string) => void;
@@ -163,7 +167,11 @@ export declare class TaipyApp {
     getWsStatus(): string[];
     getWsStatus(): string[];
     getBaseUrl(): string;
     getBaseUrl(): string;
 }
 }
-export declare abstract class WsAdapter {
-    abstract supportedMessageTypes: string[];
-    abstract handleWsMessage(message: WsMessage, app: TaipyApp): boolean;
-}
+export declare const createApp: (
+    onInit?: OnInitHandler,
+    onChange?: OnChangeHandler,
+    path?: string,
+    socket?: Socket,
+) => TaipyApp;
+
+export { TaipyApp as default };