@yodaos-pkg/ink 0.17.0 → 0.17.1

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/index.d.ts CHANGED
@@ -709,26 +709,102 @@ export interface InkHostSensorControlRequest {
709
709
  }
710
710
 
711
711
  /**
712
- * Host-controlled audio recording options passed into
713
- * `hostCapabilities.media.startAudioRecording()`.
712
+ * Host-visible device descriptor returned from `hostCapabilities.media.enumerateDevices()`.
714
713
  */
715
- export interface InkHostAudioRecordingOptions {
716
- /** Requested sample rate in hertz. */
714
+ export interface InkHostMediaDeviceInfo {
715
+ deviceId: string;
716
+ kind: 'audioinput' | 'videoinput';
717
+ label: string;
718
+ groupId?: string;
719
+ }
720
+
721
+ /**
722
+ * Normalized media track constraints sent to `hostCapabilities.media.getUserMedia()`.
723
+ */
724
+ export interface InkHostMediaTrackConstraints {
725
+ deviceId?: string;
717
726
  sampleRate?: number;
718
- /** Requested number of audio channels. */
719
- numberOfChannels?: number;
720
- /** Requested sample or container format, for example `pcm`. */
721
- format?: string;
727
+ channelCount?: number;
728
+ echoCancellation?: boolean;
729
+ facingMode?: string;
730
+ width?: number;
731
+ height?: number;
732
+ frameRate?: number;
722
733
  }
723
734
 
724
735
  /**
725
- * Start request forwarded to `hostCapabilities.media.startAudioRecording()`.
736
+ * Request forwarded to `hostCapabilities.media.getUserMedia()`.
726
737
  */
727
- export interface InkHostStartAudioRecordingRequest {
728
- /** Runtime-generated identifier for the recorder target receiving follow-up events. */
729
- targetId: string;
730
- /** Host recording options requested by the Ink app. */
731
- options: InkHostAudioRecordingOptions;
738
+ export interface InkHostGetUserMediaRequest {
739
+ streamId: string;
740
+ constraints: {
741
+ audio?: InkHostMediaTrackConstraints;
742
+ video?: InkHostMediaTrackConstraints;
743
+ };
744
+ }
745
+
746
+ /**
747
+ * Actual track settings reported back by the host after opening a media stream.
748
+ */
749
+ export interface InkHostMediaTrackSettings extends InkHostMediaTrackConstraints {}
750
+
751
+ /**
752
+ * Track descriptor returned from `hostCapabilities.media.getUserMedia()`.
753
+ */
754
+ export interface InkHostMediaTrackDescriptor {
755
+ trackId: string;
756
+ kind: 'audio' | 'video';
757
+ label: string;
758
+ enabled?: boolean;
759
+ muted?: boolean;
760
+ settings: InkHostMediaTrackSettings;
761
+ }
762
+
763
+ /**
764
+ * Stream descriptor returned from `hostCapabilities.media.getUserMedia()`.
765
+ */
766
+ export interface InkHostMediaStreamDescriptor {
767
+ streamId: string;
768
+ tracks: InkHostMediaTrackDescriptor[];
769
+ }
770
+
771
+ /**
772
+ * Control request forwarded to `hostCapabilities.media.stopMediaTrack()`.
773
+ */
774
+ export interface InkHostMediaTrackControlRequest {
775
+ streamId: string;
776
+ trackId: string;
777
+ }
778
+
779
+ /**
780
+ * Request forwarded to `hostCapabilities.media.createMediaRecorder()`.
781
+ */
782
+ export interface InkHostCreateMediaRecorderRequest {
783
+ recorderId: string;
784
+ streamId: string;
785
+ mimeType: string;
786
+ }
787
+
788
+ /**
789
+ * Result returned from `hostCapabilities.media.createMediaRecorder()`.
790
+ */
791
+ export interface InkHostMediaRecorderDescriptor {
792
+ recorderId: string;
793
+ mimeType: string;
794
+ }
795
+
796
+ /**
797
+ * Control request forwarded to media-recorder host methods.
798
+ */
799
+ export interface InkHostMediaRecorderControlRequest {
800
+ recorderId: string;
801
+ }
802
+
803
+ /**
804
+ * Start request forwarded to `hostCapabilities.media.startMediaRecorder()`.
805
+ */
806
+ export interface InkHostMediaRecorderStartRequest extends InkHostMediaRecorderControlRequest {
807
+ timesliceMs?: number;
732
808
  }
733
809
 
734
810
  /**
@@ -855,14 +931,28 @@ export interface InkHostCapabilities {
855
931
  };
856
932
  /** Host implementations for recording audio and capturing still photos. */
857
933
  media?: {
858
- /** Starts audio recording and later emits `media.audioRecording*` events. */
859
- startAudioRecording?(request: InkHostStartAudioRecordingRequest): void | Promise<void>;
860
- /** Stops the currently active audio recording session. */
861
- stopAudioRecording?(request: Record<string, never>): void | Promise<void>;
862
- /** Pauses the currently active audio recording session. */
863
- pauseAudioRecording?(request: Record<string, never>): void | Promise<void>;
864
- /** Resumes a previously paused audio recording session. */
865
- resumeAudioRecording?(request: Record<string, never>): void | Promise<void>;
934
+ /** Lists the media devices currently exposed to Ink. */
935
+ enumerateDevices?(): InkHostMediaDeviceInfo[] | Promise<InkHostMediaDeviceInfo[]>;
936
+ /** Opens a host-backed audio/video stream and returns its actual track settings. */
937
+ getUserMedia?(
938
+ request: InkHostGetUserMediaRequest,
939
+ ): InkHostMediaStreamDescriptor | Promise<InkHostMediaStreamDescriptor>;
940
+ /** Stops one track previously returned by `getUserMedia()`. */
941
+ stopMediaTrack?(request: InkHostMediaTrackControlRequest): void | Promise<void>;
942
+ /** Creates a recorder session bound to a host media stream. */
943
+ createMediaRecorder?(
944
+ request: InkHostCreateMediaRecorderRequest,
945
+ ): InkHostMediaRecorderDescriptor | Promise<InkHostMediaRecorderDescriptor>;
946
+ /** Starts a host-created recorder session. */
947
+ startMediaRecorder?(request: InkHostMediaRecorderStartRequest): void | Promise<void>;
948
+ /** Pauses a host-created recorder session. */
949
+ pauseMediaRecorder?(request: InkHostMediaRecorderControlRequest): void | Promise<void>;
950
+ /** Resumes a host-created recorder session. */
951
+ resumeMediaRecorder?(request: InkHostMediaRecorderControlRequest): void | Promise<void>;
952
+ /** Requests one data flush from a host-created recorder session. */
953
+ requestMediaRecorderData?(request: InkHostMediaRecorderControlRequest): void | Promise<void>;
954
+ /** Stops a host-created recorder session. */
955
+ stopMediaRecorder?(request: InkHostMediaRecorderControlRequest): void | Promise<void>;
866
956
  /** Captures one photo and returns encoded image bytes plus their MIME type. */
867
957
  takePhoto?(
868
958
  request: InkHostTakePhotoOptions,