-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhost-api-stub.ts
More file actions
34 lines (28 loc) · 962 Bytes
/
host-api-stub.ts
File metadata and controls
34 lines (28 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { IEntity, IRemoteComponentCardApi } from '@directum/sungero-remote-component-types';
/** Заглушка API для отладки в режиме standalone. */
class HostStubApi implements IRemoteComponentCardApi {
public executeAction(actionName: string): Promise<void> {
console.log(`Action ${actionName} executed.`)
return Promise.resolve();
}
public canExecuteAction(actionName: string): boolean {
return true;
}
public getEntity<T extends IEntity>(): T {
return {
Id: 1,
Status: { Value: 'Active', DisplayValue: 'Действующая' },
IP: '',
Port: '',
Login: '',
Password:'',
NameToCall: 'Иванов Иван Иванович',
NumberPhone: "8**********",
StartTime: null,
PathToRingtones: ""
} as unknown as T;
}
public onControlUpdate?: (() => void);
}
const api: IRemoteComponentCardApi = new HostStubApi();
export default api;