@dskripchenko/ui 1.14.0 → 1.15.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.
Files changed (43) hide show
  1. package/README.md +5 -2
  2. package/dist/components/Audio/UidAudio.vue.d.ts +127 -0
  3. package/dist/components/Audio/index.d.ts +2 -0
  4. package/dist/components/Gauge/UidGauge.vue.d.ts +1 -1
  5. package/dist/components/Grid/UidGrid.vue.d.ts +1 -1
  6. package/dist/components/Media/UidMediaMenu.vue.d.ts +65 -0
  7. package/dist/components/Media/UidMediaScrubber.vue.d.ts +38 -0
  8. package/dist/components/Media/index.d.ts +6 -0
  9. package/dist/components/Media/mediaUtils.d.ts +47 -0
  10. package/dist/components/Media/useMediaController.d.ts +80 -0
  11. package/dist/components/Media/useMediaLocale.d.ts +3 -0
  12. package/dist/components/Media/waveform.d.ts +27 -0
  13. package/dist/components/Menu/UidMenu.vue.d.ts +17 -3
  14. package/dist/components/Pagination/UidPaginationCursor.vue.d.ts +2 -2
  15. package/dist/components/Progress/UidProgress.vue.d.ts +1 -1
  16. package/dist/components/ProgressRing/UidProgressRing.vue.d.ts +1 -1
  17. package/dist/components/Stack/UidStack.vue.d.ts +1 -1
  18. package/dist/components/Video/UidVideo.vue.d.ts +106 -0
  19. package/dist/components/Video/index.d.ts +2 -0
  20. package/dist/composables/useLocale.d.ts +2 -1
  21. package/dist/hls/abr.d.ts +36 -0
  22. package/dist/hls/aes.d.ts +5 -0
  23. package/dist/hls/engine.d.ts +86 -0
  24. package/dist/hls/index.cjs +3 -0
  25. package/dist/hls/index.d.ts +11 -0
  26. package/dist/hls/index.mjs +1500 -0
  27. package/dist/hls/mp4.d.ts +21 -0
  28. package/dist/hls/playlist.d.ts +76 -0
  29. package/dist/hls/transmux.d.ts +27 -0
  30. package/dist/hls/ts/adts.d.ts +16 -0
  31. package/dist/hls/ts/demux.d.ts +26 -0
  32. package/dist/hls/ts/h264.d.ts +30 -0
  33. package/dist/hls/ts/id3.d.ts +10 -0
  34. package/dist/hls/ts/mp4mux.d.ts +32 -0
  35. package/dist/hls/ts/transmuxer.d.ts +22 -0
  36. package/dist/index.cjs +10 -6
  37. package/dist/index.d.ts +7 -1
  38. package/dist/index.mjs +4416 -2312
  39. package/dist/locales/index.d.ts +1 -1
  40. package/dist/locales/types.d.ts +46 -0
  41. package/dist/styles/all.css +1 -1
  42. package/dist/styles/index.css +1 -1
  43. package/package.json +9 -1
