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