@pmate/bridge 0.1.6 → 0.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmate/bridge",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "files": [
5
5
  "src",
6
6
  "global.d.ts"
@@ -15,11 +15,11 @@
15
15
  }
16
16
  },
17
17
  "devDependencies": {
18
- "@types/react": "catalog:",
19
- "react": "catalog:"
18
+ "@types/react": "^19.2.7",
19
+ "react": "^19.1.1"
20
20
  },
21
21
  "main": "src/index.ts",
22
22
  "exports": {
23
23
  ".": "./src/index.ts"
24
24
  }
25
- }
25
+ }
package/src/index.ts CHANGED
@@ -12,6 +12,8 @@ export {
12
12
  getConnectedBluetoothDevices,
13
13
  getNotificationStatus,
14
14
  getPushToken,
15
+ isAndroidDevice,
16
+ isIOSDevice,
15
17
  listAlarms,
16
18
  onAlarmEvent,
17
19
  onBluetoothEvent,
package/src/internal.ts CHANGED
@@ -47,6 +47,18 @@ export function readIsPmate() {
47
47
  return hasWindow() && !!(window as PmateWindow).isPmate
48
48
  }
49
49
 
50
+ function normalizedPlatform(info?: Pick<DeviceInfo, "platform"> | null) {
51
+ return info?.platform?.trim().toLowerCase() ?? ""
52
+ }
53
+
54
+ export function isAndroidDevice(info?: Pick<DeviceInfo, "platform"> | null) {
55
+ return normalizedPlatform(info) === "android"
56
+ }
57
+
58
+ export function isIOSDevice(info?: Pick<DeviceInfo, "platform"> | null) {
59
+ return normalizedPlatform(info) === "ios"
60
+ }
61
+
50
62
  async function callBridge<T>(functionName: string, params?: unknown): Promise<T | undefined> {
51
63
  try {
52
64
  return await (window as PmateWindow).PmateBridge?.call<T>(functionName, params)
package/src/types.ts CHANGED
@@ -17,6 +17,7 @@ export interface DeviceInfo {
17
17
  systemVersion: string
18
18
  model: string
19
19
  idiom: string
20
+ manufacturer?: string
20
21
  }
21
22
 
22
23
  export interface DeviceInfoState {