Replaces generator placeholder with IAnalytics interface (track, identify, pageView, flush), AnalyticsAttributeValue + AnalyticsUser types, and NoopAnalytics implementation. Adds sibling tests covering all four methods with 100% coverage. All conformance + coverage gates pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
24 lines
533 B
TypeScript
24 lines
533 B
TypeScript
import type {
|
|
AnalyticsAttributeValue,
|
|
AnalyticsUser,
|
|
IAnalytics,
|
|
} from "./analytics.interface";
|
|
|
|
export class NoopAnalytics implements IAnalytics {
|
|
track(
|
|
_event: string,
|
|
_attributes?: Record<string, AnalyticsAttributeValue>,
|
|
): void {}
|
|
identify(
|
|
_user: AnalyticsUser,
|
|
_attributes?: Record<string, AnalyticsAttributeValue>,
|
|
): void {}
|
|
pageView(
|
|
_path: string,
|
|
_attributes?: Record<string, AnalyticsAttributeValue>,
|
|
): void {}
|
|
flush(): Promise<void> {
|
|
return Promise.resolve();
|
|
}
|
|
}
|