@aics/vole-app 3.4.4 → 3.5.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.
Files changed (55) hide show
  1. package/es/aics-image-viewer/components/App/index.js +5 -5
  2. package/es/aics-image-viewer/components/ColorPicker/index.js +9 -1
  3. package/es/aics-image-viewer/components/ControlPanel/CopySettingsButton.js +415 -0
  4. package/es/aics-image-viewer/components/ControlPanel/index.js +12 -4
  5. package/es/aics-image-viewer/components/ControlPanel/styles.css +29 -2
  6. package/es/aics-image-viewer/components/StyleProvider/index.js +17 -2
  7. package/es/aics-image-viewer/components/Toolbar/ViewModeRadioButtons.js +1 -1
  8. package/es/aics-image-viewer/components/Toolbar/index.js +1 -1
  9. package/es/aics-image-viewer/components/{CellViewerCanvasWrapper → ViewerCanvasWrapper}/index.js +1 -1
  10. package/es/aics-image-viewer/components/dimension_sliders/RotationSliders.js +1 -1
  11. package/es/aics-image-viewer/components/shared/ContextualAlert.js +101 -0
  12. package/es/aics-image-viewer/components/useVolume.js +1 -1
  13. package/es/aics-image-viewer/shared/constants.js +1 -1
  14. package/es/aics-image-viewer/shared/types.js +1 -1
  15. package/es/aics-image-viewer/shared/utils/controlPointsToLut.js +4 -0
  16. package/es/aics-image-viewer/shared/utils/parseSnapshot.js +179 -0
  17. package/es/aics-image-viewer/shared/utils/{urlParsing.js → parseUrl.js} +14 -52
  18. package/es/aics-image-viewer/shared/utils/permissions.js +46 -0
  19. package/es/aics-image-viewer/shared/utils/test/camera.test.js +0 -1
  20. package/es/aics-image-viewer/shared/utils/test/{urlParsing.test.js → parseUrl.test.js} +8 -5
  21. package/es/aics-image-viewer/state/deserialize.js +443 -331
  22. package/es/aics-image-viewer/state/reset.js +1 -1
  23. package/es/aics-image-viewer/state/serialize.js +168 -78
  24. package/es/aics-image-viewer/state/subscribers.js +1 -1
  25. package/es/aics-image-viewer/state/test/deserialize.test.js +62 -76
  26. package/es/aics-image-viewer/state/test/reset.test.js +1 -1
  27. package/es/aics-image-viewer/state/test/serialize.test.js +41 -43
  28. package/es/aics-image-viewer/state/test/test_data.js +119 -1
  29. package/es/aics-image-viewer/state/types.js +157 -245
  30. package/es/aics-image-viewer/state/util.js +39 -1
  31. package/es/index.js +4 -2
  32. package/package.json +1 -1
  33. package/type-declarations/aics-image-viewer/components/App/types.d.ts +3 -3
  34. package/type-declarations/aics-image-viewer/components/ControlPanel/CopySettingsButton.d.ts +9 -0
  35. package/type-declarations/aics-image-viewer/components/Toolbar/ViewModeRadioButtons.d.ts +1 -1
  36. package/type-declarations/aics-image-viewer/components/{CellViewerCanvasWrapper → ViewerCanvasWrapper}/index.d.ts +3 -3
  37. package/type-declarations/aics-image-viewer/components/dimension_sliders/AxisClipSliders.d.ts +6 -6
  38. package/type-declarations/aics-image-viewer/components/shared/ContextualAlert.d.ts +29 -0
  39. package/type-declarations/aics-image-viewer/shared/constants.d.ts +1 -2
  40. package/type-declarations/aics-image-viewer/shared/types.d.ts +2 -2
  41. package/type-declarations/aics-image-viewer/shared/utils/controlPointsToLut.d.ts +1 -1
  42. package/type-declarations/aics-image-viewer/shared/utils/parseSnapshot.d.ts +47 -0
  43. package/type-declarations/aics-image-viewer/shared/utils/{urlParsing.d.ts → parseUrl.d.ts} +2 -16
  44. package/type-declarations/aics-image-viewer/shared/utils/permissions.d.ts +7 -0
  45. package/type-declarations/aics-image-viewer/shared/utils/viewerChannelSettings.d.ts +1 -1
  46. package/type-declarations/aics-image-viewer/state/deserialize.d.ts +70 -35
  47. package/type-declarations/aics-image-viewer/state/reset.d.ts +1 -1
  48. package/type-declarations/aics-image-viewer/state/serialize.d.ts +44 -10
  49. package/type-declarations/aics-image-viewer/state/types.d.ts +265 -159
  50. package/type-declarations/aics-image-viewer/state/util.d.ts +3 -1
  51. package/type-declarations/index.d.ts +5 -3
  52. package/es/aics-image-viewer/shared/enums.js +0 -18
  53. package/type-declarations/aics-image-viewer/shared/enums.d.ts +0 -15
  54. package/type-declarations/aics-image-viewer/shared/utils/math.d.ts +0 -1
  55. /package/es/aics-image-viewer/components/{CellViewerCanvasWrapper → ViewerCanvasWrapper}/styles.css +0 -0