@@ -0,0 +1,21 @@
1
+ export interface Mp4Box {
2
+ type: string;
3
+ start: number;
4
+ /** First byte after the header. */
5
+ data: number;
6
+ end: number;
7
+ }
8
+ export declare function readBoxes(d: Uint8Array, start?: number, end?: number): Mp4Box[];
9
+ /** Boxes at a path like `['moov', 'trak', 'mdia']`, descending through every match. */
10
+ export declare function findBoxes(d: Uint8Array, path: string[], start?: number, end?: number): Mp4Box[];
11
+ export declare function isFmp4(d: Uint8Array): boolean;
12
+ export declare function isMpegTs(d: Uint8Array): boolean;
13
+ export interface Mp4TrackInfo {
14
+ id: number;
15
+ timescale: number;
16
+ kind: 'video' | 'audio' | 'other';
17
+ codec?: string;
18
+ }
19
+ export declare function parseInit(d: Uint8Array): Mp4TrackInfo[];
20
+ /** Decode time (seconds) of the first fragment in a media segment, from `tfdt`. */
21
+ export declare function fragmentStart(d: Uint8Array, tracks: Mp4TrackInfo[]): number | null;
@@ -0,0 +1,76 @@
1
+ export interface HlsByteRange {
2
+ offset: number;
3
+ length: number;
4
+ }
5
+ export interface HlsKey {
6
+ method: 'NONE' | 'AES-128' | 'SAMPLE-AES' | string;
7
+ uri?: string;
8
+ iv?: Uint8Array;
9
+ }
10
+ export interface HlsInitSection {
11
+ uri: string;
12
+ byteRange?: HlsByteRange;
13
+ key?: HlsKey;
14
+ }
15
+ export interface HlsSegment {
16
+ uri: string;
17
+ duration: number;
18
+ /** Start on the playlist timeline (sum of the preceding durations). */
19
+ start: number;
20
+ /** Media sequence number. */
21
+ sn: number;
22
+ /** Discontinuity sequence: grows by one at every EXT-X-DISCONTINUITY. */
23
+ cc: number;
24
+ title?: string;
25
+ byteRange?: HlsByteRange;
26
+ key?: HlsKey;
27
+ map?: HlsInitSection;
28
+ }
29
+ export interface HlsMediaPlaylist {
30
+ type: 'media';
31
+ url: string;
32
+ targetDuration: number;
33
+ mediaSequence: number;
34
+ discontinuitySequence: number;
35
+ endList: boolean;
36
+ playlistType?: string;
37
+ segments: HlsSegment[];
38
+ totalDuration: number;
39
+ }
40
+ export interface HlsVariant {
41
+ uri: string;
42
+ bandwidth: number;
43
+ averageBandwidth?: number;
44
+ width?: number;
45
+ height?: number;
46
+ codecs?: string;
47
+ frameRate?: number;
48
+ name?: string;
49
+ audio?: string;
50
+ }
51
+ export interface HlsRendition {
52
+ type: string;
53
+ groupId: string;
54
+ name?: string;
55
+ language?: string;
56
+ uri?: string;
57
+ default?: boolean;
58
+ autoselect?: boolean;
59
+ channels?: string;
60
+ }
61
+ export interface HlsMasterPlaylist {
62
+ type: 'master';
63
+ url: string;
64
+ variants: HlsVariant[];
65
+ media: HlsRendition[];
66
+ }
67
+ export type HlsPlaylist = HlsMasterPlaylist | HlsMediaPlaylist;
68
+ export declare class HlsParseError extends Error {
69
+ constructor(message: string);
70
+ }
71
+ /** Attribute list of a tag: `BANDWIDTH=1280000,CODECS="avc1.4d401f,mp4a.40.2"`. */
72
+ export declare function parseAttributes(input: string): Record<string, string>;
73
+ export declare function parseHexIv(value: string): Uint8Array;
74
+ export declare function parsePlaylist(text: string, url: string): HlsPlaylist;
75
+ /** IV of a segment without an explicit IV attribute: its media sequence number, big-endian. */
76
+ export declare function sequenceIv(sn: number): Uint8Array;
@@ -0,0 +1,27 @@
1
+ import { Mp4TrackInfo } from './mp4.js';
2
+ export interface TransmuxResult {
3
+ /** A new initialization segment, when the stream configuration appeared or changed. */
4
+ init?: Uint8Array;
5
+ /** Media fragments (`moof` + `mdat`) to append. */
6
+ data: Uint8Array;
7
+ /** MIME type with codecs for the SourceBuffer. */
8
+ mimeType: string;
9
+ tracks: Mp4TrackInfo[];
10
+ /** Decode time of the first sample, in seconds. */
11
+ startTime: number;
12
+ }
13
+ export interface TransmuxContext {
14
+ /** The segment starts after EXT-X-DISCONTINUITY (or after a seek / level switch). */
15
+ discontinuity: boolean;
16
+ }
17
+ export interface SegmentTransmuxer {
18
+ /** Whether this transmuxer understands the segment (by its first bytes). */
19
+ canHandle(data: Uint8Array): boolean;
20
+ push(data: Uint8Array, ctx: TransmuxContext): TransmuxResult;
21
+ reset(): void;
22
+ }
23
+ export type TransmuxerFactory = () => SegmentTransmuxer;
24
+ export declare class TransmuxError extends Error {
25
+ readonly code: 'codec' | 'format';
26
+ constructor(message: string, code: 'codec' | 'format');
27
+ }
@@ -0,0 +1,16 @@
1
+ export declare const ADTS_RATES: number[];
2
+ export interface AdtsConfig {
3
+ objectType: number;
4
+ rateIndex: number;
5
+ sampleRate: number;
6
+ channels: number;
7
+ }
8
+ export interface AdtsFrames {
9
+ config?: AdtsConfig;
10
+ frames: Uint8Array[];
11
+ /** Bytes after the last complete frame (a frame cut at the end of the input). */
12
+ rest: Uint8Array;
13
+ }
14
+ export declare function parseAdts(d: Uint8Array): AdtsFrames;
15
+ /** AudioSpecificConfig (2 bytes) for the esds box. */
16
+ export declare function audioSpecificConfig(c: AdtsConfig): Uint8Array;
@@ -0,0 +1,26 @@
1
+ export declare const STREAM_H264 = 27;
2
+ export declare const STREAM_AAC = 15;
3
+ export declare const STREAM_HEVC = 36;
4
+ export declare const STREAM_MP3: number[];
5
+ export declare const STREAM_AC3: number[];
6
+ export interface PesPacket {
7
+ pts?: number;
8
+ dts?: number;
9
+ data: Uint8Array;
10
+ }
11
+ export interface DemuxState {
12
+ pmtPid?: number;
13
+ videoPid?: number;
14
+ audioPid?: number;
15
+ videoType?: number;
16
+ audioType?: number;
17
+ }
18
+ export interface DemuxResult extends DemuxState {
19
+ video: PesPacket[];
20
+ audio: PesPacket[];
21
+ }
22
+ /** 33-bit PES timestamp at `o` (90 kHz), without bitwise ops beyond 32 bits. */
23
+ export declare function readTimestamp(d: Uint8Array, o: number): number;
24
+ export declare function parsePes(d: Uint8Array): PesPacket | null;
25
+ /** Splits a transport stream segment into video and audio PES packets. */
26
+ export declare function demuxTs(d: Uint8Array, previous?: DemuxState): DemuxResult;
@@ -0,0 +1,30 @@
1
+ export declare const NAL_IDR = 5;
2
+ export declare const NAL_SPS = 7;
3
+ export declare const NAL_PPS = 8;
4
+ export declare const NAL_AUD = 9;
5
+ /** NAL units of an Annex-B byte stream (start codes removed). */
6
+ export declare function splitNals(d: Uint8Array): Uint8Array[];
7
+ export declare function nalType(nal: Uint8Array): number;
8
+ /** RBSP: drops emulation prevention bytes (00 00 03 → 00 00). */
9
+ export declare function unescapeRbsp(d: Uint8Array): Uint8Array;
10
+ export declare class BitReader {
11
+ private readonly d;
12
+ private pos;
13
+ constructor(d: Uint8Array);
14
+ bit(): number;
15
+ bits(n: number): number;
16
+ ue(): number;
17
+ se(): number;
18
+ }
19
+ export interface SpsInfo {
20
+ profile: number;
21
+ compatibility: number;
22
+ level: number;
23
+ width: number;
24
+ height: number;
25
+ }
26
+ /** Profile, level and coded picture size from a sequence parameter set NAL unit. */
27
+ export declare function parseSps(nal: Uint8Array): SpsInfo;
28
+ export declare function avcCodec(sps: Uint8Array): string;
29
+ /** Length-prefixed (4-byte) sample payload from NAL units. */
30
+ export declare function toAvcc(nals: Uint8Array[]): Uint8Array;
@@ -0,0 +1,10 @@
1
+ export declare function isAdtsSync(d: Uint8Array, o?: number): boolean;
2
+ /** Packed audio (HLS "raw" AAC segments): ID3 tags followed by ADTS frames. */
3
+ export declare function isPackedAudio(d: Uint8Array): boolean;
4
+ export interface PackedAudio {
5
+ /** 90 kHz timestamp from the ID3 PRIV frame of Apple's transport stream timestamp. */
6
+ pts?: number;
7
+ /** ADTS payload after the leading ID3 tags. */
8
+ data: Uint8Array;
9
+ }
10
+ export declare function parsePackedAudio(d: Uint8Array): PackedAudio;
@@ -0,0 +1,32 @@
1
+ export interface MuxVideoTrack {
2
+ id: number;
3
+ kind: 'video';
4
+ timescale: number;
5
+ width: number;
6
+ height: number;
7
+ sps: Uint8Array;
8
+ pps: Uint8Array;
9
+ }
10
+ export interface MuxAudioTrack {
11
+ id: number;
12
+ kind: 'audio';
13
+ timescale: number;
14
+ channels: number;
15
+ sampleRate: number;
16
+ config: Uint8Array;
17
+ }
18
+ export type MuxTrack = MuxVideoTrack | MuxAudioTrack;
19
+ export interface MuxSample {
20
+ size: number;
21
+ duration: number;
22
+ /** Composition offset (pts − dts) in track timescale. */
23
+ cts: number;
24
+ key: boolean;
25
+ }
26
+ type Part = Uint8Array | number[];
27
+ export declare function box(type: string, ...parts: Part[]): Uint8Array;
28
+ export declare function initSegment(tracks: MuxTrack[]): Uint8Array;
29
+ /** One `moof` + `mdat` pair for a track's samples. */
30
+ export declare function fragment(seq: number, trackId: number, baseTime: number, samples: MuxSample[], payload: Uint8Array): Uint8Array;
31
+ export declare function concatBytes(parts: Uint8Array[]): Uint8Array;
32
+ export {};
@@ -0,0 +1,22 @@
1
+ import { SegmentTransmuxer, TransmuxContext, TransmuxResult } from '../transmux.js';
2
+ /** MPEG-TS (H.264 + AAC) → fragmented MP4, segment by segment, with a continuous timeline. */
3
+ export declare class TsTransmuxer implements SegmentTransmuxer {
4
+ private demux;
5
+ private video?;
6
+ private audio?;
7
+ private initKey;
8
+ private seq;
9
+ private ref;
10
+ private nextVideoDts;
11
+ private nextAudioDts;
12
+ private videoDuration;
13
+ canHandle(data: Uint8Array): boolean;
14
+ reset(): void;
15
+ private unwrap;
16
+ push(data: Uint8Array, ctx: TransmuxContext): TransmuxResult;
17
+ private pushPacked;
18
+ private output;
19
+ private videoSamples;
20
+ private audioSamples;
21
+ }
22
+ export declare function createTsTransmuxer(): SegmentTransmuxer;