}
initEdgeWebapis() {
- if (wrt['edge'] && !global.webapis.edge) {
- let edge = wrt.edge as NativeWRTjs.EdgeExtension;
+ if ((wrt as any)['edge'] && !global.webapis.edge) {
+ let edge = (wrt as any).edge as any;
global.webapis.edge = {
orchestrationGetDevicelist: (service_name: string, exec_type: string) => {
- return edge.orchestrationGetDevicelist(service_name, exec_type);
+ return edge?.orchestrationGetDevicelist(service_name, exec_type);
},
orchestrationReadCapability: (ip: string) => {
- return edge.orchestrationReadCapability(ip);
+ return edge?.orchestrationReadCapability(ip);
},
orchestrationRequestService: (app_name: string, self_select: boolean, exec_type: string, exec_parameter: string) => {
- return edge.orchestrationRequestService(app_name, self_select, exec_type, exec_parameter);
+ return edge?.orchestrationRequestService(app_name, self_select, exec_type, exec_parameter);
},
orchestrationRequestServiceOnDevice: (app_name: string, self_select: boolean, exec_type: string, exec_parameter: string, ip: string) => {
- return edge.orchestrationRequestServiceOnDevice(app_name, self_select, exec_type, exec_parameter, ip);
+ return edge?.orchestrationRequestServiceOnDevice(app_name, self_select, exec_type, exec_parameter, ip);
},
orchestrationWriteCapability: (json: string) => {
- return edge.orchestrationWriteCapability(json);
+ return edge?.orchestrationWriteCapability(json);
},
}
Object.defineProperty(global.webapis, 'edge', { writable: false, enumerable: true });