@screeb/sdk-browser 0.1.8 → 0.1.9
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/dist/es/index.d.ts +6 -1
- package/dist/es/index.js +12 -4
- package/docs/README.md +1 -1
- package/package.json +1 -1
package/dist/es/index.d.ts
CHANGED
|
@@ -14,7 +14,12 @@ export type ScreebOptions = {
|
|
|
14
14
|
type ScreebFunction = (..._: unknown[]) => void | Promise<unknown>;
|
|
15
15
|
/** This is the Screeb object publicly exposed in browser `window`. */
|
|
16
16
|
export type ScreebObject = ScreebFunction & {
|
|
17
|
-
q?:
|
|
17
|
+
q?: {
|
|
18
|
+
args: unknown[];
|
|
19
|
+
ko: (reason?: unknown) => void;
|
|
20
|
+
ok: (value?: unknown) => void;
|
|
21
|
+
v: number;
|
|
22
|
+
}[];
|
|
18
23
|
};
|
|
19
24
|
/** This is the object returned by the function `identityGet()`. */
|
|
20
25
|
export type ScreebIdentityGetReturn = {
|
package/dist/es/index.js
CHANGED
|
@@ -36,14 +36,22 @@ var load = function (options) {
|
|
|
36
36
|
scriptElement.addEventListener("error", reject);
|
|
37
37
|
_window.$screeb =
|
|
38
38
|
(_c = _window.$screeb) !== null && _c !== void 0 ? _c : function () {
|
|
39
|
-
var _a;
|
|
40
39
|
var args = [];
|
|
41
40
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
42
41
|
args[_i] = arguments[_i];
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
return new Promise(function (a, b) {
|
|
44
|
+
var _a;
|
|
45
|
+
if (_window.$screeb) {
|
|
46
|
+
return (_window.$screeb.q = (_a = _window.$screeb.q) !== null && _a !== void 0 ? _a : []).push({
|
|
47
|
+
args: args,
|
|
48
|
+
ko: b,
|
|
49
|
+
ok: a,
|
|
50
|
+
v: 1,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return 0;
|
|
54
|
+
});
|
|
47
55
|
};
|
|
48
56
|
_window.document.head.appendChild(scriptElement);
|
|
49
57
|
});
|
package/docs/README.md
CHANGED
|
@@ -75,7 +75,7 @@ ___
|
|
|
75
75
|
|
|
76
76
|
### ScreebObject
|
|
77
77
|
|
|
78
|
-
Ƭ **ScreebObject**: `ScreebFunction` & { `q?`: `unknown`[][] }
|
|
78
|
+
Ƭ **ScreebObject**: `ScreebFunction` & { `q?`: { `args`: `unknown`[] ; `ko`: (`reason?`: `unknown`) => `void` ; `ok`: (`value?`: `unknown`) => `void` ; `v`: `number` }[] }
|
|
79
79
|
|
|
80
80
|
This is the Screeb object publicly exposed in browser `window`.
|
|
81
81
|
|