@@ -35,7 +35,7 @@ export declare function getDefaultLut(histogram: Histogram): Lut;
35
35
  * "autoij:0" // use Auto-IJ to calculate min and max.
36
36
  * ```
37
37
  */
38
- export declare function parseLutSetting(histogram: Histogram, lutSetting: [string, string] | undefined): Lut | undefined;
38
+ export declare function parseLutSetting(histogram: Histogram, lutSetting: [string | number, string | number] | undefined): Lut | undefined;
39
39
  /**
40
40
  * Initializes the lookup table (LUT) that maps from volume intensity values to color + opacity and applies the LUT to the volume.
41
41
  *
@@ -0,0 +1,47 @@
1
+ import type { MultisceneUrls } from "../../components/App/types";
2
+ import type { ChannelState, ChannelStateSnapshot, ViewerStateSnapshot } from "../../state/types";
3
+ import type { MetadataRecord } from "../types";
4
+ import type { ViewerChannelSettings } from "./viewerChannelSettings";
5
+ /**
6
+ * A message sent from an external application after this app was opened,
7
+ * containing data that was too large to pack into the URL.
8
+ */
9
+ export type ViewerMessage = {
10
+ /** A (possibly very long) list of scene URLs. */
11
+ scenes?: (string | string[])[];
12
+ /** A (likely very large) list of metadata records for each scene. */
13
+ meta?: Record<string, MetadataRecord>;
14
+ /** The scene to open once this message arrives. */
15
+ sceneIndex?: number;
16
+ };
17
+ /** A snapshot of app state, containing (optional) global and per-channel settings. */
18
+ export type StoreSnapshot = ViewerStateSnapshot & {
19
+ version: string;
20
+ channels: Record<string, ChannelStateSnapshot>;
21
+ };
22
+ /**
23
+ * A complete description of a viewer session, containing image URLs, global
24
+ * and per-channel settings, and optional image metadata.
25
+ */
26
+ export type SessionSnapshot = StoreSnapshot & ViewerMessage & Required<Pick<ViewerMessage, "scenes">>;
27
+ /** Verifies that the given object is (likely) a `StoreSnapshot`. */
28
+ export declare const isStoreSnapshot: (settings: unknown) => settings is StoreSnapshot;
29
+ /** Verifies that the given object is (likely) a `SessionSnapshot`. */
30
+ export declare const isSessionSnapshot: (settings: unknown) => settings is SessionSnapshot;
31
+ /** Converts an array of `ChannelState`s to a compact JSON representation that can be stringified into the clipboard. */
32
+ export declare const channelStatesToSnapshot: (channelStates: ChannelState[], excludeKeys?: (keyof ChannelState)[]) => StoreSnapshot;
33
+ /** Converts a compacted set of `ChannelState`s from the clipboard into a record of channel names and their states. */
34
+ export declare const snapshotToChannelStates: (serialized: StoreSnapshot) => Record<string, Partial<ChannelState>>;
35
+ export declare const snapshotToViewerChannelSettings: (serialized: StoreSnapshot) => ViewerChannelSettings | undefined;
36
+ /**
37
+ * Parses a `ViewerMessage` into the relevant entries in `AppProps`.
38
+ *
39
+ * Optionally accepts the current value of the `imageUrl` prop, for the case where the message contains only metadata
40
+ * and the image URLs that correspond to the metadata were passed in by other means.
41
+ */
42
+ export declare function viewerMessageToParams(message: ViewerMessage, propUrl?: string | MultisceneUrls): {
43
+ imageUrl?: string | MultisceneUrls;
44
+ metadata?: (MetadataRecord | undefined)[];
45
+ };
46
+ /** Formats the values of the `imageUrl` and `metadata` props to `App` as a `ViewerMessage`. */
47
+ export declare function paramsToViewerMessage(imageUrl: string | MultisceneUrls, metadata?: (MetadataRecord | undefined)[]): ViewerMessage;
@@ -1,7 +1,7 @@
1
1
  import type { FirebaseFirestore } from "@firebase/firestore-types";
2
2
  import type { AppProps } from "../../components/App/types";
3
3
  import type { ViewerStore } from "../../state/store";
4
- import { type ViewerState, ViewerStateParams } from "../../state/types";
4
+ import type { ViewerState, ViewerStateStringified } from "../../state/types";
5
5
  import type { MetadataRecord } from "../types";
6
6
  /**
7
7
  * Channels, matching the pattern `c0`, `c1`, etc. corresponding to the index of the channel being configured.
@@ -60,19 +60,7 @@ declare class DeprecatedParams {
60
60
  /** Deprecated query parameter for channel colors. */
61
61
  colors?: string;
62
62
  }
63
- type AppParams = Partial<ViewerStateParams & DataParams & DeprecatedParams & ChannelParams>;
64
- /**
65
- * A message sent from an external application after this app was opened,
66
- * containing data that was too large to pack into the URL.
67
- */
68
- type ViewerMessage = {
69
- /** A (possibly very long) list of scene URLs. */
70
- scenes?: string[];
71
- /** A (likely very large) list of metadata records for each scene. */
72
- meta?: Record<string, MetadataRecord>;
73
- /** The scene to open once this message arrives. */
74
- sceneIndex?: number;
75
- };
63
+ type AppParams = Partial<ViewerStateStringified & DataParams & DeprecatedParams & ChannelParams>;
76
64
  /**
77
65
  * Filters a set of URLSearchParams for only the keys that are valid parameters for the viewer.
78
66
  * Non-matching keys are discarded.
@@ -101,8 +89,6 @@ export declare function parseViewerUrlParams(search: string, firestore?: Firebas
101
89
  args: Partial<AppProps>;
102
90
  viewerSettings: Partial<ViewerState>;
103
91
  }>;
104
- /** Adds the data in a newly-arrived `ViewerMessage` to an existing stored `AppProps` instance. */
105
- export declare function addViewerParamsFromMessage<P extends Pick<AppProps, "imageUrl" | "metadata">>(args: P, message: ViewerMessage): P;
106
92
  /**
107
93
  * Serializes the ViewerState and ChannelState of a ViewerStateContext into a URLSearchParams object.
108
94
  * @param state ViewerStateContext to serialize.
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Try to determine whether attempting to access the clipboard will immediately fail.
3
+ *
4
+ * When this function returns `false`, accessing the clipboard *may* be successful, though some browsers require users
5
+ * to confirm every paste. When it returns `true`, access to the clipboard is definitely blocked.
6
+ */
7
+ export declare const queryPasteDenied: () => Promise<boolean>;
@@ -21,7 +21,7 @@ export type IntensitySettings = {
21
21
  * - `autoij` in either the min or max fields will use the "auto" algorithm
22
22
  * from ImageJ to select the min and max.
23
23
  */
24
- lut?: [string, string];
24
+ lut?: [string | number, string | number];
25
25
  };
26
26
  /** Settings for a single channel, as passed in via props by App users */
27
27
  export interface ViewerChannelSetting {
@@ -1,7 +1,7 @@
1
1
  import type { Histogram } from "@aics/vole-core";
2
2
  import type { ColorArray } from "../shared/utils/colorRepresentations";
3
3
  import type { ViewerChannelSetting } from "../shared/utils/viewerChannelSettings";
4
- import { type ChannelState, type ViewerChannelStateParams, type ViewerState, type ViewerStateParams } from "./types";
4
+ import type { CameraStateSnapshot, CameraStateStringified, ChannelState, ChannelStateSnapshot, ChannelStateStringified, ViewerState, ViewerStateSnapshot, ViewerStateStringified } from "./types";
5
5
  /**
6
6
  * LEGACY: Matches a COMMA-separated list of control points, where each control point is represented
7
7
  * by a triplet of `{x}:{opacity}:{hex color}`.
@@ -19,6 +19,22 @@ export declare const LEGACY_CONTROL_POINTS_REGEX: RegExp;
19
19
  * with `1` to represent white (`ffffff`).
20
20
  */
21
21
  export declare const CONTROL_POINTS_REGEX: RegExp;
22
+ export declare const enumParser: <E extends string>(enumValues: Record<string, E>) => ((value: string) => E | undefined);
23
+ /**
24
+ * Converts a `CameraStateStringified` into a `CameraStateSnapshot` by parsing each key from its stringified
25
+ * representation to its type in `CameraStateSnapshot`.
26
+ */
27
+ export declare const destringifyCameraStateSnapshot: (stringified: CameraStateStringified) => CameraStateSnapshot;
28
+ /**
29
+ * Converts a `ViewerStateStringified` into a `ViewerStateSnapshot` by parsing each key from its stringified
30
+ * representation to its type in `ViewerStateSnapshot`.
31
+ */
32
+ export declare const destringifyViewerStateSnapshot: (stringified: ViewerStateStringified) => ViewerStateSnapshot;
33
+ /**
34
+ * Converts a `ChannelStateStringified` into a `ChannelStateSnapshot` by parsing each key from its stringified
35
+ * representation to its type in `ChannelStateSnapshot`.
36
+ */
37
+ export declare const destringifyChannelStateSnapshot: (stringified: ChannelStateStringified) => ChannelStateSnapshot;
22
38
  /**
23
39
  * Parse a string list of comma-separated key:value pairs into
24
40
  * a key-value object.
@@ -30,50 +46,68 @@ export declare const CONTROL_POINTS_REGEX: RegExp;
30
46
  * will be decoded using `decodeURIComponent`.
31
47
  */
32
48
  export declare function parseKeyValueList(data: string): Record<string, string>;
49
+ export declare function parseHexColorAsColorArray(hexColor: unknown): ColorArray | undefined;
50
+ /** Verifies that `value` is a `number`; if it is, clamps it between `min` and `max`. */
51
+ export declare const validateNumber: (value: unknown, min?: number, max?: number) => number | undefined;
52
+ /** Verifies that `value` is a `number`; if it is, truncates it to an integer and clamps it between `min` and `max`. */
53
+ export declare const validateInt: (value: unknown, min?: number, max?: number) => number | undefined;
54
+ type Untrusted<T> = {
55
+ [K in keyof T]?: unknown;
56
+ };
57
+ /** Parses a `ViewerStateSnapshot` to a `ViewerState`. */
58
+ export declare function snapshotToViewerState(snapshot: Untrusted<ViewerStateSnapshot>): Partial<ViewerState>;
33
59
  /**
34
- * Parses a string to a float and clamps the result to the [min, max] range.
35
- * Returns `undefined` if the string is undefined or NaN.
36
- * @param value String to parse as a float. Will be parsed with `Number.parseFloat`.
37
- * @param min Minimum value, inclusive.
38
- * @param max Maximum value, inclusive.
39
- * @returns
40
- * - The parsed number, clamped to the [min, max] range.
41
- * - `undefined` if the string is undefined or NaN.
60
+ * Parses a `ChannelStateSnapshot` to a `ViewerChannelSetting`.
61
+ * @param channelId Either the index or the name of the channel, to be turned into a `match` value.
62
+ * @param jsonState The serialized `ViewerChannelSetting` to parse, as an object.
63
+ * @returns A `ViewerChannelSetting` object.
42
64
  */
43
- export declare function parseStringFloat(value: string | undefined, min: number, max: number): number | undefined;
65
+ export declare function snapshotToViewerChannelSetting(channelId: number | string, jsonState: Untrusted<ChannelStateSnapshot>): ViewerChannelSetting;
44
66
  /**
45
- * Parses a string to an integer and clamps the result to the [min, max] range.
46
- * @param value String to parse as a float. Assumes base 10, parses with `Number.parseInt(value, 10)`.
47
- * @param min Minimum value, inclusive.
48
- * @param max Maximum value, inclusive.
49
- * @returns
50
- * - The parsed number, clamped to the [min, max] range.
51
- * - `undefined` if the string is undefined or NaN.
67
+ * Parses a `ChannelStateSnapshot` object into a partial `ChannelState`.
68
+ *
69
+ * This is used to convert from serialized formats (URL params, JSON) into
70
+ * internal channel state fields, leaving absent or invalid values undefined.
71
+ *
72
+ * This function optionally accepts the target channel's `Histogram`. This
73
+ * argument is required to parse the following params correctly:
74
+ *
75
+ * - `lut`, which contains instructions for how to set the channel's
76
+ * intensities *relative to its intensity distribution*.
77
+ * - `rmp`, the legacy ramp parameter represented as histogram bin indices
78
+ * - `cps`, the legacy control points parameter where `x` values are
79
+ * represented as histogram bin indices
80
+ *
81
+ * If `histogram` is left undefined, e.g. because the channel has not yet been
82
+ * loaded, these params are ignored.
52
83
  */
53
- export declare function parseStringInt(value: string | undefined, min: number, max: number): number | undefined;
84
+ export declare function snapshotToChannelState(jsonState: Untrusted<ChannelStateSnapshot>, histogram?: Histogram): Partial<ChannelState>;
54
85
  /**
55
- * Parses a string to an enum value; if the string is not in the enum, returns the default value.
56
- * @param value String to parse.
57
- * @param enumValues Enum. Cannot be a `const enum`, as these are removed at compile time.
58
- * @param defaultValue Default value to return if the string is not in the enum.
59
- * @returns A value from the enum or the default value. Note that the return type includes `undefined`
60
- * if the `defaultValue` is `undefined`.
86
+ * Parses a stringified viewer state snapshot (`ViewerStateStringified`) to a
87
+ * `ViewerState`.
88
+ *
89
+ * This is equivalent to (and implemented by) calling
90
+ * `destringifyViewerStateSnapshot`, then `snapshotToViewerState`.
61
91
  */
62
- export declare function parseStringEnum<E extends string, T extends E | undefined>(value: string | undefined, enumValues: Record<string | number | symbol, E>, defaultValue?: T): T;
63
- export declare function parseHexColorAsColorArray(hexColor: string | undefined): ColorArray | undefined;
64
- export declare function deserializeViewerState(params: ViewerStateParams): Partial<ViewerState>;
92
+ export declare const stringSnapshotToViewerState: (stringified: ViewerStateStringified) => Partial<ViewerState>;
65
93
  /**
66
- * Parses a ViewerChannelSetting from a JSON object.
94
+ * Parses a stringified channel state snapshot (`ChannelStateStringified`) to a
95
+ * `ViewerChannelSetting`.
96
+ *
97
+ * This is equivalent to (and implemented by) calling
98
+ * `destringifyChannelStateSnapshot`, then `snapshotToViewerChannelSetting`.
99
+ *
67
100
  * @param channelIndex Index of the channel, to be turned into a `match` value.
68
- * @param jsonState The serialized ViewerChannelSetting to parse, as an object.
69
- * @returns A ViewerChannelSetting object.
101
+ * @param jsonState The serialized `ViewerChannelSetting` to parse, as an object.
102
+ * @returns A `ViewerChannelSetting` object.
70
103
  */
71
- export declare function deserializeViewerChannelSetting(channelIndex: number, jsonState: ViewerChannelStateParams): ViewerChannelSetting;
104
+ export declare const stringSnapshotToViewerChannelSetting: (channelIndex: number, jsonState: ChannelStateStringified) => ViewerChannelSetting;
72
105
  /**
73
- * Parses a `ViewerChannelStateParams` object into a partial `ChannelState`.
106
+ * Parses a stringified channel state snapshot (`ChannelStateStringified`)
107
+ * into a partial `ChannelState`.
74
108
  *
75
- * This is used to convert raw URL params into internal channel state fields,
76
- * leaving absent or invalid values undefined.
109
+ * This is equivalent to (and implemented by) calling
110
+ * `destringifyChannelStateSnapshot`, then `snapshotToChannelState`.
77
111
  *
78
112
  * This function optionally accepts the target channel's `Histogram`. This
79
113
  * argument is required to parse the following params correctly:
@@ -87,4 +121,5 @@ export declare function deserializeViewerChannelSetting(channelIndex: number, js
87
121
  * If `histogram` is left undefined, e.g. because the channel has not yet been
88
122
  * loaded, these params are ignored.
89
123
  */
90
- export declare function deserializeChannelState(jsonState: ViewerChannelStateParams, histogram?: Histogram): Partial<ChannelState>;
124
+ export declare const stringSnapshotToChannelState: (jsonState: ChannelStateStringified, histogram?: Histogram) => Partial<ChannelState>;
125
+ export {};
@@ -1,7 +1,7 @@
1
1
  import type { StateCreator } from "zustand";
2
2
  import type { ViewerChannelSettings } from "../shared/utils/viewerChannelSettings";
3
- import type { ViewerState } from "../state/types";
4
3
  import type { ViewerStore } from "./store";
4
+ import { type ViewerState } from "./types";
5
5
  export type ResetStateActions = {
6
6
  /**
7
7
  * Removes the channel from the list of channels to be reset (as given by
@@ -1,20 +1,54 @@
1
1
  import type { CameraState } from "@aics/vole-core";
2
- import { ViewMode } from "../shared/enums";
3
- import type { ChannelState, ViewerChannelStateParams, ViewerState, ViewerStateParams } from "./types";
2
+ import type { CameraStateSnapshot, CameraStateStringified, ChannelState, ChannelStateSnapshot, ChannelStateStringified, ViewerState, ViewerStateSnapshot, ViewerStateStringified } from "./types";
3
+ import { ViewMode } from "./types";
4
+ /**
5
+ * Serializes an object with `string` keys to a compact `string` representation, where keys and values are separated
6
+ * by colons (`:`) and entries are separated by commas (`,`).
7
+ */
4
8
  export declare function objectToKeyValueList(obj: Record<string, string | undefined>): string;
5
- export declare function serializeCameraState(cameraState: Partial<CameraState>, removeDefaults: boolean, viewMode?: ViewMode): string | undefined;
6
9
  /**
7
- * Serializes a single viewer channel setting into a dictionary of URL parameters
8
- * (`ViewerChannelStateParams`).
10
+ * Converts a `CameraState` to a `CameraStateSnapshot`, suitable for serialization.
11
+ * @param cameraState The camera state to serialize.
12
+ * @param removeDefaults Whether to remove default values.
13
+ * @param viewMode The current view mode. Default `ViewMode.threeD`.
14
+ * @returns The resulting `CameraStateSnapshot`, or `undefined` if all values are default.
15
+ */
16
+ export declare function cameraStateToSnapshot(cameraState: Partial<CameraState> | undefined, removeDefaults: boolean, viewMode?: ViewMode): CameraStateSnapshot | undefined;
17
+ /**
18
+ * Converts a `ViewerState` to a `ViewerStateSnapshot`, suitable for serialization.
19
+ */
20
+ export declare function viewerStateToSnapshot(state: Partial<ViewerState>, removeDefaults: boolean): ViewerStateSnapshot;
21
+ export declare function channelStateToSnapshot(state: Partial<ChannelState>, removeDefaults: boolean): ChannelStateSnapshot;
22
+ /**
23
+ * Converts all keys of a `CameraStateSnapshot` to compact `string` representations,
24
+ * for serialization to `string` formats.
25
+ */
26
+ export declare const stringifyCameraStateSnapshot: (snapshot: CameraStateSnapshot) => CameraStateStringified;
27
+ /**
28
+ * Converts all keys of a `ViewerStateSnapshot` to compact `string` representations,
29
+ * for serialization to `string` formats.
30
+ */
31
+ export declare const stringifyViewerStateSnapshot: (snapshot: ViewerStateSnapshot) => ViewerStateStringified;
32
+ /**
33
+ * Converts all keys of a `ChannelStateSnapshot` to compact `string` representations,
34
+ * for serialization to `string` formats.
35
+ */
36
+ export declare const stringifyChannelStateSnapshot: (snapshot: ChannelStateSnapshot) => ChannelStateStringified;
37
+ /**
38
+ * Converts a single viewer channel setting into a `ChannelStateStringified`.
39
+ *
40
+ * This is equivalent to (and implemented by) applying `channelStateToSnapshot`, then `stringifyChannelStateSnapshot`.
9
41
  * @param channelSetting The channel state object to serialize.
10
42
  * @param removeDefaults Whether to remove properties that match the output of `getDefaultChannelState`.
11
- * @returns A `ViewerChannelSettingParams` object with the serialized parameters. Undefined values are removed.
43
+ * @returns A `ChannelStateStringified` object with the serialized parameters. `undefined` values are removed.
12
44
  */
13
- export declare function serializeViewerChannelSetting(channelSetting: Partial<ChannelState>, removeDefaults: boolean): Partial<ViewerChannelStateParams>;
45
+ export declare const channelStateToStringSnapshot: (channelSetting: Partial<ChannelState>, removeDefaults: boolean) => ChannelStateStringified;
14
46
  /**
15
- * Serializes a `ViewerState` object into a dictionary of URL parameters.
47
+ * Serializes a `ViewerState` object into a `ViewerStateStringified`.
48
+ *
49
+ * This is equivalent to (and implemented by) applying `viewerStateToSnapshot`, then `stringifyViewerStateSnapshot`.
16
50
  * @param state The `ViewerState` to serialize.
17
51
  * @param removeDefaults If true, remove properties that match the output of `getDefaultViewerState`.
18
- * @returns A `ViewerStateParams` object with the serialized parameters. Undefined values are removed.
52
+ * @returns A `ViewerStateStringified` object with the serialized parameters. `undefined` values are removed.
19
53
  */
20
- export declare function serializeViewerState(state: Partial<ViewerState>, removeDefaults: boolean): ViewerStateParams;
54
+ export declare const viewerStateToStringSnapshot: (state: Partial<ViewerState>, removeDefaults: boolean) => ViewerStateStringified;