forked from InteractiveAdvertisingBureau/iabtcf-es
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPing.ts
More file actions
50 lines (37 loc) · 1.04 KB
/
Ping.ts
File metadata and controls
50 lines (37 loc) · 1.04 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import {CmpStatus, DisplayStatus} from '../status/index.js';
import {CmpApiModel} from '../CmpApiModel.js';
import {Response} from './Response.js';
/**
* Ping response builder
*/
export class Ping extends Response {
/**
* true - CMP main script is loaded
* false - still running stub
*/
public cmpLoaded = true;
/**
* see Ping Status Codes in following table
*/
public cmpStatus: CmpStatus = CmpApiModel.cmpStatus;
/**
* see Ping Status Codes in following table
*/
public displayStatus: DisplayStatus = CmpApiModel.displayStatus;
/**
* version of the CMP API that is supported; e.g. “2”
*/
public apiVersion: string = String(CmpApiModel.apiVersion);
/**
* Version of the GVL currently loaded by the CMP
* undefined if still the stub
*/
public gvlVersion: number;
public constructor() {
super();
// only if the tcModel is defined
if (CmpApiModel.tcModel && CmpApiModel.tcModel.vendorListVersion) {
this.gvlVersion = +CmpApiModel.tcModel.vendorListVersion;
}
}
}