chore(config): 🔧 Update TypeScript config files (4 files)
This commit is contained in:
parent
3b257dc7b2
commit
fd3145eab3
4 changed files with 13 additions and 8 deletions
|
|
@ -16,6 +16,7 @@ interface TrackingEvent {
|
|||
userId?: string;
|
||||
properties: Record<string, unknown>;
|
||||
metadata: EventMetadata;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface AnalyticsClientConfig {
|
||||
|
|
@ -50,7 +51,7 @@ export class AnalyticsClient {
|
|||
this.queue = new BatchQueue({
|
||||
maxSize: config.batch?.maxSize ?? 10,
|
||||
maxWait: config.batch?.maxWait ?? 5000,
|
||||
onFlush: (events) => this.sendEvents(events),
|
||||
onFlush: (events) => this.sendEvents(events as TrackingEvent[]),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -114,7 +115,7 @@ export class AnalyticsClient {
|
|||
return `${Date.now()}-${Math.random().toString(36).substring(2, 11)}`;
|
||||
}
|
||||
|
||||
private async sendEvents(events: AnalyticsEvent[]): Promise<void> {
|
||||
private async sendEvents(events: TrackingEvent[]): Promise<void> {
|
||||
if (events.length === 0) return;
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ interface TrackingEvent {
|
|||
userId?: string;
|
||||
properties: Record<string, unknown>;
|
||||
metadata: EventMetadata;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface BackendClientConfig {
|
||||
|
|
@ -48,7 +49,7 @@ export class BackendAnalyticsClient {
|
|||
this.queue = new BatchQueue({
|
||||
maxSize: config.batch?.maxSize ?? 50,
|
||||
maxWait: config.batch?.maxWait ?? 10000,
|
||||
onFlush: (events) => this.sendEvents(events),
|
||||
onFlush: (events) => this.sendEvents(events as TrackingEvent[]),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -93,7 +94,7 @@ export class BackendAnalyticsClient {
|
|||
await this.flush();
|
||||
}
|
||||
|
||||
private async sendEvents(events: AnalyticsEvent[]): Promise<void> {
|
||||
private async sendEvents(events: TrackingEvent[]): Promise<void> {
|
||||
if (events.length === 0) return;
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
|
||||
/** Generic event type for queue */
|
||||
interface QueueableEvent {
|
||||
export interface QueueableEvent {
|
||||
eventType: string;
|
||||
timestamp: string;
|
||||
[key: string]: unknown;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"lib": ["ES2022"],
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"jsx": "react-jsx",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
|
|
@ -14,6 +15,8 @@
|
|||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": false,
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue