mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-17 23:40:18 +00:00
Add types for timeout option in Analytics constructor (#40706)
This is passed to axios to control HTTP request timeouts
This commit is contained in:
@@ -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',
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Vendored
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user