@aippy/runtime 0.2.7-dev.5 → 0.2.7-dev.7
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/ai/config/index.d.ts +1 -1
- package/dist/ai/config/parser.d.ts +5 -12
- package/dist/ai/errors.d.ts +1 -0
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.js +15 -16
- package/dist/ai/shared/fetch.d.ts +0 -4
- package/dist/ai/shared/index.d.ts +1 -1
- package/dist/app-version-checker-B1UXEcy9.js +240 -0
- package/dist/bridge-BQQ3PfSO.js +237 -0
- package/dist/config-B0A7gHQM.js +28 -0
- package/dist/container-message-YB3cWpWj.js +56 -0
- package/dist/core/errors.d.ts +22 -3
- package/dist/core/headers.d.ts +31 -0
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +22 -50
- package/dist/device/index.js +194 -194
- package/dist/errors-B3bDbQbD.js +40 -0
- package/dist/helper-BjRhidue.js +238 -0
- package/dist/hooks-C7VP176R.js +98 -0
- package/dist/index/index.js +89 -80
- package/dist/pwa-C5nXU0DN.js +250 -0
- package/dist/tweaks/index.js +1 -1
- package/dist/url-c26cuIpu.js +7 -0
- package/dist/{useTweaks-QxMRmg7i.js → useTweaks-B7Muzo78.js} +10 -9
- package/dist/user/hooks.d.ts +6 -2
- package/dist/user/index.d.ts +1 -0
- package/dist/user/index.js +3 -3
- package/dist/utils/app-version-checker.d.ts +62 -0
- package/dist/utils/app-version-requirements.json.d.ts +13 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +17 -11
- package/dist/utils/ui.d.ts +3 -1
- package/dist/utils/url.d.ts +7 -0
- package/package.json +1 -1
- package/dist/bridge-Ca3H2iN1.js +0 -197
- package/dist/container-message-DGrno17o.js +0 -31
- package/dist/errors-CDEBaBxB.js +0 -26
- package/dist/helper-BENVYOU-.js +0 -247
- package/dist/hooks-CE9cjXHP.js +0 -46
- package/dist/pwa-CilSlaik.js +0 -249
- package/dist/ui-y5N62DqC.js +0 -175
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { c as n, a as i } from "./errors-B3bDbQbD.js";
|
|
2
|
+
class d {
|
|
3
|
+
/**
|
|
4
|
+
* Get Core Web Vitals metrics
|
|
5
|
+
*/
|
|
6
|
+
async getCoreWebVitals() {
|
|
7
|
+
const e = {};
|
|
8
|
+
try {
|
|
9
|
+
const t = performance.getEntriesByName("first-contentful-paint")[0];
|
|
10
|
+
t && (e.fcp = t.startTime);
|
|
11
|
+
const r = performance.getEntriesByType("largest-contentful-paint");
|
|
12
|
+
if (r.length > 0) {
|
|
13
|
+
const o = r[r.length - 1];
|
|
14
|
+
e.lcp = o.startTime;
|
|
15
|
+
}
|
|
16
|
+
const a = performance.getEntriesByType("first-input");
|
|
17
|
+
if (a.length > 0) {
|
|
18
|
+
const o = a[0];
|
|
19
|
+
e.fid = o.processingStart - o.startTime;
|
|
20
|
+
}
|
|
21
|
+
const s = performance.getEntriesByType("layout-shift");
|
|
22
|
+
if (s.length > 0) {
|
|
23
|
+
let o = 0;
|
|
24
|
+
for (const p of s) {
|
|
25
|
+
const l = p;
|
|
26
|
+
l.hadRecentInput || (o += l.value);
|
|
27
|
+
}
|
|
28
|
+
e.cls = o;
|
|
29
|
+
}
|
|
30
|
+
const c = this.calculateTTI();
|
|
31
|
+
c && (e.tti = c);
|
|
32
|
+
} catch (t) {
|
|
33
|
+
console.warn("Failed to get Core Web Vitals:", t);
|
|
34
|
+
}
|
|
35
|
+
return e;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get navigation timing metrics
|
|
39
|
+
*/
|
|
40
|
+
getNavigationTiming() {
|
|
41
|
+
const e = performance.getEntriesByType("navigation")[0];
|
|
42
|
+
return e ? {
|
|
43
|
+
// DNS lookup time
|
|
44
|
+
dns: e.domainLookupEnd - e.domainLookupStart,
|
|
45
|
+
// TCP connection time
|
|
46
|
+
tcp: e.connectEnd - e.connectStart,
|
|
47
|
+
// Request time
|
|
48
|
+
request: e.responseStart - e.requestStart,
|
|
49
|
+
// Response time
|
|
50
|
+
response: e.responseEnd - e.responseStart,
|
|
51
|
+
// DOM processing time
|
|
52
|
+
domProcessing: e.domComplete - e.domInteractive,
|
|
53
|
+
// Total page load time
|
|
54
|
+
total: e.loadEventEnd - e.fetchStart
|
|
55
|
+
} : null;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get resource timing metrics
|
|
59
|
+
*/
|
|
60
|
+
getResourceTiming() {
|
|
61
|
+
return performance.getEntriesByType("resource").map((t) => ({
|
|
62
|
+
name: t.name,
|
|
63
|
+
duration: t.duration,
|
|
64
|
+
size: t.transferSize,
|
|
65
|
+
type: this.getResourceType(t.name)
|
|
66
|
+
}));
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Measure function execution time
|
|
70
|
+
*/
|
|
71
|
+
measureFunction(e, t) {
|
|
72
|
+
const r = e();
|
|
73
|
+
return t && (performance.mark(`${t}-start`), performance.mark(`${t}-end`), performance.measure(t, `${t}-start`, `${t}-end`)), r;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Measure async function execution time
|
|
77
|
+
*/
|
|
78
|
+
async measureAsyncFunction(e, t) {
|
|
79
|
+
const r = await e();
|
|
80
|
+
return t && (performance.mark(`${t}-start`), performance.mark(`${t}-end`), performance.measure(t, `${t}-start`, `${t}-end`)), r;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get memory usage (if available)
|
|
84
|
+
*/
|
|
85
|
+
getMemoryUsage() {
|
|
86
|
+
if ("memory" in performance) {
|
|
87
|
+
const e = performance.memory;
|
|
88
|
+
return {
|
|
89
|
+
used: e.usedJSHeapSize,
|
|
90
|
+
total: e.totalJSHeapSize,
|
|
91
|
+
limit: e.jsHeapSizeLimit
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
calculateTTI() {
|
|
97
|
+
const e = performance.getEntriesByType("navigation")[0];
|
|
98
|
+
return e ? e.domContentLoadedEventEnd - e.fetchStart : null;
|
|
99
|
+
}
|
|
100
|
+
getResourceType(e) {
|
|
101
|
+
return e.includes(".js") ? "script" : e.includes(".css") ? "stylesheet" : e.includes(".png") || e.includes(".jpg") || e.includes(".gif") ? "image" : e.includes(".woff") || e.includes(".ttf") ? "font" : "other";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const m = new d();
|
|
105
|
+
class u {
|
|
106
|
+
/**
|
|
107
|
+
* Get PWA information
|
|
108
|
+
*/
|
|
109
|
+
getPWAInfo() {
|
|
110
|
+
return {
|
|
111
|
+
isInstalled: this.isInstalled(),
|
|
112
|
+
isInstallable: this.isInstallable(),
|
|
113
|
+
canInstall: this.canInstall(),
|
|
114
|
+
isStandalone: this.isStandalone()
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Check if PWA is installed
|
|
119
|
+
*/
|
|
120
|
+
isInstalled() {
|
|
121
|
+
return this.isStandalone() || this.isInApp();
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Check if PWA is installable
|
|
125
|
+
*/
|
|
126
|
+
isInstallable() {
|
|
127
|
+
return "serviceWorker" in navigator && "PushManager" in window;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Check if install prompt is available
|
|
131
|
+
*/
|
|
132
|
+
canInstall() {
|
|
133
|
+
return this.isInstallable() && !this.isInstalled();
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Check if running in standalone mode
|
|
137
|
+
*/
|
|
138
|
+
isStandalone() {
|
|
139
|
+
return window.matchMedia("(display-mode: standalone)").matches || window.navigator.standalone === !0;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Check if running in app (iOS)
|
|
143
|
+
*/
|
|
144
|
+
isInApp() {
|
|
145
|
+
return window.navigator.standalone === !0;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Register service worker
|
|
149
|
+
*/
|
|
150
|
+
async registerServiceWorker(e) {
|
|
151
|
+
if (!("serviceWorker" in navigator))
|
|
152
|
+
return console.warn("Service Worker not supported"), null;
|
|
153
|
+
try {
|
|
154
|
+
return await navigator.serviceWorker.register(e);
|
|
155
|
+
} catch (t) {
|
|
156
|
+
return console.error("Service Worker registration failed:", t), null;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Unregister service worker
|
|
161
|
+
*/
|
|
162
|
+
async unregisterServiceWorker() {
|
|
163
|
+
if (!("serviceWorker" in navigator))
|
|
164
|
+
return !1;
|
|
165
|
+
try {
|
|
166
|
+
const e = await navigator.serviceWorker.getRegistrations();
|
|
167
|
+
for (const t of e)
|
|
168
|
+
await t.unregister();
|
|
169
|
+
return !0;
|
|
170
|
+
} catch (e) {
|
|
171
|
+
return console.error("Service Worker unregistration failed:", e), !1;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Request notification permission
|
|
176
|
+
*/
|
|
177
|
+
async requestNotificationPermission() {
|
|
178
|
+
if (!("Notification" in window))
|
|
179
|
+
throw n("Notifications not supported", i.NOT_SUPPORTED);
|
|
180
|
+
return Notification.permission === "granted" ? "granted" : Notification.permission === "denied" ? "denied" : await Notification.requestPermission();
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Send notification
|
|
184
|
+
*/
|
|
185
|
+
async sendNotification(e, t) {
|
|
186
|
+
if (!("Notification" in window))
|
|
187
|
+
throw n("Notifications not supported", i.NOT_SUPPORTED);
|
|
188
|
+
if (Notification.permission !== "granted")
|
|
189
|
+
throw n("Notification permission not granted", i.PERMISSION_DENIED);
|
|
190
|
+
const r = new Notification(e, t);
|
|
191
|
+
setTimeout(() => {
|
|
192
|
+
r.close();
|
|
193
|
+
}, 5e3);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Share content using Web Share API
|
|
197
|
+
*/
|
|
198
|
+
async share(e) {
|
|
199
|
+
if (!("share" in navigator))
|
|
200
|
+
throw n("Web Share API not supported", i.NOT_SUPPORTED);
|
|
201
|
+
try {
|
|
202
|
+
await navigator.share(e);
|
|
203
|
+
} catch (t) {
|
|
204
|
+
if (t instanceof Error && t.name !== "AbortError")
|
|
205
|
+
throw n(`Share failed: ${t.message}`, i.OPERATION_FAILED);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Copy text to clipboard
|
|
210
|
+
*/
|
|
211
|
+
async copyToClipboard(e) {
|
|
212
|
+
if (!("clipboard" in navigator))
|
|
213
|
+
throw n("Clipboard API not supported", i.NOT_SUPPORTED);
|
|
214
|
+
try {
|
|
215
|
+
await navigator.clipboard.writeText(e);
|
|
216
|
+
} catch (t) {
|
|
217
|
+
throw n(`Copy to clipboard failed: ${t instanceof Error ? t.message : "Unknown error"}`, i.OPERATION_FAILED);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Read text from clipboard
|
|
222
|
+
*/
|
|
223
|
+
async readFromClipboard() {
|
|
224
|
+
if (!("clipboard" in navigator))
|
|
225
|
+
throw n("Clipboard API not supported", i.NOT_SUPPORTED);
|
|
226
|
+
try {
|
|
227
|
+
return await navigator.clipboard.readText();
|
|
228
|
+
} catch (e) {
|
|
229
|
+
throw n(`Read from clipboard failed: ${e instanceof Error ? e.message : "Unknown error"}`, i.OPERATION_FAILED);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Get install prompt event
|
|
234
|
+
*/
|
|
235
|
+
getInstallPromptEvent() {
|
|
236
|
+
return new Promise((e) => {
|
|
237
|
+
const t = (r) => {
|
|
238
|
+
r.preventDefault(), e(r), window.removeEventListener("beforeinstallprompt", t);
|
|
239
|
+
};
|
|
240
|
+
window.addEventListener("beforeinstallprompt", t);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const y = new u();
|
|
245
|
+
export {
|
|
246
|
+
d as P,
|
|
247
|
+
u as a,
|
|
248
|
+
y as b,
|
|
249
|
+
m as p
|
|
250
|
+
};
|
package/dist/tweaks/index.js
CHANGED
|
@@ -2,7 +2,8 @@ var b = Object.defineProperty;
|
|
|
2
2
|
var g = (n, e, t) => e in n ? b(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
3
|
var r = (n, e, t) => g(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
4
|
import { useReducer as v, useEffect as m } from "react";
|
|
5
|
-
|
|
5
|
+
import { b as T, a as C } from "./errors-B3bDbQbD.js";
|
|
6
|
+
class I {
|
|
6
7
|
constructor(e) {
|
|
7
8
|
r(this, "cancelled", !1);
|
|
8
9
|
this.cancelFn = e;
|
|
@@ -22,13 +23,13 @@ class k {
|
|
|
22
23
|
this.listeners.forEach((t) => t(e));
|
|
23
24
|
}
|
|
24
25
|
subscribe(e) {
|
|
25
|
-
return this.listeners.push(e), new
|
|
26
|
+
return this.listeners.push(e), new I(() => {
|
|
26
27
|
const t = this.listeners.indexOf(e);
|
|
27
28
|
t > -1 && this.listeners.splice(t, 1);
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
class
|
|
32
|
+
class O {
|
|
32
33
|
constructor(e, t) {
|
|
33
34
|
r(this, "values", {});
|
|
34
35
|
r(this, "subject", new k());
|
|
@@ -51,7 +52,7 @@ class C {
|
|
|
51
52
|
getValue(e) {
|
|
52
53
|
const t = this.values[e];
|
|
53
54
|
if (t === void 0)
|
|
54
|
-
throw
|
|
55
|
+
throw T(`Tweak key not found in values: ${e}`, C.INVALID_CONFIG);
|
|
55
56
|
return t;
|
|
56
57
|
}
|
|
57
58
|
// React Hook integration
|
|
@@ -67,7 +68,7 @@ class C {
|
|
|
67
68
|
}, [e]), t;
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
class
|
|
71
|
+
class R {
|
|
71
72
|
constructor() {
|
|
72
73
|
r(this, "tweaksInstance", null);
|
|
73
74
|
r(this, "tweaksDidWarn", !1);
|
|
@@ -80,7 +81,7 @@ class I {
|
|
|
80
81
|
if (this.tweaksInstance)
|
|
81
82
|
return this.tweaksDidWarn || (this.tweaksDidWarn = !0, console.warn("⚠️ [Aippy Tweaks] tweaks() is expected to only be called once, returning previous value")), this.tweaksInstance;
|
|
82
83
|
this.originalConfig = { ...e };
|
|
83
|
-
const t = new k(), i = new
|
|
84
|
+
const t = new k(), i = new O(t, e), a = {};
|
|
84
85
|
for (const s of Object.keys(e))
|
|
85
86
|
a[s] = {
|
|
86
87
|
useState: () => i.useState(s)
|
|
@@ -172,11 +173,11 @@ class I {
|
|
|
172
173
|
}
|
|
173
174
|
}
|
|
174
175
|
}
|
|
175
|
-
const w = new
|
|
176
|
+
const w = new R(), y = {
|
|
176
177
|
tweaks: (n) => w.tweaks(n)
|
|
177
|
-
},
|
|
178
|
+
}, S = y.tweaks;
|
|
178
179
|
typeof window < "u" && (window.aippyTweaksRuntime = y, window.processNativeData = w.processNativeData.bind(w));
|
|
179
180
|
export {
|
|
180
|
-
|
|
181
|
+
S as a,
|
|
181
182
|
y as b
|
|
182
183
|
};
|
package/dist/user/hooks.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* User SDK Hooks
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
export declare function useUserInfo(): {
|
|
4
|
+
export interface UserInfo {
|
|
6
5
|
avatar: string;
|
|
7
6
|
nickName: string;
|
|
8
7
|
username: string;
|
|
9
8
|
uid: string;
|
|
9
|
+
}
|
|
10
|
+
/** Hook to get user info (avatar, nickName, username, uid) with loading state */
|
|
11
|
+
export declare function useUserInfo(): UserInfo & {
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
refetch: () => Promise<void>;
|
|
10
14
|
};
|
|
11
15
|
/** Clear cached user info */
|
|
12
16
|
export declare function clearUserInfoCache(): void;
|
package/dist/user/index.d.ts
CHANGED
package/dist/user/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as o, u as s } from "../hooks-
|
|
2
|
-
import { getAuthTokenAsync as f } from "../bridge-
|
|
3
|
-
import { i as t } from "../
|
|
1
|
+
import { c as o, u as s } from "../hooks-C7VP176R.js";
|
|
2
|
+
import { getAuthTokenAsync as f } from "../bridge-BQQ3PfSO.js";
|
|
3
|
+
import { i as t } from "../app-version-checker-B1UXEcy9.js";
|
|
4
4
|
export {
|
|
5
5
|
o as clearUserInfoCache,
|
|
6
6
|
f as getAuthTokenAsync,
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { AppVersionConfig, AppEnvironmentCheckResult } from './platform';
|
|
2
|
+
import { default as versionRequirements } from './app-version-requirements.json';
|
|
3
|
+
/**
|
|
4
|
+
* Feature support check result
|
|
5
|
+
*/
|
|
6
|
+
export interface FeatureSupportResult {
|
|
7
|
+
/** Whether the feature is supported in current environment */
|
|
8
|
+
supported: boolean;
|
|
9
|
+
/** Environment check result from platform detector */
|
|
10
|
+
envCheck: AppEnvironmentCheckResult;
|
|
11
|
+
/** Current app version (if in app) */
|
|
12
|
+
currentVersion?: string;
|
|
13
|
+
/** Minimum required version for this feature */
|
|
14
|
+
requiredVersion?: string;
|
|
15
|
+
/** Error message if not supported */
|
|
16
|
+
message?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Available feature names for version checking
|
|
20
|
+
*/
|
|
21
|
+
export type FeatureName = keyof typeof versionRequirements;
|
|
22
|
+
/**
|
|
23
|
+
* Get version requirements for a feature
|
|
24
|
+
*/
|
|
25
|
+
export declare function getFeatureVersionRequirements(featureName: FeatureName): AppVersionConfig;
|
|
26
|
+
/**
|
|
27
|
+
* Check if app version supports a specific feature
|
|
28
|
+
*
|
|
29
|
+
* @param featureName - The feature to check (e.g., 'userCredentials', 'userInfo')
|
|
30
|
+
* @returns FeatureSupportResult with support status and details
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const result = checkFeatureSupport('userCredentials');
|
|
35
|
+
* if (!result.supported) {
|
|
36
|
+
* console.log('Feature not supported:', result.message);
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function checkFeatureSupport(featureName: FeatureName): FeatureSupportResult;
|
|
41
|
+
/**
|
|
42
|
+
* Check feature support and handle old version automatically
|
|
43
|
+
*
|
|
44
|
+
* This is a convenience function that:
|
|
45
|
+
* 1. Checks if the feature is supported
|
|
46
|
+
* 2. If not supported due to old app version, shows an alert and throws an error
|
|
47
|
+
*
|
|
48
|
+
* @param featureName - The feature to check
|
|
49
|
+
* @returns FeatureSupportResult (only returns if supported or web/iframe environment)
|
|
50
|
+
* @throws Error if app version is too old
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const result = requireFeatureSupport('userCredentials');
|
|
55
|
+
* // Code here only runs if feature is supported
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function requireFeatureSupport(featureName: FeatureName): FeatureSupportResult;
|
|
59
|
+
/**
|
|
60
|
+
* Get all available feature names
|
|
61
|
+
*/
|
|
62
|
+
export declare function getAvailableFeatures(): FeatureName[];
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import { P as
|
|
2
|
-
import { a as
|
|
1
|
+
import { P as a, a as s, c as o, b as t, g as p, i, p as m, r as n, s as f } from "../app-version-checker-B1UXEcy9.js";
|
|
2
|
+
import { a as c, P as l, p as P, b as F } from "../pwa-C5nXU0DN.js";
|
|
3
|
+
import { j as g } from "../url-c26cuIpu.js";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
s as
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
c as PWAUtils,
|
|
6
|
+
l as PerformanceMonitor,
|
|
7
|
+
a as PlatformDetector,
|
|
8
|
+
s as checkFeatureSupport,
|
|
9
|
+
o as compareVersions,
|
|
10
|
+
t as getAvailableFeatures,
|
|
11
|
+
p as getFeatureVersionRequirements,
|
|
12
|
+
i as isInIframe,
|
|
13
|
+
g as joinUrl,
|
|
14
|
+
P as performanceMonitor,
|
|
15
|
+
m as platform,
|
|
16
|
+
F as pwa,
|
|
17
|
+
n as requireFeatureSupport,
|
|
18
|
+
f as showAlert
|
|
13
19
|
};
|
package/dist/utils/ui.d.ts
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* UI Utilities
|
|
3
3
|
* Common UI components for SDK modules
|
|
4
4
|
*/
|
|
5
|
+
export type AlertType = 'update' | 'signin';
|
|
5
6
|
/**
|
|
6
7
|
* 自定义弹窗
|
|
7
8
|
* 用于在各 SDK 模块中显示提示信息
|
|
8
9
|
*
|
|
9
10
|
* @param message - 要显示的消息
|
|
11
|
+
* @param type - 弹窗类型:'update' 发送消息给原生 App,'signin' 发送消息给父窗口
|
|
10
12
|
*/
|
|
11
|
-
export declare function showAlert(message: string): void
|
|
13
|
+
export declare function showAlert(message: string, type?: AlertType): Promise<void>;
|