1
1
// Type definitions for Split JavaScript Sync Tools
2
2
// Project: https://www.split.io/
3
3
// Definitions by: Emiliano Sanchez <https://github.com/EmilianoSanchez/>
4
+
4
5
import { RequestOptions } from 'http' ;
5
6
6
7
export = JsSyncTools ;
@@ -14,11 +15,13 @@ declare module JsSyncTools {
14
15
export class Synchronizer {
15
16
/**
16
17
* Creates a new Synchronizer instance
18
+ *
17
19
* @param config - The synchronizer config object
18
20
*/
19
21
constructor ( config : ISynchronizerSettings ) ;
20
22
/**
21
23
* Execute synchronization
24
+ *
22
25
* @param cb - Optional error-first callback to be invoked when the synchronization ends. The callback will be invoked with an error as first argument if the synchronization fails.
23
26
* @returns A promise that resolves when the operation ends, with a boolean indicating if operation succeeded or not. The promise never rejects.
24
27
*/
@@ -98,7 +101,7 @@ declare module JsSyncTools {
98
101
*/
99
102
storage : {
100
103
/**
101
- * Storage type. The only possible value is " PLUGGABLE" , which is the default.
104
+ * Storage type. The only possible value is `' PLUGGABLE'` , which is the default.
102
105
*/
103
106
type ?: 'PLUGGABLE' ,
104
107
/**
@@ -121,10 +124,11 @@ declare module JsSyncTools {
121
124
* Boolean value to indicate whether the logger should be enabled or disabled by default, or a log level string.
122
125
*
123
126
* Examples:
124
- * ```typescript
127
+ * ```
125
128
* config.debug = true
126
129
* config.debug = 'WARN'
127
130
* ```
131
+ *
128
132
* @defaultValue `false`
129
133
*/
130
134
debug ?: boolean | LogLevel
@@ -145,15 +149,15 @@ declare module JsSyncTools {
145
149
splitFilters ?: SplitFilter [ ]
146
150
/**
147
151
* Feature Flag Spec version. Option to determine which version of the feature flag definitions are fetched and stored.
148
- * Possible values are '1.0' and '1.1'.
152
+ * Possible values are ` '1.0'` and ` '1.1'` .
149
153
*
150
154
* @defaultValue `'1.1'`
151
155
*/
152
156
flagSpecVersion ?: '1.0' | '1.1'
153
157
/**
154
158
* Impressions Collection Mode. Option to determine how impressions are going to be sent to Split Servers.
155
159
*
156
- * Possible values are 'DEBUG' and 'OPTIMIZED'.
160
+ * Possible values are ` 'DEBUG'` and ` 'OPTIMIZED'` .
157
161
* - DEBUG: will send all the impressions generated (recommended only for debugging purposes).
158
162
* - OPTIMIZED: will send unique impressions to Split Servers avoiding a considerable amount of traffic that duplicated impressions could generate.
159
163
*
@@ -163,6 +167,7 @@ declare module JsSyncTools {
163
167
/**
164
168
* Custom options object for HTTP(S) requests in Node.js.
165
169
* If provided, this object is merged with the options object passed for Node-Fetch calls.
170
+ *
166
171
* @see {@link https://www.npmjs.com/package/node-fetch#options }
167
172
*/
168
173
requestOptions ?: {
@@ -193,7 +198,7 @@ declare module JsSyncTools {
193
198
*
194
199
* You can use it, for example, for certificate pinning or setting a network proxy:
195
200
*
196
- * ```javascript
201
+ * ```
197
202
* const { HttpsProxyAgent } = require('https-proxy-agent');
198
203
*
199
204
* const proxyAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY || 'http://10.10.1.10:1080');
@@ -221,16 +226,19 @@ declare module JsSyncTools {
221
226
scheduler ?: {
222
227
/**
223
228
* Maximum number of impressions to send per POST request.
229
+ *
224
230
* @defaultValue `1000`
225
231
*/
226
232
impressionsPerPost ?: number
227
233
/**
228
234
* Maximum number of events to send per POST request.
235
+ *
229
236
* @defaultValue `1000`
230
237
*/
231
238
eventsPerPost ?: number
232
239
/**
233
240
* Maximum number of retry attempts for posting impressions and events.
241
+ *
234
242
* @defaultValue `3`
235
243
*/
236
244
maxRetries ?: number
0 commit comments