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>
22 lines
474 B
TypeScript
22 lines
474 B
TypeScript
export type AnalyticsAttributeValue = string | number | boolean;
|
|
|
|
export type AnalyticsUser = {
|
|
id: string;
|
|
};
|
|
|
|
export interface 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>;
|
|
}
|