Skip to content

Commit 8be509d

Browse files
committed
added InstanceLinkPayload model to handle the instanceChanged events
1 parent 8650cb5 commit 8be509d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

client/src/app/model/models/instanceLink.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Instance } from './instance';
12

23
export interface InstanceLink {
34
idFrom: number;
@@ -15,3 +16,13 @@ export interface InstanceLink {
1516
Failed: 'Failed' as LinkStateEnum
1617
};
1718

19+
export interface InstanceLinkPayload {
20+
link: InstanceLink;
21+
instanceFrom: Instance;
22+
instanceTo: Instance;
23+
}
24+
25+
export function objIsLink(obj: any): obj is InstanceLink {
26+
return obj.idFrom !== undefined && typeof obj.idFrom === 'number' && obj.idTo !== undefined && typeof obj.idTo === 'number' &&
27+
obj.linkState !== undefined && obj.linkState in LinkStateEnum;
28+
}

0 commit comments

Comments
 (0)