Skip to content

Commit 88e5440

Browse files
Polish type definitions
1 parent d14bcfa commit 88e5440

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

types/index.d.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Type definitions for Split JavaScript Sync Tools
22
// Project: https://www.split.io/
33
// Definitions by: Emiliano Sanchez <https://github.com/EmilianoSanchez/>
4+
45
import { RequestOptions } from 'http';
56

67
export = JsSyncTools;
@@ -14,11 +15,13 @@ declare module JsSyncTools {
1415
export class Synchronizer {
1516
/**
1617
* Creates a new Synchronizer instance
18+
*
1719
* @param config - The synchronizer config object
1820
*/
1921
constructor(config: ISynchronizerSettings);
2022
/**
2123
* Execute synchronization
24+
*
2225
* @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.
2326
* @returns A promise that resolves when the operation ends, with a boolean indicating if operation succeeded or not. The promise never rejects.
2427
*/
@@ -98,7 +101,7 @@ declare module JsSyncTools {
98101
*/
99102
storage: {
100103
/**
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.
102105
*/
103106
type?: 'PLUGGABLE',
104107
/**
@@ -121,10 +124,11 @@ declare module JsSyncTools {
121124
* Boolean value to indicate whether the logger should be enabled or disabled by default, or a log level string.
122125
*
123126
* Examples:
124-
* ```typescript
127+
* ```
125128
* config.debug = true
126129
* config.debug = 'WARN'
127130
* ```
131+
*
128132
* @defaultValue `false`
129133
*/
130134
debug?: boolean | LogLevel
@@ -145,15 +149,15 @@ declare module JsSyncTools {
145149
splitFilters?: SplitFilter[]
146150
/**
147151
* 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'`.
149153
*
150154
* @defaultValue `'1.1'`
151155
*/
152156
flagSpecVersion?: '1.0' | '1.1'
153157
/**
154158
* Impressions Collection Mode. Option to determine how impressions are going to be sent to Split Servers.
155159
*
156-
* Possible values are 'DEBUG' and 'OPTIMIZED'.
160+
* Possible values are `'DEBUG'` and `'OPTIMIZED'`.
157161
* - DEBUG: will send all the impressions generated (recommended only for debugging purposes).
158162
* - OPTIMIZED: will send unique impressions to Split Servers avoiding a considerable amount of traffic that duplicated impressions could generate.
159163
*
@@ -163,6 +167,7 @@ declare module JsSyncTools {
163167
/**
164168
* Custom options object for HTTP(S) requests in Node.js.
165169
* If provided, this object is merged with the options object passed for Node-Fetch calls.
170+
*
166171
* @see {@link https://www.npmjs.com/package/node-fetch#options}
167172
*/
168173
requestOptions?: {
@@ -193,7 +198,7 @@ declare module JsSyncTools {
193198
*
194199
* You can use it, for example, for certificate pinning or setting a network proxy:
195200
*
196-
* ```javascript
201+
* ```
197202
* const { HttpsProxyAgent } = require('https-proxy-agent');
198203
*
199204
* const proxyAgent = new HttpsProxyAgent(process.env.HTTPS_PROXY || 'http://10.10.1.10:1080');
@@ -221,16 +226,19 @@ declare module JsSyncTools {
221226
scheduler?: {
222227
/**
223228
* Maximum number of impressions to send per POST request.
229+
*
224230
* @defaultValue `1000`
225231
*/
226232
impressionsPerPost?: number
227233
/**
228234
* Maximum number of events to send per POST request.
235+
*
229236
* @defaultValue `1000`
230237
*/
231238
eventsPerPost?: number
232239
/**
233240
* Maximum number of retry attempts for posting impressions and events.
241+
*
234242
* @defaultValue `3`
235243
*/
236244
maxRetries?: number

0 commit comments

Comments
 (0)