@lnltch/unitalk-sdk 1.1.3 → 1.1.5

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.
@@ -31,7 +31,12 @@ declare global {
31
31
  export default class Bridge implements UniTalkCompatibleBridge {
32
32
  private eventListeners;
33
33
  private callbacks;
34
- constructor();
34
+ private debug;
35
+ constructor(options: {
36
+ debug?: boolean;
37
+ });
38
+ private log;
39
+ private error;
35
40
  onEvent(eventName: string, callback: (data?: any) => void): void;
36
41
  offEvent(eventName: string, callback?: (data?: any) => void): void;
37
42
  invokeNative(method: string, params?: any, callback?: (error: any, result?: any) => void): void;
@@ -43,10 +48,6 @@ export default class Bridge implements UniTalkCompatibleBridge {
43
48
  * 检测原生桥接环境,输出调试信息
44
49
  */
45
50
  private checkNativeBridgeAvailability;
46
- /**
47
- * 判断是否为 Android 或鸿蒙
48
- */
49
- private isAndroidOrHarmony;
50
51
  /**
51
52
  * 判断是否为 iOS
52
53
  */
@@ -0,0 +1,5 @@
1
+ declare const crosApi: {
2
+ getBindedDeviceList: string;
3
+ getCode: string;
4
+ };
5
+ export default crosApi;
@@ -3,6 +3,11 @@ export interface UnitalkSDKOptions {
3
3
  unitalkServerToken?: string;
4
4
  debug?: boolean;
5
5
  }
6
+ export interface AuthCodeParams {
7
+ clientId: string;
8
+ success?: (res: any) => void;
9
+ fail?: (error: any) => void;
10
+ }
6
11
  export interface VoicePrintCfg {
7
12
  baseH?: number;
8
13
  maxH?: number;
@@ -31,12 +36,13 @@ export declare class UnitalkSDK {
31
36
  * 设置 Unitalk 服务器 URL
32
37
  * @param url Unitalk 服务器 URL
33
38
  */
34
- setServer(url: string): void;
39
+ setUnitalkServerUrl(url: string): void;
35
40
  /**
36
41
  * 设置 Unitalk 服务器 Token
37
42
  * @param token Unitalk 服务器 Token
38
43
  */
39
- setToken(token: string): void;
44
+ setUnitalkServerToken(token: string): void;
45
+ getAuthCode(params: AuthCodeParams): void;
40
46
  /**
41
47
  * 获取连接设备图标
42
48
  * @param idMark 设备 厂商 标记
@@ -75,6 +81,11 @@ export declare class UnitalkSDK {
75
81
  checkConnection(callback?: (success?: boolean, response?: any) => void): void;
76
82
  startRecord(params?: object, callback?: (result?: any) => void): void;
77
83
  stopRecord(params?: object, callback?: (result?: any) => void): void;
84
+ getRecordSounds(): {
85
+ recordStartSounds: any;
86
+ recordStopSounds: any;
87
+ };
88
+ clearRecordSounds(): void;
78
89
  on(eventName: string, callback: (result?: any) => void): void;
79
90
  off(eventName: string, callback: (result?: any) => void): void;
80
91
  /**
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { UnitalkSDK } from './core/sdk';
2
- import type { UnitalkSDKOptions } from './core/sdk';
3
- export type { UnitalkSDKOptions };
1
+ import { UnitalkSDK } from "./core/sdk";
2
+ import type { UnitalkSDKOptions, AuthCodeParams } from "./core/sdk";
3
+ export type { UnitalkSDKOptions, AuthCodeParams };
4
4
  export { UnitalkSDK };