-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
59 lines (52 loc) · 1.37 KB
/
index.d.ts
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
51
52
53
54
55
56
57
58
59
// index.d.ts
/**
* Options for the `scan` method of XRAY class.
*/
export interface ScanOptions {
/**
* The API URL to be used in the scan process.
*/
apiUrl: string;
}
/**
* Result from the `scan` method of XRAY class.
*/
export interface ScanResult {
/**
* The encrypted payload, encoded in base64.
*/
encryptedB64Payload: string;
}
/**
* Class representing the XRAY functionality.
* This class handles the loading and instantiation of the XRAY object.
*/
export class XRAY {
/**
* The source URL for the iframe, if provided.
* @private
*/
private iframeSrc?: string;
/**
* Constructor for the XRAY class.
* @param iframeSrc - Optional source URL for the iframe.
*/
constructor(iframeSrc?: string);
/**
* Loads the necessary components for the XRAY functionality.
* This method dynamically loads and decodes a base64-encoded string
* representing the library, and initializes an instance of XRAY.
* @returns A promise that resolves when the loading is complete.
*/
load(): Promise<void>;
/**
* Instance of XRAY, created after `load` method is called.
*/
xray?: XRAY;
/**
* Scans and processes data based on provided options.
* @param options - The options for the scan, including API URL.
* @returns A promise that resolves to the scan result.
*/
scan(options: ScanOptions): Promise<ScanResult>;
}