Add types for timeout option in Analytics constructor (#40706)

This is passed to axios to control HTTP request timeouts
This commit is contained in:
Jon Bevan
2019-12-10 14:30:09 -05:00
committed by Orta
parent 2d0fd6b8b5
commit 6fe250fdc7
2 changed files with 14 additions and 2 deletions
+12 -1
View File
@@ -6,7 +6,18 @@ function testConfig(): void {
flushAt: 20,
flushInterval: 10000,
host: "http://example.com",
enable: true
enable: true,
timeout: 1000,
});
}
function testConfigWithStringTimeout(): void {
analytics = new Analytics('YOUR_WRITE_KEY', {
flushAt: 20,
flushInterval: 10000,
host: "http://example.com",
enable: true,
timeout: '1000',
});
}
+2 -1
View File
@@ -43,7 +43,8 @@ declare namespace AnalyticsNode {
flushAt?: number,
flushInterval?: number,
host?: string,
enable?: boolean
enable?: boolean,
timeout?: number | string,
});
/* The identify method lets you tie a user to their actions and record