@aippy/runtime 0.2.3 → 0.2.4-dev.3
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/audio/index.d.ts +2 -1
- package/dist/audio/index.js +1 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +24 -20
- package/dist/core/runtime.d.ts +71 -0
- package/dist/device/index.js +316 -183
- package/dist/device/sensors.d.ts +39 -3
- package/dist/device/types.d.ts +38 -0
- package/dist/index/index.js +50 -40
- package/dist/runtime-DOnodF_1.js +165 -0
- package/dist/{useAudioContext-BKgy28A1.js → useAudioContext-CNQQSTab.js} +2 -2
- package/package.json +25 -26
- package/dist/errors-CDEBaBxB.js +0 -26
package/dist/audio/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
export { patchAudioContext } from './patchAudioContext';
|
|
10
10
|
export type { AudioContextPatchOptions, AutoPauseOptions, MediaElementType, PatchedAudioContext, } from './types';
|
|
11
|
-
export { createHiddenMediaElement, createHiddenVideoElement,
|
|
11
|
+
export { createHiddenMediaElement, createHiddenVideoElement, isMediaStreamAudioSupported, } from './utils';
|
|
12
12
|
export { useAudioContext } from './useAudioContext';
|
|
13
13
|
export type { UseAudioContextOptions, UseAudioContextReturn } from './useAudioContext';
|
|
14
|
+
export { isIOSDevice } from './utils';
|
package/dist/audio/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as i, a as t,
|
|
1
|
+
import { c as i, a as t, b as d, i as o, p as s, u as n } from "../useAudioContext-CNQQSTab.js";
|
|
2
2
|
export {
|
|
3
3
|
i as createHiddenMediaElement,
|
|
4
4
|
t as createHiddenVideoElement,
|
package/dist/core/index.d.ts
CHANGED
package/dist/core/index.js
CHANGED
|
@@ -1,45 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const
|
|
1
|
+
import { a as d, A as f, C as u, E as A, R as _, b as m, c as R } from "../runtime-DOnodF_1.js";
|
|
2
|
+
const s = {
|
|
3
3
|
mode: "development",
|
|
4
4
|
debug: !1,
|
|
5
5
|
apiBaseUrl: void 0,
|
|
6
6
|
headers: {}
|
|
7
7
|
};
|
|
8
|
-
function
|
|
8
|
+
function o() {
|
|
9
9
|
const e = {};
|
|
10
10
|
return typeof process < "u" && process.env && (process.env.NODE_ENV && (e.mode = process.env.NODE_ENV), process.env.AIPPY_DEBUG && (e.debug = process.env.AIPPY_DEBUG === "true"), process.env.AIPPY_API_BASE_URL && (e.apiBaseUrl = process.env.AIPPY_API_BASE_URL)), e;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
const n =
|
|
12
|
+
function c(e) {
|
|
13
|
+
const n = o();
|
|
14
14
|
return {
|
|
15
|
-
...
|
|
15
|
+
...s,
|
|
16
16
|
...n,
|
|
17
17
|
...e,
|
|
18
18
|
headers: {
|
|
19
|
-
...
|
|
19
|
+
...s.headers,
|
|
20
20
|
...n.headers,
|
|
21
21
|
...e?.headers
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
version:
|
|
27
|
-
},
|
|
25
|
+
const r = "0.2.4-dev.3", i = {
|
|
26
|
+
version: r
|
|
27
|
+
}, a = i.version, t = "@aippy/runtime";
|
|
28
28
|
function p() {
|
|
29
29
|
return {
|
|
30
|
-
name:
|
|
31
|
-
version:
|
|
30
|
+
name: t,
|
|
31
|
+
version: a,
|
|
32
32
|
buildTime: (/* @__PURE__ */ new Date()).toISOString()
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
36
|
-
d as
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_ as
|
|
42
|
-
|
|
36
|
+
d as AippyRuntime,
|
|
37
|
+
f as AippyRuntimeError,
|
|
38
|
+
u as Cancellable,
|
|
39
|
+
s as DEFAULT_CONFIG,
|
|
40
|
+
A as ERROR_CODES,
|
|
41
|
+
_ as ReceiveChannel,
|
|
42
|
+
t as SDK_NAME,
|
|
43
|
+
a as VERSION,
|
|
44
|
+
m as aippyRuntime,
|
|
45
|
+
R as createError,
|
|
46
|
+
o as getConfigFromEnv,
|
|
43
47
|
p as getVersionInfo,
|
|
44
|
-
|
|
48
|
+
c as mergeConfig
|
|
45
49
|
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aippy Runtime - Unified runtime for native bridge communication
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Cancellable class - For managing subscriptions
|
|
6
|
+
*/
|
|
7
|
+
export declare class Cancellable {
|
|
8
|
+
private cancelFn?;
|
|
9
|
+
private cancelled;
|
|
10
|
+
constructor(cancelFn?: (() => void) | undefined);
|
|
11
|
+
cancel(): void;
|
|
12
|
+
get isCancelled(): boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* ReceiveChannel - Manages message receiving and subscription
|
|
16
|
+
*/
|
|
17
|
+
export declare class ReceiveChannel {
|
|
18
|
+
private emitter;
|
|
19
|
+
/**
|
|
20
|
+
* Emit a message to subscribers
|
|
21
|
+
*/
|
|
22
|
+
emit(message: {
|
|
23
|
+
endpoint: string;
|
|
24
|
+
payload: any;
|
|
25
|
+
}): void;
|
|
26
|
+
/**
|
|
27
|
+
* Subscribe to messages on a specific endpoint
|
|
28
|
+
*/
|
|
29
|
+
subscribe(endpoint: string, callback: (payload: any) => void): Cancellable;
|
|
30
|
+
/**
|
|
31
|
+
* Subscribe to a single message (auto-unsubscribe after first message)
|
|
32
|
+
*/
|
|
33
|
+
once(endpoint: string, callback: (payload: any) => void): Cancellable;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* AippyRuntime - Main runtime class for native bridge communication
|
|
37
|
+
*/
|
|
38
|
+
export declare class AippyRuntime {
|
|
39
|
+
receiveChannel: ReceiveChannel;
|
|
40
|
+
private seq;
|
|
41
|
+
/**
|
|
42
|
+
* Receive message from native layer
|
|
43
|
+
* Called by native code via: window.aippyRuntime.receiveMessage(message)
|
|
44
|
+
*/
|
|
45
|
+
receiveMessage(message: {
|
|
46
|
+
endpoint: string;
|
|
47
|
+
payload: any;
|
|
48
|
+
}): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Create a subscription to native events
|
|
51
|
+
* @param handler - WebKit message handler (e.g., deviceMotionHandler)
|
|
52
|
+
* @param subscribePayload - Subscription parameters (e.g., { type: "motion" })
|
|
53
|
+
* @param callback - Callback to handle received data
|
|
54
|
+
* @returns Cancellable subscription
|
|
55
|
+
*/
|
|
56
|
+
createSubscription(handler: any, subscribePayload: any, callback: (data: any) => void): Cancellable;
|
|
57
|
+
/**
|
|
58
|
+
* Make a subscription message with unique endpoint
|
|
59
|
+
*/
|
|
60
|
+
private makeSubscriptionMessage;
|
|
61
|
+
/**
|
|
62
|
+
* Add motion listener (convenience method)
|
|
63
|
+
* @param callback - Callback to handle motion data
|
|
64
|
+
* @returns Cleanup function
|
|
65
|
+
*/
|
|
66
|
+
addMotionListener(callback: (data: any) => void): () => void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Global runtime instance - Singleton pattern
|
|
70
|
+
*/
|
|
71
|
+
export declare const aippyRuntime: AippyRuntime;
|