mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Flush for analytics-node
This commit is contained in:
parent
dd92c920b0
commit
741c1c4b53
@ -80,3 +80,12 @@ function testIntegrations(): void {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function testFlush(): void {
|
||||
analytics.flush();
|
||||
analytics.flush(function(err, batch) {
|
||||
if (err) { alert("Oh nos!"); }
|
||||
else { console.log(batch.batch[0].type); }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
10
analytics-node/analytics-node.d.ts
vendored
10
analytics-node/analytics-node.d.ts
vendored
@ -65,6 +65,16 @@ declare module AnalyticsNode {
|
||||
anonymous_id?: string | number;
|
||||
integrations?: Integrations;
|
||||
}): Analytics;
|
||||
|
||||
/* Flush batched calls to make sure nothing is left in the queue */
|
||||
flush(fn?: (err: Error, batch: {
|
||||
batch: Array<{
|
||||
type: string;
|
||||
}>;
|
||||
messageId: string;
|
||||
sentAt: Date;
|
||||
timestamp: Date;
|
||||
}) => void): Analytics;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user