From fd3145eab3c6bf60399648458b9830b0d20f4c29 Mon Sep 17 00:00:00 2001 From: Lilith Date: Sun, 25 Jan 2026 18:13:17 -0800 Subject: [PATCH] =?UTF-8?q?chore(config):=20=F0=9F=94=A7=20Update=20TypeSc?= =?UTF-8?q?ript=20config=20files=20(4=20files)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/AnalyticsClient.ts | 5 +++-- src/client/BackendClient.ts | 5 +++-- src/client/BatchQueue.ts | 2 +- tsconfig.base.json | 9 ++++++--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/client/AnalyticsClient.ts b/src/client/AnalyticsClient.ts index af2e6c0..17f6467 100644 --- a/src/client/AnalyticsClient.ts +++ b/src/client/AnalyticsClient.ts @@ -16,6 +16,7 @@ interface TrackingEvent { userId?: string; properties: Record; 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 { + private async sendEvents(events: TrackingEvent[]): Promise { if (events.length === 0) return; try { diff --git a/src/client/BackendClient.ts b/src/client/BackendClient.ts index da1d499..1a0cabc 100644 --- a/src/client/BackendClient.ts +++ b/src/client/BackendClient.ts @@ -17,6 +17,7 @@ interface TrackingEvent { userId?: string; properties: Record; 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 { + private async sendEvents(events: TrackingEvent[]): Promise { if (events.length === 0) return; try { diff --git a/src/client/BatchQueue.ts b/src/client/BatchQueue.ts index bf8e441..506c7d7 100644 --- a/src/client/BatchQueue.ts +++ b/src/client/BatchQueue.ts @@ -5,7 +5,7 @@ */ /** Generic event type for queue */ -interface QueueableEvent { +export interface QueueableEvent { eventType: string; timestamp: string; [key: string]: unknown; diff --git a/tsconfig.base.json b/tsconfig.base.json index ba17928..1920c45 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -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,