snack-sdk 3.6.0-rc.1 → 3.8.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 (78) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/build/DependencyResolver.d.ts +26 -25
  3. package/build/DependencyResolver.js +258 -257
  4. package/build/DependencyResolver.js.map +1 -1
  5. package/build/DevSession.d.ts +20 -20
  6. package/build/DevSession.js +203 -203
  7. package/build/FileUploader.d.ts +23 -22
  8. package/build/FileUploader.js +174 -174
  9. package/build/FileUploader.js.map +1 -1
  10. package/build/Logger.d.ts +11 -11
  11. package/build/Logger.js +33 -33
  12. package/build/Session.d.ts +301 -296
  13. package/build/Session.js +1171 -1163
  14. package/build/Session.js.map +1 -1
  15. package/build/State.d.ts +16 -16
  16. package/build/State.js +90 -90
  17. package/build/State.js.map +1 -1
  18. package/build/WantedVersions.d.ts +17 -16
  19. package/build/WantedVersions.js +93 -96
  20. package/build/WantedVersions.js.map +1 -1
  21. package/build/defaultConfig.d.ts +12 -13
  22. package/build/defaultConfig.js +29 -29
  23. package/build/defaultConfig.js.map +1 -1
  24. package/build/index.d.ts +7 -7
  25. package/build/index.js +30 -30
  26. package/build/index.js.map +1 -1
  27. package/build/transports/CodeMessageBuilder.d.ts +31 -31
  28. package/build/transports/CodeMessageBuilder.js +196 -196
  29. package/build/transports/CodeMessageBuilder.js.map +1 -1
  30. package/build/transports/Protocol.d.ts +64 -64
  31. package/build/transports/Protocol.js +2 -2
  32. package/build/transports/Protocol.js.map +1 -1
  33. package/build/transports/Transport.d.ts +27 -27
  34. package/build/transports/Transport.js +298 -298
  35. package/build/transports/index.d.ts +3 -3
  36. package/build/transports/index.js +22 -22
  37. package/build/transports/types.d.ts +63 -63
  38. package/build/transports/types.js +2 -2
  39. package/build/transports/types.js.map +1 -1
  40. package/build/transports/webPlayer.d.ts +12 -11
  41. package/build/transports/webPlayer.js +70 -70
  42. package/build/transports/webPlayer.js.map +1 -1
  43. package/build/types.d.ts +185 -250
  44. package/build/types.js +2 -2
  45. package/build/types.js.map +1 -1
  46. package/build/utils.d.ts +17 -16
  47. package/build/utils.js +68 -68
  48. package/build/utils.js.map +1 -1
  49. package/package.json +3 -2
  50. package/src/DependencyResolver.ts +11 -7
  51. package/src/FileUploader.ts +3 -1
  52. package/src/Session.ts +19 -6
  53. package/src/State.ts +1 -1
  54. package/src/WantedVersions.ts +3 -2
  55. package/src/defaultConfig.ts +5 -5
  56. package/src/index.ts +37 -9
  57. package/src/transports/CodeMessageBuilder.ts +7 -2
  58. package/src/transports/Protocol.ts +1 -1
  59. package/src/transports/types.ts +2 -1
  60. package/src/transports/webPlayer.ts +3 -1
  61. package/src/types.ts +19 -83
  62. package/src/utils.ts +2 -1
  63. package/build/sdk.d.ts +0 -34
  64. package/build/sdk.js +0 -139
  65. package/build/sdk.js.map +0 -1
  66. package/build/sdks/features.d.ts +0 -9
  67. package/build/sdks/features.js +0 -13
  68. package/build/sdks/features.js.map +0 -1
  69. package/build/sdks/index.d.ts +0 -5
  70. package/build/sdks/index.js +0 -124
  71. package/build/sdks/index.js.map +0 -1
  72. package/build/sdks/types.d.ts +0 -21
  73. package/build/sdks/types.js +0 -3
  74. package/build/sdks/types.js.map +0 -1
  75. package/src/sdk.ts +0 -135
  76. package/src/sdks/features.ts +0 -11
  77. package/src/sdks/index.ts +0 -159
  78. package/src/sdks/types.ts +0 -49
