@vertexvis/stream-api 0.24.5-canary.4 → 1.0.0-testing.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.
@@ -1,4 +1,4 @@
1
- export interface ConnectionDescriptor {
2
- url: string;
3
- protocols?: string | string[];
4
- }
1
+ export interface ConnectionDescriptor {
2
+ url: string;
3
+ protocols?: string | string[];
4
+ }
package/dist/encoder.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { vertexvis } from '@vertexvis/frame-streaming-protos';
2
- export declare function encode(message: vertexvis.protobuf.stream.IStreamMessage): Uint8Array;
3
- export declare function decode(bufferOrBytes: ArrayBuffer | Uint8Array): vertexvis.protobuf.stream.IStreamMessage;
1
+ import { vertexvis } from '@vertexvis/frame-streaming-protos';
2
+ export declare function encode(message: vertexvis.protobuf.stream.IStreamMessage): Uint8Array;
3
+ export declare function decode(bufferOrBytes: ArrayBuffer | Uint8Array): vertexvis.protobuf.stream.IStreamMessage;
package/dist/errors.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { vertexvis } from '@vertexvis/frame-streaming-protos';
2
- export declare class StreamRequestError extends Error {
3
- readonly requestId: string;
4
- readonly requestPayload: vertexvis.protobuf.stream.IStreamRequest;
5
- readonly summary: string | null | undefined;
6
- readonly details: string | null | undefined;
7
- constructor(requestId: string, requestPayload: vertexvis.protobuf.stream.IStreamRequest, summary: string | null | undefined, details: string | null | undefined);
8
- }
1
+ import { vertexvis } from '@vertexvis/frame-streaming-protos';
2
+ export declare class StreamRequestError extends Error {
3
+ readonly requestId: string;
4
+ readonly requestPayload: vertexvis.protobuf.stream.IStreamRequest;
5
+ readonly summary: string | null | undefined;
6
+ readonly details: string | null | undefined;
7
+ constructor(requestId: string, requestPayload: vertexvis.protobuf.stream.IStreamRequest, summary: string | null | undefined, details: string | null | undefined);
8
+ }
package/dist/index.d.ts CHANGED
@@ -1,12 +1,13 @@
1
- /**
2
- * @module Stream API
3
- */
4
- export * from './connection';
5
- export * from './encoder';
6
- export * from './errors';
7
- export { AdaptiveRenderingSettings, FrameDeliverySettings, QualityOfServiceSettings, Settings, } from './settings';
8
- export * from './streamApi';
9
- export * from './testing';
10
- export * from './time';
11
- export * from './types';
12
- export * from './webSocketClient';
1
+ /**
2
+ * @module Stream API
3
+ */
4
+ export * from './connection';
5
+ export * from './encoder';
6
+ export * from './errors';
7
+ export type { AdaptiveRenderingSettings, FrameDeliverySettings, QualityOfServiceSettings, Settings, } from './settings';
8
+ export { appendSettingsToUrl } from './settings';
9
+ export * from './streamApi';
10
+ export * from './testing';
11
+ export * from './time';
12
+ export * from './types';
13
+ export * from './webSocketClient';
@@ -1,5 +1,5 @@
1
- export declare type ParamsBuilder<S> = (settings: S) => Record<string, string>;
2
- export declare function defineParams<S>(...definitions: ParamsBuilder<S>[]): ParamsBuilder<S>;
3
- export declare function defineBoolean<S, P extends keyof S = keyof S>(param: string, prop: P): ParamsBuilder<S>;
4
- export declare function defineNumber<S, P extends keyof S = keyof S>(param: string, prop: P): ParamsBuilder<S>;
5
- export declare function defineString<S, P extends keyof S = keyof S>(param: string, prop: P): ParamsBuilder<S>;
1
+ export type ParamsBuilder<S> = (settings: S) => Record<string, string>;
2
+ export declare function defineParams<S>(...definitions: ParamsBuilder<S>[]): ParamsBuilder<S>;
3
+ export declare function defineBoolean<S, P extends keyof S = keyof S>(param: string, prop: P): ParamsBuilder<S>;
4
+ export declare function defineNumber<S, P extends keyof S = keyof S>(param: string, prop: P): ParamsBuilder<S>;
5
+ export declare function defineString<S, P extends keyof S = keyof S>(param: string, prop: P): ParamsBuilder<S>;
@@ -1,106 +1,106 @@
1
- /**
2
- * Settings to configure the delivery of images over the websocket connection.
3
- */
4
- export interface FrameDeliverySettings {
5
- /**
6
- * Indicates if the rate limiting of frame delivery is enabled based on
7
- * detected internet throughput.
8
- */
9
- rateLimitingEnabled?: boolean;
10
- /**
11
- * Enables rate limiting when the variation coefficient of frame latencies
12
- * exceeds this threshold. The variation coefficient is defined by the
13
- * standard deviation of latencies over the average of recorded latencies.
14
- *
15
- * Lower numbers will increase the aggressiveness of packet loss detection,
16
- * but may trigger unexpected delivery rate limiting.
17
- */
18
- packetLossThreshold?: number;
19
- /**
20
- * The maximum number of latencies to record. Higher numbers could result in
21
- * more delay before packet loss is detected. Lower numbers could result in
22
- * packet loss not being detected.
23
- */
24
- historyMaxSize?: number;
25
- /**
26
- * The duration at which point a frame will be considered failed if the server
27
- * has not received an acknowledgement.
28
- */
29
- timeout?: string;
30
- /**
31
- * Enables rate limiting when the number of frames that failed to receive an
32
- * acknowledgement within the timeout window exceeds this ratio.
33
- */
34
- timeoutRatioThreshold?: number;
35
- }
36
- /**
37
- * Settings to configure the adaptive rendering of images. If enabled, the
38
- * performance of delivering images is analyzed, and will be adjusted to deliver
39
- * frames quicker to the client.
40
- */
41
- export interface AdaptiveRenderingSettings {
42
- /**
43
- * Indicates if adaptive rendering is enabled.
44
- */
45
- enabled?: boolean;
46
- /**
47
- * The adaptive rendering algorithm to use. Defaults to `median`.
48
- */
49
- method?: 'median' | 'average' | 'smoothed-median' | 'median-of-smoothed-median' | 'average-of-smoothed-median';
50
- /**
51
- * A number between 1 and 100 representing the minimum JPEG quality for
52
- * rendered frames.
53
- */
54
- jpegMinQuality?: number;
55
- /**
56
- * A number between 1 and 100 representing the maximum JPEG quality for
57
- * rendered frames.
58
- */
59
- jpegMaxQuality?: number;
60
- /**
61
- * A number between 0 and 1 representing the minimum scale factor for rendered
62
- * frames.
63
- */
64
- imageMinScale?: number;
65
- /**
66
- * A number between 0 and 1 representing the maximum scale factor for rendered
67
- * frames.
68
- */
69
- imageMaxScale?: number;
70
- /**
71
- * The window size to use for smoothing based adaptive rendering methods. This
72
- * applies to: `smoothed-median`, `median-of-smoothed-median`,
73
- * `average-of-smoothed-median`. Higher window sizes will result in values
74
- * that are more smoothed, and have less "wave" like behavior to image
75
- * quality. However, higher window sizes will take longer to respond to
76
- * changes in network conditions.
77
- */
78
- windowSize?: number;
79
- }
80
- /**
81
- * Settings to configure the quality of service metrics used by the server.
82
- */
83
- export interface QualityOfServiceSettings {
84
- /**
85
- * Specifies how many timings to track before old timings are purged.
86
- */
87
- historyMaxSize?: number;
88
- }
89
- /**
90
- * Settings to configure the frame stream and its websocket connection.
91
- */
92
- export interface Settings {
93
- /**
94
- * **EXPERIMENTAL.** Settings to configure the delivery of frames.
95
- */
96
- EXPERIMENTAL_frameDelivery?: FrameDeliverySettings;
97
- /**
98
- * **EXPERIMENTAL.** Settings to configure adaptive rendering of frames.
99
- */
100
- EXPERIMENTAL_adaptiveRendering?: AdaptiveRenderingSettings;
101
- /**
102
- * **EXPERIMENTAL.** Settings to configure quality of service.
103
- */
104
- EXPERIMENTAL_qualityOfService?: QualityOfServiceSettings;
105
- }
106
- export declare function appendSettingsToUrl(url: string, settings: Settings): string;
1
+ /**
2
+ * Settings to configure the delivery of images over the websocket connection.
3
+ */
4
+ export interface FrameDeliverySettings {
5
+ /**
6
+ * Indicates if the rate limiting of frame delivery is enabled based on
7
+ * detected internet throughput.
8
+ */
9
+ rateLimitingEnabled?: boolean;
10
+ /**
11
+ * Enables rate limiting when the variation coefficient of frame latencies
12
+ * exceeds this threshold. The variation coefficient is defined by the
13
+ * standard deviation of latencies over the average of recorded latencies.
14
+ *
15
+ * Lower numbers will increase the aggressiveness of packet loss detection,
16
+ * but may trigger unexpected delivery rate limiting.
17
+ */
18
+ packetLossThreshold?: number;
19
+ /**
20
+ * The maximum number of latencies to record. Higher numbers could result in
21
+ * more delay before packet loss is detected. Lower numbers could result in
22
+ * packet loss not being detected.
23
+ */
24
+ historyMaxSize?: number;
25
+ /**
26
+ * The duration at which point a frame will be considered failed if the server
27
+ * has not received an acknowledgement.
28
+ */
29
+ timeout?: string;
30
+ /**
31
+ * Enables rate limiting when the number of frames that failed to receive an
32
+ * acknowledgement within the timeout window exceeds this ratio.
33
+ */
34
+ timeoutRatioThreshold?: number;
35
+ }
36
+ /**
37
+ * Settings to configure the adaptive rendering of images. If enabled, the
38
+ * performance of delivering images is analyzed, and will be adjusted to deliver
39
+ * frames quicker to the client.
40
+ */
41
+ export interface AdaptiveRenderingSettings {
42
+ /**
43
+ * Indicates if adaptive rendering is enabled.
44
+ */
45
+ enabled?: boolean;
46
+ /**
47
+ * The adaptive rendering algorithm to use. Defaults to `median`.
48
+ */
49
+ method?: 'median' | 'average' | 'smoothed-median' | 'median-of-smoothed-median' | 'average-of-smoothed-median';
50
+ /**
51
+ * A number between 1 and 100 representing the minimum JPEG quality for
52
+ * rendered frames.
53
+ */
54
+ jpegMinQuality?: number;
55
+ /**
56
+ * A number between 1 and 100 representing the maximum JPEG quality for
57
+ * rendered frames.
58
+ */
59
+ jpegMaxQuality?: number;
60
+ /**
61
+ * A number between 0 and 1 representing the minimum scale factor for rendered
62
+ * frames.
63
+ */
64
+ imageMinScale?: number;
65
+ /**
66
+ * A number between 0 and 1 representing the maximum scale factor for rendered
67
+ * frames.
68
+ */
69
+ imageMaxScale?: number;
70
+ /**
71
+ * The window size to use for smoothing based adaptive rendering methods. This
72
+ * applies to: `smoothed-median`, `median-of-smoothed-median`,
73
+ * `average-of-smoothed-median`. Higher window sizes will result in values
74
+ * that are more smoothed, and have less "wave" like behavior to image
75
+ * quality. However, higher window sizes will take longer to respond to
76
+ * changes in network conditions.
77
+ */
78
+ windowSize?: number;
79
+ }
80
+ /**
81
+ * Settings to configure the quality of service metrics used by the server.
82
+ */
83
+ export interface QualityOfServiceSettings {
84
+ /**
85
+ * Specifies how many timings to track before old timings are purged.
86
+ */
87
+ historyMaxSize?: number;
88
+ }
89
+ /**
90
+ * Settings to configure the frame stream and its websocket connection.
91
+ */
92
+ export interface Settings {
93
+ /**
94
+ * **EXPERIMENTAL.** Settings to configure the delivery of frames.
95
+ */
96
+ EXPERIMENTAL_frameDelivery?: FrameDeliverySettings;
97
+ /**
98
+ * **EXPERIMENTAL.** Settings to configure adaptive rendering of frames.
99
+ */
100
+ EXPERIMENTAL_adaptiveRendering?: AdaptiveRenderingSettings;
101
+ /**
102
+ * **EXPERIMENTAL.** Settings to configure quality of service.
103
+ */
104
+ EXPERIMENTAL_qualityOfService?: QualityOfServiceSettings;
105
+ }
106
+ export declare function appendSettingsToUrl(url: string, settings: Settings): string;