@koi-design/callkit 2.0.0-beta.9 → 2.0.0

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/index.d.ts CHANGED
@@ -44,7 +44,7 @@ declare class Logger {
44
44
  info(msg: string, extra: LogEntity): void;
45
45
  success(msg: string, extra: LogEntity): void;
46
46
  warn(msg: string, extra: LogEntity): void;
47
- error(msg: string | Error, extra: LogEntity): void;
47
+ error(msg: string | Error, extra: LogEntity, noTrigger?: boolean): void;
48
48
  private catchLog;
49
49
  }
50
50
 
@@ -80,7 +80,6 @@ declare class Socket {
80
80
  private confirmAck;
81
81
  private onMessage;
82
82
  send(event: SocketSendEventType, message?: any): void;
83
- sendMessage(event: SocketSendEventType, message?: any): Promise<void>;
84
83
  private ping;
85
84
  private checkPing;
86
85
  /**
@@ -189,6 +188,10 @@ declare const KitEvent: {
189
188
  * Mute status change
190
189
  */
191
190
  KIT_SET_MUTE: string;
191
+ /**
192
+ * Call id change
193
+ */
194
+ KIT_CALL_ID_CHANGE: string;
192
195
  /**
193
196
  * Error
194
197
  */
@@ -346,42 +349,48 @@ type CallStatusType = (typeof CallStatus)[keyof typeof CallStatus];
346
349
  declare class Connect {
347
350
  callKit: CallKit;
348
351
  /**
349
- * connectStatus: init registered connecting calling
352
+ *@description Reconnect config
353
+ */
354
+ private reconnectConfig;
355
+ /**
356
+ *@description Whether muted
357
+ */
358
+ private isMute;
359
+ /**
360
+ *@description Whether registered
361
+ */
362
+ private isRegister;
363
+ /**
364
+ *@description Whether holding
365
+ */
366
+ private isHold;
367
+ /**
368
+ *@description Connect status: init registered connecting calling
350
369
  */
351
370
  connectStatus: number;
352
371
  currentSession?: Invitation;
353
372
  mediaStream?: MediaStream;
354
373
  userAgent?: UserAgent;
355
374
  registerer?: Registerer;
356
- currentCallId?: string;
357
375
  /**
358
- * Whether it's a re-connected
376
+ *@description Whether it's a re-connected
359
377
  */
360
378
  isReConnected: boolean;
361
- observeOptionsHeartbeatHandler: ReturnType<typeof setTimeout> | null;
362
379
  /**
363
- * Whether it's an outgoing call
380
+ *@description Whether it's an outgoing call
364
381
  */
365
382
  isOutgoing: boolean;
366
383
  /**
367
- * Whether it's an active hangup
384
+ *@description Whether it's an active hangup
368
385
  */
369
386
  isUnprompted: boolean;
370
- isCurrentSessionInvited: boolean;
371
- private reconnectConfig;
372
387
  /**
373
- * Whether muted
388
+ *@description Whether the current session is invited
374
389
  */
375
- private isMute;
376
- /**
377
- * Whether registered
378
- */
379
- private isRegister;
380
- /**
381
- * Whether holding
382
- */
383
- private isHold;
390
+ hasInvite: boolean;
384
391
  constructor(callKit: CallKit);
392
+ currentCallId: string | null;
393
+ setCallId(callId: string | null): void;
385
394
  reset(): Promise<void>;
386
395
  private getAduioReference;
387
396
  permission(): Promise<void>;
@@ -416,8 +425,9 @@ declare class Connect {
416
425
  * @returns
417
426
  */
418
427
  isInit(): boolean;
419
- clearObserveOptionsHeartbeatInterval(): void;
420
- heartbeatFlag: number;
428
+ private heartbeatInterval?;
429
+ private heartbeatFlag;
430
+ clearHeartbeat(): void;
421
431
  startHeartbeat(): void;
422
432
  socketTriggerHangup(callId: string): void;
423
433
  register(): Promise<void>;
@@ -502,7 +512,7 @@ declare class CallKit {
502
512
  on(event: kitEventType, callback: (...args: any[]) => void): void;
503
513
  off(event: kitEventType, callback?: (...args: any[]) => void): void;
504
514
  removeAllListeners(): void;
505
- trigger(event: kitEventType, data?: any): void;
515
+ trigger(event: kitEventType, data?: any, noLog?: boolean): void;
506
516
  }
507
517
 
508
518
  export { CallKit, CallKitConfig, ConfigEntity, kitEventType };