chore(config): 🔧 Update TypeScript config files (4 files)

This commit is contained in:
Lilith 2026-01-25 18:13:17 -08:00
parent 3b257dc7b2
commit fd3145eab3
4 changed files with 13 additions and 8 deletions

View file

@ -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 {

View file

@ -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 {

View file

@ -5,7 +5,7 @@
*/
/** Generic event type for queue */
interface QueueableEvent {
export interface QueueableEvent {
eventType: string;
timestamp: string;
[key: string]: unknown;

View file

@ -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,