@digo-org/digo-api 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/digo-asset.ts +14 -0
- package/src/types.ts +12 -1
package/package.json
CHANGED
package/src/digo-asset.ts
CHANGED
@@ -2,6 +2,8 @@ import { ReactNode } from 'react';
|
|
2
2
|
import { SingleParameterValue } from 'src/types';
|
3
3
|
|
4
4
|
export abstract class DigoAsset {
|
5
|
+
protected rootElement: any = null;
|
6
|
+
|
5
7
|
constructor() {
|
6
8
|
this.handleMessage = this.handleMessage.bind(this);
|
7
9
|
|
@@ -12,6 +14,18 @@ export abstract class DigoAsset {
|
|
12
14
|
window.removeEventListener('message', this.handleMessage);
|
13
15
|
}
|
14
16
|
|
17
|
+
public setRootElement(element: any): void {
|
18
|
+
this.rootElement = element;
|
19
|
+
}
|
20
|
+
|
21
|
+
public updateUI(): void {
|
22
|
+
if (this.rootElement) {
|
23
|
+
this.rootElement.render(
|
24
|
+
this.render(),
|
25
|
+
);
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
15
29
|
private handleMessage(event: MessageEvent): void {
|
16
30
|
const message = event.data;
|
17
31
|
|
package/src/types.ts
CHANGED
@@ -4,7 +4,7 @@ export interface VizAsset {
|
|
4
4
|
description: string;
|
5
5
|
tags: string[];
|
6
6
|
definition: VizAssetDefinition;
|
7
|
-
|
7
|
+
files: VizAssetFiles;
|
8
8
|
last_updated: string;
|
9
9
|
}
|
10
10
|
|
@@ -13,6 +13,17 @@ export interface VizAssetDefinition {
|
|
13
13
|
instances: Instance[];
|
14
14
|
}
|
15
15
|
|
16
|
+
export type VizAssetParameters = VizParameterProperties[];
|
17
|
+
|
18
|
+
export interface VizAssetFile {
|
19
|
+
code: string;
|
20
|
+
hidden?: boolean;
|
21
|
+
active?: boolean;
|
22
|
+
readOnly?: boolean;
|
23
|
+
}
|
24
|
+
|
25
|
+
export type VizAssetFiles = Record<string, VizAssetFile>;
|
26
|
+
|
16
27
|
export interface Instance {
|
17
28
|
id: string;
|
18
29
|
[parameterId: string]: SingleParameterValue;
|