@vkontakte/videoplayer-shared 1.0.83-dev.b2d1f4f2.0 → 1.0.83-dev.b507ef65.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/es2015.cjs +6 -0
- package/es2015.esm.js +6 -0
- package/es2018.cjs +3 -3
- package/es2018.esm.js +3 -3
- package/es2024.cjs +3 -3
- package/es2024.esm.js +3 -3
- package/esnext.cjs +3 -3
- package/esnext.esm.js +3 -3
- package/evergreen.esm.js +3 -3
- package/package.json +1 -1
- package/types/AppTracer/AppTracer.d.ts +23 -23
- package/types/AppTracer/index.d.ts +2 -2
- package/types/AppTracer/types.d.ts +14 -14
- package/types/AppTracer/utils.d.ts +2 -2
- package/types/InternalsExposure/index.d.ts +18 -18
- package/types/Logger/Logger.d.ts +8 -8
- package/types/Logger/index.d.ts +2 -2
- package/types/Logger/types.d.ts +22 -21
- package/types/Tracer/FakeTracer.d.ts +11 -11
- package/types/Tracer/RootTracer.d.ts +8 -8
- package/types/Tracer/Tracer.d.ts +22 -23
- package/types/Tracer/TracerFactory.d.ts +2 -2
- package/types/Tracer/index.d.ts +3 -3
- package/types/Tracer/types.d.ts +24 -24
- package/types/Tracer/utils.d.ts +2 -2
- package/types/devNull.d.ts +4 -4
- package/types/index.d.ts +11 -11
- package/types/reactive/Observable.d.ts +12 -12
- package/types/reactive/ReplaySubject.d.ts +9 -10
- package/types/reactive/Subject.d.ts +8 -8
- package/types/reactive/Subscription.d.ts +4 -4
- package/types/reactive/SubscriptionRemovable.d.ts +3 -3
- package/types/reactive/ValueSubject.d.ts +8 -8
- package/types/reactive/combine.d.ts +8 -5
- package/types/reactive/fromEvent.d.ts +3 -3
- package/types/reactive/index.d.ts +25 -25
- package/types/reactive/interval.d.ts +2 -2
- package/types/reactive/merge.d.ts +11 -81
- package/types/reactive/observableFrom.d.ts +1 -1
- package/types/reactive/operators/buffer.d.ts +1 -1
- package/types/reactive/operators/debounce.d.ts +6 -7
- package/types/reactive/operators/filter.d.ts +2 -5
- package/types/reactive/operators/filterChanged.d.ts +3 -3
- package/types/reactive/operators/map.d.ts +2 -5
- package/types/reactive/operators/mapTo.d.ts +2 -5
- package/types/reactive/operators/once.d.ts +3 -3
- package/types/reactive/operators/pairwise.d.ts +2 -1
- package/types/reactive/operators/shareReplay.d.ts +1 -1
- package/types/reactive/operators/skip.d.ts +4 -4
- package/types/reactive/operators/tap.d.ts +1 -1
- package/types/reactive/operators/throttle.d.ts +5 -6
- package/types/reactive/timeout.d.ts +2 -2
- package/types/reactive/types.d.ts +18 -36
- package/types/translation/index.d.ts +2 -2
- package/types/translation/loadVKLangPack.d.ts +12 -12
- package/types/translation/types.d.ts +2 -2
- package/types/types/index.d.ts +58 -57
- package/types/utils/abortable.d.ts +1 -4
- package/types/utils/clearVideoElement.d.ts +1 -1
- package/types/utils/config.d.ts +1 -1
- package/types/utils/debounceFn.d.ts +7 -7
- package/types/utils/detectEmbed.d.ts +4 -4
- package/types/utils/exponentialBackoff.d.ts +6 -6
- package/types/utils/flattenObject.d.ts +7 -7
- package/types/utils/getRangeAroundIndex.d.ts +5 -5
- package/types/utils/index.d.ts +29 -34
- package/types/utils/interpolate.d.ts +9 -9
- package/types/utils/isIntersecting.d.ts +3 -3
- package/types/utils/now.d.ts +1 -1
- package/types/utils/observeElementSize.d.ts +3 -3
- package/types/utils/quality/index.d.ts +7 -7
- package/types/utils/quality/types.d.ts +16 -16
- package/types/utils/throttleFn.d.ts +3 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IOperator } from
|
|
1
|
+
import type { IOperator } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Пропускает только события, содержащие значения, отличные от предыдущего
|
|
4
|
-
*/
|
|
3
|
+
* Пропускает только события, содержащие значения, отличные от предыдущего
|
|
4
|
+
*/
|
|
5
5
|
export default function filterChanged<T>(equal?: (prev: T, next: T) => boolean): IOperator<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IOperator } from
|
|
1
|
+
import type { IOperator } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
* Отписывается от исходного потока после получения первого события.
|
|
4
|
-
*/
|
|
3
|
+
* Отписывается от исходного потока после получения первого события.
|
|
4
|
+
*/
|
|
5
5
|
export default function once<T>(): IOperator<T>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { IOperator } from '../../reactive';
|
|
2
2
|
export default function shareReplay<T>(bufferSize?: number | undefined): IOperator<T>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { IOperator } from
|
|
1
|
+
import type { IOperator } from '../../reactive';
|
|
2
2
|
/**
|
|
3
|
-
* Пропускает первые count событий
|
|
4
|
-
* @param count
|
|
5
|
-
*/
|
|
3
|
+
* Пропускает первые count событий
|
|
4
|
+
* @param count
|
|
5
|
+
*/
|
|
6
6
|
export default function skip<T>(count: number): IOperator<T>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { IOperator } from
|
|
1
|
+
import type { IOperator } from '../types';
|
|
2
2
|
export default function tap<T>(effect: (value: T) => void): IOperator<T>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { IOperator } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
export default function throttle<T>(time: number, config?: ThrottleConfig): IOperator<T>;
|
|
1
|
+
import type { IOperator } from '../types';
|
|
2
|
+
export default function throttle<T>(time: number, config?: {
|
|
3
|
+
leading: boolean;
|
|
4
|
+
trailing: boolean;
|
|
5
|
+
}): IOperator<T>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { IObservable } from
|
|
1
|
+
import { Milliseconds } from '../utils';
|
|
2
|
+
import type { IObservable } from './types';
|
|
3
3
|
declare const _default: (time: Milliseconds) => IObservable<void>;
|
|
4
4
|
export default _default;
|
|
@@ -1,47 +1,29 @@
|
|
|
1
1
|
export type IUnsubscriber = () => void;
|
|
2
2
|
export interface ISubscription {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
unsubscribe: IUnsubscriber;
|
|
4
|
+
add(item: ISubscription | IUnsubscriber): ISubscription;
|
|
5
5
|
}
|
|
6
6
|
export interface IObservable<T> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
pipe<
|
|
14
|
-
T1,
|
|
15
|
-
T2,
|
|
16
|
-
T3
|
|
17
|
-
>(op1: IOperator<T, T1>, op2: IOperator<T1, T2>, op3: IOperator<T2, T3>): IObservable<T3>;
|
|
18
|
-
pipe<
|
|
19
|
-
T1,
|
|
20
|
-
T2,
|
|
21
|
-
T3,
|
|
22
|
-
T4
|
|
23
|
-
>(op1: IOperator<T, T1>, op2: IOperator<T1, T2>, op3: IOperator<T2, T3>, op4: IOperator<T3, T4>): IObservable<T4>;
|
|
24
|
-
pipe<
|
|
25
|
-
T1,
|
|
26
|
-
T2,
|
|
27
|
-
T3,
|
|
28
|
-
T4,
|
|
29
|
-
T5
|
|
30
|
-
>(op1: IOperator<T, T1>, op2: IOperator<T1, T2>, op3: IOperator<T2, T3>, op4: IOperator<T3, T4>, op5: IOperator<T4, T5>): IObservable<T5>;
|
|
7
|
+
subscribe(listener: IListener<T>, error?: IListener<Error | unknown>): ISubscription;
|
|
8
|
+
pipe<T1>(op1: IOperator<T, T1>): IObservable<T1>;
|
|
9
|
+
pipe<T1, T2>(op1: IOperator<T, T1>, op2: IOperator<T1, T2>): IObservable<T2>;
|
|
10
|
+
pipe<T1, T2, T3>(op1: IOperator<T, T1>, op2: IOperator<T1, T2>, op3: IOperator<T2, T3>): IObservable<T3>;
|
|
11
|
+
pipe<T1, T2, T3, T4>(op1: IOperator<T, T1>, op2: IOperator<T1, T2>, op3: IOperator<T2, T3>, op4: IOperator<T3, T4>): IObservable<T4>;
|
|
12
|
+
pipe<T1, T2, T3, T4, T5>(op1: IOperator<T, T1>, op2: IOperator<T1, T2>, op3: IOperator<T2, T3>, op4: IOperator<T3, T4>, op5: IOperator<T4, T5>): IObservable<T5>;
|
|
31
13
|
}
|
|
32
14
|
export interface IValue<T> {
|
|
33
|
-
|
|
15
|
+
getValue(): T;
|
|
34
16
|
}
|
|
35
17
|
export interface IEmitter<T> {
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
next(value: T): void;
|
|
19
|
+
error?(value: Error | unknown): void;
|
|
20
|
+
}
|
|
21
|
+
export interface IValueObservable<T> extends IObservable<T>, IValue<T> {
|
|
22
|
+
}
|
|
23
|
+
export interface ISubject<T> extends IEmitter<T>, IObservable<T> {
|
|
24
|
+
}
|
|
25
|
+
export interface IValueSubject<T> extends IEmitter<T>, IObservable<T>, IValue<T> {
|
|
38
26
|
}
|
|
39
|
-
export interface IValueObservable<T> extends IObservable<T>, IValue<T> {}
|
|
40
|
-
export interface ISubject<T> extends IEmitter<T>, IObservable<T> {}
|
|
41
|
-
export interface IValueSubject<T> extends IEmitter<T>, IObservable<T>, IValue<T> {}
|
|
42
27
|
export type IListener<T> = IEmitter<T> | ((value: T) => void) | ((value: T) => Promise<void>);
|
|
43
|
-
export type IOperator<
|
|
44
|
-
TInput,
|
|
45
|
-
TOutput = TInput
|
|
46
|
-
> = (input: IObservable<TInput>) => IObservable<TOutput>;
|
|
28
|
+
export type IOperator<TInput, TOutput = TInput> = (input: IObservable<TInput>) => IObservable<TOutput>;
|
|
47
29
|
export type TypeOfObservable<TObservable> = TObservable extends IObservable<infer TType> ? TType : never;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from './loadVKLangPack';
|
|
2
|
+
export * from './types';
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import type { StringRecord } from
|
|
1
|
+
import type { StringRecord } from './types';
|
|
2
2
|
export declare enum VKNumericLanguage {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
Armenian = "58",
|
|
4
|
+
Azerbaijani = "57",
|
|
5
|
+
Belarusian = "114",
|
|
6
|
+
English = "3",
|
|
7
|
+
Kazakh = "97",
|
|
8
|
+
Portuguese = "73",
|
|
9
|
+
Russian = "0",
|
|
10
|
+
Spanish = "4",
|
|
11
|
+
Ukrainian = "1",
|
|
12
|
+
Uzbek = "65",
|
|
13
|
+
Vietnamese = "75"
|
|
14
14
|
}
|
|
15
15
|
export type VKLanguage = VKNumericLanguage | string;
|
|
16
16
|
export declare const loadVKLangPack: <T extends StringRecord>(language: VKLanguage, packName: string, packPrefix: string) => Promise<T>;
|
package/types/types/index.d.ts
CHANGED
|
@@ -1,71 +1,72 @@
|
|
|
1
1
|
export type SafeAny = any;
|
|
2
2
|
export interface IError {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Код или другой идентификатор для статистики
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
category: ErrorCategory;
|
|
8
|
+
/**
|
|
9
|
+
* Сообщение по которому можно разобрать что случилось
|
|
10
|
+
*/
|
|
11
|
+
message: string;
|
|
12
|
+
/**
|
|
13
|
+
* Данные, полезные для отладки
|
|
14
|
+
*/
|
|
15
|
+
data?: any;
|
|
16
|
+
/**
|
|
17
|
+
* Возникшее исключение
|
|
18
|
+
*/
|
|
19
|
+
thrown?: Error | unknown;
|
|
20
|
+
/**
|
|
21
|
+
* Отправлять в трейс не как error а как log
|
|
22
|
+
*/
|
|
23
|
+
traceAsLog?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* HTTP-code ошибки
|
|
26
|
+
*/
|
|
27
|
+
httpCode?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Код ошибки, который вернул backend Единого Видео
|
|
30
|
+
*/
|
|
31
|
+
UVBackendErrorCode?: string;
|
|
32
32
|
}
|
|
33
33
|
export interface IWarning {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Код или другой идентификатор для статистики
|
|
36
|
+
*/
|
|
37
|
+
id: string;
|
|
38
|
+
/**
|
|
39
|
+
* Сообщение по которому можно разобрать что случилось
|
|
40
|
+
*/
|
|
41
|
+
message: string;
|
|
42
|
+
/**
|
|
43
|
+
* Данные, полезные для отладки
|
|
44
|
+
*/
|
|
45
|
+
data?: any;
|
|
46
46
|
}
|
|
47
47
|
export declare enum ErrorCategory {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
NETWORK = "network",
|
|
49
|
+
VIDEO_PIPELINE = "video_pipeline",
|
|
50
|
+
EXTERNAL_API = "external_api",
|
|
51
|
+
PARSER = "parser",
|
|
52
|
+
DOM = "dom",
|
|
53
|
+
WTF = "wtf",
|
|
54
|
+
FATAL = "fatal"
|
|
55
55
|
}
|
|
56
56
|
export interface IRange<Unit extends number = number> {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
from: Unit;
|
|
58
|
+
to: Unit;
|
|
59
59
|
}
|
|
60
60
|
export interface IRectangle<Unit extends number = number> {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
width: Unit;
|
|
62
|
+
height: Unit;
|
|
63
63
|
}
|
|
64
|
-
export type RecursivePartial<T> = {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
export type RecursivePartial<T> = {
|
|
65
|
+
[P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object | undefined ? RecursivePartial<T[P]> : T[P];
|
|
66
|
+
};
|
|
67
|
+
export type WithRequired<T, K extends keyof T> = T & {
|
|
68
|
+
[P in K]-?: T[P];
|
|
69
|
+
};
|
|
69
70
|
export type Constructor<T> = new () => T;
|
|
70
71
|
export type AbstractConstructor<T> = abstract new () => T;
|
|
71
72
|
export type AnyConstructor<T> = Constructor<T> | AbstractConstructor<T>;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
type AbortableDecorator = <
|
|
2
|
-
Params extends unknown[] = void[],
|
|
3
|
-
Return = void
|
|
4
|
-
>(signal: AbortSignal, createGenerator: (...param: Params) => AsyncGenerator<unknown, Return, unknown>) => (...param: Params) => Promise<Return | undefined>;
|
|
1
|
+
type AbortableDecorator = <Params extends unknown[] = void[], Return = void>(signal: AbortSignal, createGenerator: (...param: Params) => AsyncGenerator<unknown, Return, unknown>) => (...param: Params) => Promise<Return | undefined>;
|
|
5
2
|
export declare const abortable: AbortableDecorator;
|
|
6
3
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const clearVideoElement: (video: HTMLVideoElement) => void;
|
|
1
|
+
export declare const clearVideoElement: (video: HTMLVideoElement, clearVideoElementInnerHTML?: boolean) => void;
|
package/types/utils/config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { RecursivePartial } from '../types';
|
|
2
2
|
export declare const fillWithDefault: <Config extends object>(partial: RecursivePartial<Config>, defaultConfig: Config) => Config;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
interface DebounceSettings {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
leading?: boolean;
|
|
3
|
+
maxWait?: number;
|
|
4
|
+
trailing?: boolean;
|
|
5
5
|
}
|
|
6
6
|
export interface DebouncedFn<T extends (...args: any[]) => any> {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
(...args: Parameters<T>): ReturnType<T> | undefined;
|
|
8
|
+
cancel(): void;
|
|
9
|
+
flush(): ReturnType<T> | undefined;
|
|
10
|
+
pending(): boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare function debounceFn<T extends (...args: any) => any>(func: T, wait?: number, options?: DebounceSettings): DebouncedFn<T>;
|
|
13
13
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
interface Result {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
isEmbed: boolean;
|
|
3
|
+
origins: string[];
|
|
4
|
+
topOrigin?: string;
|
|
5
|
+
immediateOrigin?: string;
|
|
6
6
|
}
|
|
7
7
|
export declare const detectEmbed: () => Result;
|
|
8
8
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Milliseconds } from './semanticTypes';
|
|
2
2
|
export type ExponentialBackoffConfig = Partial<{
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
start: Milliseconds;
|
|
4
|
+
factor: number;
|
|
5
|
+
min: Milliseconds;
|
|
6
|
+
max: Milliseconds;
|
|
7
|
+
random: number;
|
|
8
8
|
}>;
|
|
9
9
|
export declare const getExponentialDelay: (errorsCount: number, { start, factor, max, min, random }?: ExponentialBackoffConfig) => Milliseconds;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Функция, которая "сплющивает" вложенный объект. Делает так, чтобы все проперти в объекте были примитивами и
|
|
3
|
-
* не содержали вложенных объектов
|
|
4
|
-
* @param obj - исходный объект
|
|
5
|
-
* @param maxDeep - максимальная глубина рекурсивного обхода
|
|
6
|
-
* @param separator - символ разделитель. По умолчанию точка '.'
|
|
7
|
-
* @return - новый сплющенный объект, который не содержит больше вложенных объектов
|
|
8
|
-
*/
|
|
2
|
+
* Функция, которая "сплющивает" вложенный объект. Делает так, чтобы все проперти в объекте были примитивами и
|
|
3
|
+
* не содержали вложенных объектов
|
|
4
|
+
* @param obj - исходный объект
|
|
5
|
+
* @param maxDeep - максимальная глубина рекурсивного обхода
|
|
6
|
+
* @param separator - символ разделитель. По умолчанию точка '.'
|
|
7
|
+
* @return - новый сплющенный объект, который не содержит больше вложенных объектов
|
|
8
|
+
*/
|
|
9
9
|
export declare const flattenObject: (obj: Record<string, any> | undefined, maxDeep?: number, separator?: string) => Record<string, any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Возвращает диапозон индексов вокруг определнного индекса.
|
|
3
|
-
* @param totalItems Размер массива.
|
|
4
|
-
* @param currentIndex Индекс вокруг которого нужно собрать массив.
|
|
5
|
-
* @param max Максимальный размер индекса.
|
|
6
|
-
*/
|
|
2
|
+
* Возвращает диапозон индексов вокруг определнного индекса.
|
|
3
|
+
* @param totalItems Размер массива.
|
|
4
|
+
* @param currentIndex Индекс вокруг которого нужно собрать массив.
|
|
5
|
+
* @param max Максимальный размер индекса.
|
|
6
|
+
*/
|
|
7
7
|
export declare function getRangeAroundIndex(totalItems: number, currentIndex: number, max: number): number[];
|
package/types/utils/index.d.ts
CHANGED
|
@@ -1,34 +1,29 @@
|
|
|
1
|
-
export { noop } from
|
|
2
|
-
export { assertNever, checkNever } from
|
|
3
|
-
export { isNonNullable, isNullable, assertNonNullable, assertNullable, withoutNullable } from
|
|
4
|
-
export
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export {
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export {
|
|
17
|
-
export
|
|
18
|
-
export
|
|
19
|
-
export {
|
|
20
|
-
export
|
|
21
|
-
export {
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export * from
|
|
29
|
-
export {
|
|
30
|
-
export { getPlayerId } from "./getPlayerId";
|
|
31
|
-
export { interpolate } from "./interpolate";
|
|
32
|
-
export { getRangeAroundIndex } from "./getRangeAroundIndex";
|
|
33
|
-
export * from "./browser";
|
|
34
|
-
export { suppressAbort, isAbortError } from "./suppressAbort";
|
|
1
|
+
export { noop } from './noop';
|
|
2
|
+
export { assertNever, checkNever } from './never';
|
|
3
|
+
export { isNonNullable, isNullable, assertNonNullable, assertNullable, Nullable, withoutNullable } from './nullable';
|
|
4
|
+
export { assertNotEmptyArray, assertEmptyArray } from './empty';
|
|
5
|
+
export { addScript } from './addScript';
|
|
6
|
+
export type { Milliseconds, bps, Byte, Seconds, Kbps, Mbps, Percentage } from './semanticTypes';
|
|
7
|
+
export { now } from './now';
|
|
8
|
+
export { abortable } from './abortable';
|
|
9
|
+
export { getExponentialDelay, ExponentialBackoffConfig } from './exponentialBackoff';
|
|
10
|
+
export * as safeStorage from './iframeSafeStorage';
|
|
11
|
+
export { detectEmbed } from './detectEmbed';
|
|
12
|
+
export { VideoQuality, type ExactVideoQuality, QualityLimits } from './quality/types';
|
|
13
|
+
export { isHigher, isHigherOrEqual, isLower, isLowerOrEqual, getHighestQuality, videoHeightToQuality, videoSizeToQuality, videoQualityToHeight, isInvariantQuality, areQualitiesExact, assertQualityIsExact, getVideoQualityLabel, } from './quality';
|
|
14
|
+
export * from './config';
|
|
15
|
+
export * from './timecode';
|
|
16
|
+
export { debounceFn, DebouncedFn } from './debounceFn';
|
|
17
|
+
export { throttleFn, ThrottleOptions } from './throttleFn';
|
|
18
|
+
export { cloneDeep } from './cloneDeep';
|
|
19
|
+
export { observeElementSize } from './observeElementSize';
|
|
20
|
+
export { cloneDeepWith } from './cloneDeepWith';
|
|
21
|
+
export { flattenObject } from './flattenObject';
|
|
22
|
+
export { clearVideoElement } from './clearVideoElement';
|
|
23
|
+
export * from './isValidURL';
|
|
24
|
+
export { isIntersecting } from './isIntersecting';
|
|
25
|
+
export { getPlayerId } from './getPlayerId';
|
|
26
|
+
export { interpolate } from './interpolate';
|
|
27
|
+
export { getRangeAroundIndex } from './getRangeAroundIndex';
|
|
28
|
+
export * from './browser';
|
|
29
|
+
export { suppressAbort, isAbortError } from './suppressAbort';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* clamp - значение не выходит за outputRange, прибиваем его к краям диапозона.
|
|
3
|
-
*/
|
|
4
|
-
export type Extrapolate =
|
|
2
|
+
* clamp - значение не выходит за outputRange, прибиваем его к краям диапозона.
|
|
3
|
+
*/
|
|
4
|
+
export type Extrapolate = 'clamp';
|
|
5
5
|
/**
|
|
6
|
-
* Линейно интерполирует значение из inputRange в outputRange.
|
|
7
|
-
* @param value - Входное значение (например, прогресс анимации)
|
|
8
|
-
* @param inputRange - Диапазон входных значений (должен быть отсортирован)
|
|
9
|
-
* @param outputRange - Диапазон выходных значений
|
|
10
|
-
* @returns - Интерполированное значение
|
|
11
|
-
*/
|
|
6
|
+
* Линейно интерполирует значение из inputRange в outputRange.
|
|
7
|
+
* @param value - Входное значение (например, прогресс анимации)
|
|
8
|
+
* @param inputRange - Диапазон входных значений (должен быть отсортирован)
|
|
9
|
+
* @param outputRange - Диапазон выходных значений
|
|
10
|
+
* @returns - Интерполированное значение
|
|
11
|
+
*/
|
|
12
12
|
export declare function interpolate(value: number, inputRange: [number, number], outputRange: [number, number]): number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
type Rect = Pick<DOMRect,
|
|
1
|
+
type Rect = Pick<DOMRect, 'top' | 'bottom' | 'left' | 'right'>;
|
|
2
2
|
/**
|
|
3
|
-
* Проверяет пересекаются ли прямоугольники.
|
|
4
|
-
*/
|
|
3
|
+
* Проверяет пересекаются ли прямоугольники.
|
|
4
|
+
*/
|
|
5
5
|
export declare const isIntersecting: (rect1: Rect, rect2: Rect) => boolean;
|
|
6
6
|
export {};
|
package/types/utils/now.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Milliseconds } from
|
|
1
|
+
import type { Milliseconds } from './semanticTypes';
|
|
2
2
|
export declare const now: () => Milliseconds;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IObservable } from
|
|
2
|
-
import type { IRectangle } from
|
|
3
|
-
import type { Milliseconds } from
|
|
1
|
+
import type { IObservable } from '../reactive';
|
|
2
|
+
import type { IRectangle } from '../types';
|
|
3
|
+
import type { Milliseconds } from './semanticTypes';
|
|
4
4
|
export declare const observeElementSize: (element: Element, throttleTime?: Milliseconds) => IObservable<IRectangle>;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { type ExactVideoQuality, VideoQuality } from
|
|
1
|
+
import { IRectangle } from '../../types';
|
|
2
|
+
import { type ExactVideoQuality, VideoQuality } from './types';
|
|
3
3
|
export declare const isHigher: (a: ExactVideoQuality, b: ExactVideoQuality) => boolean;
|
|
4
4
|
export declare const isHigherOrEqual: (a: ExactVideoQuality, b: ExactVideoQuality) => boolean;
|
|
5
5
|
export declare const isLower: (a: ExactVideoQuality, b: ExactVideoQuality) => boolean;
|
|
6
6
|
export declare const isLowerOrEqual: (a: ExactVideoQuality, b: ExactVideoQuality) => boolean;
|
|
7
7
|
export declare const getHighestQuality: (qualities: VideoQuality[]) => VideoQuality | undefined;
|
|
8
8
|
/**
|
|
9
|
-
* Выбирает качество, наиболее близкое к указанной высоте кадра, но не менее её.
|
|
10
|
-
* @param tolerance позволяет выбрать качество менее заданной высоты на величину погрешности (в процентах)
|
|
11
|
-
*/
|
|
9
|
+
* Выбирает качество, наиболее близкое к указанной высоте кадра, но не менее её.
|
|
10
|
+
* @param tolerance позволяет выбрать качество менее заданной высоты на величину погрешности (в процентах)
|
|
11
|
+
*/
|
|
12
12
|
export declare const videoHeightToQuality: (height: number, tolerance?: number) => ExactVideoQuality | undefined;
|
|
13
13
|
/**
|
|
14
|
-
* Выбирает качество описывающее заданные размеры видео потока, т.е. не меньше его.
|
|
15
|
-
*/
|
|
14
|
+
* Выбирает качество описывающее заданные размеры видео потока, т.е. не меньше его.
|
|
15
|
+
*/
|
|
16
16
|
export declare const videoSizeToQuality: ({ width, height }: IRectangle) => ExactVideoQuality | undefined;
|
|
17
17
|
export declare const videoQualityToHeight: (quality: ExactVideoQuality) => number;
|
|
18
18
|
export declare const isInvariantQuality: (quality: VideoQuality) => quality is VideoQuality.INVARIANT;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export declare enum VideoQuality {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
INVARIANT = "Invariant quality",
|
|
3
|
+
Q_144P = "144p",
|
|
4
|
+
Q_240P = "240p",
|
|
5
|
+
Q_360P = "360p",
|
|
6
|
+
Q_480P = "480p",
|
|
7
|
+
Q_576P = "576p",// В ЕВ такого нет, нужно для старой инфры Дзена
|
|
8
|
+
Q_720P = "720p",
|
|
9
|
+
Q_1080P = "1080p",
|
|
10
|
+
Q_1440P = "1440p",
|
|
11
|
+
Q_2160P = "2160p",
|
|
12
|
+
Q_4320P = "4320p"
|
|
13
13
|
}
|
|
14
14
|
export type ExactVideoQuality = Exclude<VideoQuality, VideoQuality.INVARIANT>;
|
|
15
15
|
/**
|
|
16
|
-
* Лимиты трактуются включительно
|
|
17
|
-
* Значение undefined снимает лимит
|
|
18
|
-
*/
|
|
16
|
+
* Лимиты трактуются включительно
|
|
17
|
+
* Значение undefined снимает лимит
|
|
18
|
+
*/
|
|
19
19
|
export type QualityLimits = {
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
max?: ExactVideoQuality;
|
|
21
|
+
min?: ExactVideoQuality;
|
|
22
22
|
};
|