@@ -1,296 +1,301 @@
1
- import { SnackTransport, SnackTransportOptions } from './transports';
2
- import { SDKVersion, SnackDependencies, SnackFiles, SnackFile, SnackState, SnackUser, SnackLogEvent, SnackListenerSubscription, SnackDependency, SnackConnectedClients, SnackWindowRef } from './types';
3
- export declare type SnackOptions = {
4
- sdkVersion?: SDKVersion;
5
- name?: string;
6
- description?: string;
7
- dependencies?: SnackDependencies;
8
- files?: SnackFiles;
9
- apiURL?: string;
10
- host?: string;
11
- snackagerURL?: string;
12
- verbose?: boolean;
13
- disabled?: boolean;
14
- online?: boolean;
15
- channel?: string;
16
- deviceId?: string;
17
- transports?: {
18
- [id: string]: SnackTransport;
19
- };
20
- createTransport?: (options: SnackTransportOptions) => SnackTransport;
21
- codeChangesDelay?: number;
22
- reloadTimeout?: number;
23
- previewTimeout?: number;
24
- user?: SnackUser;
25
- id?: string;
26
- webPlayerURL?: string;
27
- webPreviewRef?: SnackWindowRef;
28
- };
29
- export declare type SnackSaveOptions = {
30
- isDraft?: boolean;
31
- ignoreUser?: boolean;
32
- };
33
- export declare type SnackStateListener = (state: SnackState, prevState: SnackState) => any;
34
- export declare type SnackLogListener = (log: SnackLogEvent) => any;
35
- export default class Snack {
36
- private state;
37
- private stateListeners;
38
- private logListeners;
39
- private readonly createTransport;
40
- private readonly logger?;
41
- private readonly apiURL;
42
- private readonly host;
43
- private readonly dependencyResolver;
44
- private readonly fileUploader;
45
- private readonly DevSession;
46
- private wantedDependencyVersions;
47
- private codeChangesDelay;
48
- private codeChangesTimer;
49
- private readonly reloadTimeout;
50
- private readonly previewTimeout;
51
- private readonly webPlayerURL;
52
- private pruneConnectionsTimer;
53
- private readonly transportListeners;
54
- constructor(options: SnackOptions);
55
- /**
56
- * Sets the Expo SDK version.
57
- * @param sdkVersion Valid SDK version (e.g. "38.0.0")
58
- */
59
- setSDKVersion(sdkVersion: SDKVersion): void;
60
- /**
61
- * Sets the name of the Snack.
62
- * @param name E.g. "conspicious orange"
63
- */
64
- setName(name: string): void;
65
- /**
66
- * Sets the description of the Snack.
67
- * @param name E.g. "My awesome Snack"
68
- */
69
- setDescription(description: string): void;
70
- /**
71
- * Sets the associated user account.
72
- *
73
- * When set and `online` is true, causes this Snack to appear on the
74
- * "Recently in Development" section of all Expo clients that are signed
75
- * in with that account.
76
- */
77
- setUser(user?: SnackUser): void;
78
- /**
79
- * Sets the device-id of an Expo client. When set and `online` is true, causes this
80
- * Snack to appear on the "Recently in Development" section of that Expo client.
81
- */
82
- setDeviceId(deviceId?: string): void;
83
- /**
84
- * Sets the focus to this Snack.
85
- *
86
- * Causes this Snack to be moved to the top of the "Recently in Development" list
87
- * in the Expo client.
88
- */
89
- setFocus(): void;
90
- /**
91
- * Sets the delay that is used before sending code updates to the connected clients.
92
- * Use this method to set the "debounce" timeout to use for sending code changes
93
- * over pubnub.
94
- *
95
- * ```
96
- * -1 = Disable automatic sending of code changes (use `sendCodeChanges` to trigger the send)
97
- * 0 = Code changes are sent immediately to the connected clients
98
- * 1..n = Code changes are debounced and sent after the wait time
99
- * ```
100
- *
101
- * @param delay Timeout in milliseconds (or -1 to disable automatic code updates)
102
- */
103
- setCodeChangesDelay(delay: number): void;
104
- /**
105
- * Sends any pending code changes to the connected clients.
106
- * No changes are send if all clients are already up to date.
107
- */
108
- sendCodeChanges(): void;
109
- private _sendCodeChangesDebounced;
110
- /**
111
- * Uploads the current code to Expo's servers and return a url that points to that version of the code.
112
- */
113
- saveAsync(options?: SnackSaveOptions): Promise<{
114
- id: string;
115
- url: string;
116
- hashId: string | undefined;
117
- }>;
118
- /**
119
- * Gets the URL at which the Snack can be downloaded as a zip file. Will automatically
120
- * save the Snack if it contains unsaved changes.
121
- */
122
- getDownloadURLAsync(saveOptions?: SnackSaveOptions): Promise<string>;
123
- private uploadPreview;
124
- /**
125
- * Returns the current state of the Snack. This includes files, dependencies
126
- * and other meta-data about the Snack.
127
- */
128
- getState(): SnackState;
129
- /**
130
- * Waits for any pending operations such as running dependencies resolutions
131
- * before returning the state.
132
- */
133
- getStateAsync(): Promise<SnackState>;
134
- /**
135
- * Adds a callback for listening for any state changes.
136
- *
137
- * @example
138
- * ```
139
- * const unsubscribe = Snack.addStateListener((state, prevState) => {
140
- * if (state.name !== prevState.name) {
141
- * console.log('name changed: ', state.name);
142
- * }
143
- * });
144
- *
145
- * Snack.setName('unforgiven orange'); // // Make a change to the state
146
- *
147
- * unsubscribe(); // Remove listener
148
- * ```
149
- */
150
- addStateListener(listener: SnackStateListener): SnackListenerSubscription;
151
- private setState;
152
- private updateDerivedState;
153
- private onStateChanged;
154
- /**
155
- * Updates code or asset files.
156
- *
157
- * Use this method to add/remove/update files and upload assets.
158
- * To remove a file specify `null` as the value of the file.
159
- *
160
- * @example
161
- * ```ts
162
- * const Snack = new Snack({
163
- * files: {
164
- * 'App.js': { type: 'CODE', contents: 'console.log("hello world!");' },
165
- * 'data.json': { type: 'CODE', contents: '{}' },
166
- * }
167
- * });
168
- *
169
- * // Add or update files
170
- * Snack.updateFiles({
171
- * 'App.js': {
172
- * type: 'CODE',
173
- * contents: 'console.log("Hello Snack!");'
174
- * }
175
- * });
176
- *
177
- * // Upload an asset
178
- * Snack.updateFiles({
179
- * 'assets/logo.png': {
180
- * type: 'ASSET',
181
- * contents: file // File, Blob or FormData
182
- * }
183
- * });
184
- *
185
- * // Add a pre-uploaded asset
186
- * Snack.updateFiles({
187
- * 'assets/expo.jpg': {
188
- * type: 'ASSET',
189
- * contents: 'https://mysite/expo.jpg'
190
- * }
191
- * });
192
- *
193
- * // Remove files
194
- * Snack.updateFiles({
195
- * 'data.json': null,
196
- * 'assets/expo.jpg': null
197
- * });
198
- * ```
199
- */
200
- updateFiles(files: {
201
- [path: string]: SnackFile | null;
202
- }): void;
203
- /**
204
- * Helper function that uploads an asset and returns its url.
205
- */
206
- uploadAssetAsync: (contents: File | Blob | FormData) => Promise<string>;
207
- private updateFileUploader;
208
- private onFileUploaded;
209
- /**
210
- * Updates dependencies.
211
- *
212
- * Use this method to add/remove/update dependencies.
213
- * To remove a dependency specify `null` as the value of the key/value pair.
214
- *
215
- * @example
216
- * ```ts
217
- * const Snack = new Snack({
218
- * dependencies: {
219
- * 'react-native-paper': '~2.0.0'
220
- * }
221
- * });
222
- *
223
- * // Add dependency
224
- * Snack.updateDependencies({
225
- * 'expo-font': '9.0.0'
226
- * });
227
- *
228
- * // Remove dependency
229
- * Snack.updateDependencies({
230
- * 'expo-font': null
231
- * });
232
- * ```
233
- */
234
- updateDependencies(dependencies: {
235
- [name: string]: SnackDependency | null;
236
- }): void;
237
- private updateDerivedDependenciesState;
238
- private updateWantedDependencyVersions;
239
- private onWantedDependencyVersions;
240
- private updateDependencyResolver;
241
- private onDependencyResolved;
242
- /**
243
- * Enables or disables the Snack.
244
- *
245
- * When disabled, no uploads or dependency resolve operations
246
- * are performed.
247
- */
248
- setDisabled(disabled: boolean): void;
249
- /**
250
- * Makes the Snack available online.
251
- *
252
- * When online, a pubnub channel is created to which clients can
253
- * connect.
254
- */
255
- setOnline(enabled: boolean): void;
256
- private updateDerivedOnlineState;
257
- private updateDerivedWebPreviewState;
258
- private onDevSessionSendBeaconCloseRequest;
259
- /**
260
- * Reloads all connected clients.
261
- *
262
- * Note: During the reload proces, clients may get disconnected which
263
- * causes the connectedClient to disappear and re-appear. The `reloadTimeout`
264
- * option in the constructor can be used to keep connectedClients "alive"
265
- * during the reload process.
266
- */
267
- reloadConnectedClients(): void;
268
- /**
269
- * Requests a preview from the connected clients.
270
- *
271
- * The previews are returned in the `previewURL` field of each connectedClient.
272
- */
273
- getPreviewAsync(): Promise<SnackConnectedClients>;
274
- private updateTransports;
275
- private onTransportEvent;
276
- private onClientConnected;
277
- private onClientDisconnected;
278
- /**
279
- * Adds a callback for listening for any client generated log messages.
280
- *
281
- * @example
282
- * ```
283
- * const unsubscribe = Snack.addLogListener((log) => {
284
- * console.log('log message received: ', log);
285
- * });
286
- *
287
- * unsubscribe(); // Remove listener
288
- * ```
289
- */
290
- addLogListener(listener: SnackLogListener): SnackListenerSubscription;
291
- private onProtocolMessageReceived;
292
- private onProtocolMessageSent;
293
- private onConsoleMessageReceived;
294
- private onErrorMessageReceived;
295
- private onStatusReportMessageReceived;
296
- }
1
+ import { SDKVersion, SnackDependencies, SnackDependency, SnackFile, SnackFiles } from 'snack-content';
2
+ import { SnackTransport, SnackTransportOptions } from './transports';
3
+ import { SnackState, SnackUser, SnackLogEvent, SnackListenerSubscription, SnackConnectedClients, SnackWindowRef } from './types';
4
+ export declare type SnackOptions = {
5
+ sdkVersion?: SDKVersion;
6
+ name?: string;
7
+ description?: string;
8
+ dependencies?: SnackDependencies;
9
+ files?: SnackFiles;
10
+ apiURL?: string;
11
+ host?: string;
12
+ snackagerURL?: string;
13
+ verbose?: boolean;
14
+ disabled?: boolean;
15
+ online?: boolean;
16
+ channel?: string;
17
+ deviceId?: string;
18
+ transports?: {
19
+ [id: string]: SnackTransport;
20
+ };
21
+ createTransport?: (options: SnackTransportOptions) => SnackTransport;
22
+ codeChangesDelay?: number;
23
+ reloadTimeout?: number;
24
+ previewTimeout?: number;
25
+ user?: SnackUser;
26
+ id?: string;
27
+ snackId?: string;
28
+ accountSnackId?: string;
29
+ webPlayerURL?: string;
30
+ webPreviewRef?: SnackWindowRef;
31
+ };
32
+ export declare type SnackSaveOptions = {
33
+ isDraft?: boolean;
34
+ ignoreUser?: boolean;
35
+ };
36
+ export declare type SnackStateListener = (state: SnackState, prevState: SnackState) => any;
37
+ export declare type SnackLogListener = (log: SnackLogEvent) => any;
38
+ export default class Snack {
39
+ private state;
40
+ private stateListeners;
41
+ private logListeners;
42
+ private readonly createTransport;
43
+ private readonly logger?;
44
+ private readonly apiURL;
45
+ private readonly host;
46
+ private readonly dependencyResolver;
47
+ private readonly fileUploader;
48
+ private readonly DevSession;
49
+ private wantedDependencyVersions;
50
+ private codeChangesDelay;
51
+ private codeChangesTimer;
52
+ private readonly reloadTimeout;
53
+ private readonly previewTimeout;
54
+ private readonly webPlayerURL;
55
+ private pruneConnectionsTimer;
56
+ private readonly transportListeners;
57
+ constructor(options: SnackOptions);
58
+ /**
59
+ * Sets the Expo SDK version.
60
+ * @param sdkVersion Valid SDK version (e.g. "38.0.0")
61
+ */
62
+ setSDKVersion(sdkVersion: SDKVersion): void;
63
+ /**
64
+ * Sets the name of the Snack.
65
+ * @param name E.g. "conspicious orange"
66
+ */
67
+ setName(name: string): void;
68
+ /**
69
+ * Sets the description of the Snack.
70
+ * @param name E.g. "My awesome Snack"
71
+ */
72
+ setDescription(description: string): void;
73
+ /**
74
+ * Sets the associated user account.
75
+ *
76
+ * When set and `online` is true, causes this Snack to appear on the
77
+ * "Recently in Development" section of all Expo clients that are signed
78
+ * in with that account.
79
+ */
80
+ setUser(user?: SnackUser): void;
81
+ /**
82
+ * Sets the device-id of an Expo client. When set and `online` is true, causes this
83
+ * Snack to appear on the "Recently in Development" section of that Expo client.
84
+ */
85
+ setDeviceId(deviceId?: string): void;
86
+ /**
87
+ * Sets the focus to this Snack.
88
+ *
89
+ * Causes this Snack to be moved to the top of the "Recently in Development" list
90
+ * in the Expo client.
91
+ */
92
+ setFocus(): void;
93
+ /**
94
+ * Sets the delay that is used before sending code updates to the connected clients.
95
+ * Use this method to set the "debounce" timeout to use for sending code changes
96
+ * over pubnub.
97
+ *
98
+ * ```
99
+ * -1 = Disable automatic sending of code changes (use `sendCodeChanges` to trigger the send)
100
+ * 0 = Code changes are sent immediately to the connected clients
101
+ * 1..n = Code changes are debounced and sent after the wait time
102
+ * ```
103
+ *
104
+ * @param delay Timeout in milliseconds (or -1 to disable automatic code updates)
105
+ */
106
+ setCodeChangesDelay(delay: number): void;
107
+ /**
108
+ * Sends any pending code changes to the connected clients.
109
+ * No changes are send if all clients are already up to date.
110
+ */
111
+ sendCodeChanges(): void;
112
+ private _sendCodeChangesDebounced;
113
+ /**
114
+ * Uploads the current code to Expo's servers and return a url that points to that version of the code.
115
+ */
116
+ saveAsync(options?: SnackSaveOptions): Promise<{
117
+ id: string;
118
+ url: string;
119
+ hashId: string | undefined;
120
+ accountSnackId: string | undefined;
121
+ snackId: string | undefined;
122
+ }>;
123
+ /**
124
+ * Gets the URL at which the Snack can be downloaded as a zip file. Will automatically
125
+ * save the Snack if it contains unsaved changes.
126
+ */
127
+ getDownloadURLAsync(saveOptions?: SnackSaveOptions): Promise<string>;
128
+ private uploadPreview;
129
+ /**
130
+ * Returns the current state of the Snack. This includes files, dependencies
131
+ * and other meta-data about the Snack.
132
+ */
133
+ getState(): SnackState;
134
+ /**
135
+ * Waits for any pending operations such as running dependencies resolutions
136
+ * before returning the state.
137
+ */
138
+ getStateAsync(): Promise<SnackState>;
139
+ /**
140
+ * Adds a callback for listening for any state changes.
141
+ *
142
+ * @example
143
+ * ```
144
+ * const unsubscribe = Snack.addStateListener((state, prevState) => {
145
+ * if (state.name !== prevState.name) {
146
+ * console.log('name changed: ', state.name);
147
+ * }
148
+ * });
149
+ *
150
+ * Snack.setName('unforgiven orange'); // // Make a change to the state
151
+ *
152
+ * unsubscribe(); // Remove listener
153
+ * ```
154
+ */
155
+ addStateListener(listener: SnackStateListener): SnackListenerSubscription;
156
+ private setState;
157
+ private updateDerivedState;
158
+ private onStateChanged;
159
+ /**
160
+ * Updates code or asset files.
161
+ *
162
+ * Use this method to add/remove/update files and upload assets.
163
+ * To remove a file specify `null` as the value of the file.
164
+ *
165
+ * @example
166
+ * ```ts
167
+ * const Snack = new Snack({
168
+ * files: {
169
+ * 'App.js': { type: 'CODE', contents: 'console.log("hello world!");' },
170
+ * 'data.json': { type: 'CODE', contents: '{}' },
171
+ * }
172
+ * });
173
+ *
174
+ * // Add or update files
175
+ * Snack.updateFiles({
176
+ * 'App.js': {
177
+ * type: 'CODE',
178
+ * contents: 'console.log("Hello Snack!");'
179
+ * }
180
+ * });
181
+ *
182
+ * // Upload an asset
183
+ * Snack.updateFiles({
184
+ * 'assets/logo.png': {
185
+ * type: 'ASSET',
186
+ * contents: file // File, Blob or FormData
187
+ * }
188
+ * });
189
+ *
190
+ * // Add a pre-uploaded asset
191
+ * Snack.updateFiles({
192
+ * 'assets/expo.jpg': {
193
+ * type: 'ASSET',
194
+ * contents: 'https://mysite/expo.jpg'
195
+ * }
196
+ * });
197
+ *
198
+ * // Remove files
199
+ * Snack.updateFiles({
200
+ * 'data.json': null,
201
+ * 'assets/expo.jpg': null
202
+ * });
203
+ * ```
204
+ */
205
+ updateFiles(files: {
206
+ [path: string]: SnackFile | null;
207
+ }): void;
208
+ /**
209
+ * Helper function that uploads an asset and returns its url.
210
+ */
211
+ uploadAssetAsync: (contents: File | Blob | FormData) => Promise<string>;
212
+ private updateFileUploader;
213
+ private onFileUploaded;
214
+ /**
215
+ * Updates dependencies.
216
+ *
217
+ * Use this method to add/remove/update dependencies.
218
+ * To remove a dependency specify `null` as the value of the key/value pair.
219
+ *
220
+ * @example
221
+ * ```ts
222
+ * const Snack = new Snack({
223
+ * dependencies: {
224
+ * 'react-native-paper': '~2.0.0'
225
+ * }
226
+ * });
227
+ *
228
+ * // Add dependency
229
+ * Snack.updateDependencies({
230
+ * 'expo-font': '9.0.0'
231
+ * });
232
+ *
233
+ * // Remove dependency
234
+ * Snack.updateDependencies({
235
+ * 'expo-font': null
236
+ * });
237
+ * ```
238
+ */
239
+ updateDependencies(dependencies: {
240
+ [name: string]: SnackDependency | null;
241
+ }): void;
242
+ private updateDerivedDependenciesState;
243
+ private updateWantedDependencyVersions;
244
+ private onWantedDependencyVersions;
245
+ private updateDependencyResolver;
246
+ private onDependencyResolved;
247
+ /**
248
+ * Enables or disables the Snack.
249
+ *
250
+ * When disabled, no uploads or dependency resolve operations
251
+ * are performed.
252
+ */
253
+ setDisabled(disabled: boolean): void;
254
+ /**
255
+ * Makes the Snack available online.
256
+ *
257
+ * When online, a pubnub channel is created to which clients can
258
+ * connect.
259
+ */
260
+ setOnline(enabled: boolean): void;
261
+ private updateDerivedOnlineState;
262
+ private updateDerivedWebPreviewState;
263
+ private onDevSessionSendBeaconCloseRequest;
264
+ /**
265
+ * Reloads all connected clients.
266
+ *
267
+ * Note: During the reload proces, clients may get disconnected which
268
+ * causes the connectedClient to disappear and re-appear. The `reloadTimeout`
269
+ * option in the constructor can be used to keep connectedClients "alive"
270
+ * during the reload process.
271
+ */
272
+ reloadConnectedClients(): void;
273
+ /**
274
+ * Requests a preview from the connected clients.
275
+ *
276
+ * The previews are returned in the `previewURL` field of each connectedClient.
277
+ */
278
+ getPreviewAsync(): Promise<SnackConnectedClients>;
279
+ private updateTransports;
280
+ private onTransportEvent;
281
+ private onClientConnected;
282
+ private onClientDisconnected;
283
+ /**
284
+ * Adds a callback for listening for any client generated log messages.
285
+ *
286
+ * @example
287
+ * ```
288
+ * const unsubscribe = Snack.addLogListener((log) => {
289
+ * console.log('log message received: ', log);
290
+ * });
291
+ *
292
+ * unsubscribe(); // Remove listener
293
+ * ```
294
+ */
295
+ addLogListener(listener: SnackLogListener): SnackListenerSubscription;
296
+ private onProtocolMessageReceived;
297
+ private onProtocolMessageSent;
298
+ private onConsoleMessageReceived;
299
+ private onErrorMessageReceived;
300
+ private onStatusReportMessageReceived;
301
+ }