@ikonai/sdk 1.0.49 → 1.0.50

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.
@@ -6,6 +6,21 @@ export interface IkonImageCaptureRequest {
6
6
  width?: number;
7
7
  height?: number;
8
8
  }
9
+ export type IkonNativeCameraFacing = 'user' | 'environment';
10
+ /**
11
+ * Best-effort detection of a mobile browser. Used to decide whether the
12
+ * `<input type="file" capture>` flow will actually trigger the OS camera UI
13
+ * (mobile) or fall through to a regular file picker (desktop). Callers that
14
+ * support a headless fallback should prefer it on desktop.
15
+ */
16
+ export declare function isMobileBrowserLikely(): boolean;
17
+ export interface IkonNativeCameraCaptureRequest {
18
+ facing?: IkonNativeCameraFacing;
19
+ mime?: 'image/jpeg' | 'image/png';
20
+ quality?: number;
21
+ width?: number;
22
+ height?: number;
23
+ }
9
24
  export interface IkonImageCaptureResult {
10
25
  mime: string;
11
26
  width: number;
@@ -20,4 +35,11 @@ export declare class IkonImageCapture {
20
35
  captureFromStream(stream: MediaStream, request?: IkonImageCaptureRequest): Promise<IkonImageCaptureResult>;
21
36
  private acquireCameraStream;
22
37
  captureFromCamera(request?: IkonImageCaptureRequest): Promise<IkonImageCaptureResult>;
38
+ /**
39
+ * Capture an image via the native OS camera UI (preview + shutter + front/back toggle on mobile,
40
+ * file picker on desktop). Implemented with a transient `<input type="file" capture>` and
41
+ * therefore must be invoked synchronously from a user gesture handler. Resolves to `null` if
42
+ * the user dismisses the picker without selecting/capturing.
43
+ */
44
+ captureFromNativeCamera(request?: IkonNativeCameraCaptureRequest): Promise<IkonImageCaptureResult | null>;
23
45
  }
package/media/index.d.ts CHANGED
@@ -11,5 +11,5 @@ export { IkonVideoCapture } from './ikon-video-capture';
11
11
  export type { IkonVideoCaptureHandle, IkonVideoCaptureRequest, IkonVideoCaptureOptions, VideoCaptureSource } from './ikon-video-capture';
12
12
  export { IkonAudioCapture } from './ikon-audio-capture';
13
13
  export type { IkonAudioCaptureHandle, IkonAudioCaptureRequest, IkonAudioCaptureConfig, IkonAudioCaptureOptions } from './ikon-audio-capture';
14
- export { IkonImageCapture } from './ikon-image-capture';
15
- export type { IkonImageCaptureRequest, IkonImageCaptureResult } from './ikon-image-capture';
14
+ export { IkonImageCapture, isMobileBrowserLikely } from './ikon-image-capture';
15
+ export type { IkonImageCaptureRequest, IkonImageCaptureResult, IkonNativeCameraCaptureRequest, IkonNativeCameraFacing } from './ikon-image-capture';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ikonai/sdk",
3
- "version": "1.0.49",
3
+ "version": "1.0.50",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -8,6 +8,7 @@ export declare class WebSocketTransport implements Transport {
8
8
  private keepaliveTimeout;
9
9
  private isClosed;
10
10
  private keepaliveResponseMessage;
11
+ private firstMessageResolver;
11
12
  private readonly keepaliveTimeoutMs;
12
13
  private readonly connectionTimeoutMs;
13
14
  private readonly callbacks;
@@ -28,6 +28,8 @@ export declare class WebTransportTransport implements Transport {
28
28
  private receiveDataView;
29
29
  private receiveDataViewBuffer;
30
30
  private keepaliveResponseMessage;
31
+ private firstMessageResolver;
32
+ private firstMessageRejecter;
31
33
  private readonly keepaliveTimeoutMs;
32
34
  private readonly connectionTimeoutMs;
33
35
  private readonly callbacks;
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Initialize debug mode based on URL params (?ikon-debug=true or ?debug=true).
3
- * Call this early in SDK initialization.
3
+ * Call this early in SDK initialization. Idempotent — safe to call multiple
4
+ * times (e.g. once per IkonClient constructor); only the first call has effect.
4
5
  * Returns true if debug mode is enabled.
5
6
  */
6
7
  export declare function initializeDebugMode(): boolean;