import type { Request } from 'express';
import { anonymizeArtifactId as anonymizeArtifactIdShared, type AnalyticsClientType, type AnalyticsConfigResponse } from '@open-design/contracts/analytics';
export interface AnalyticsContext {
    anonymousId: string;
    sessionId: string;
    clientType: AnalyticsClientType;
    locale: string;
    requestId: string | null;
}
export declare function readAnalyticsContext(req: Request): AnalyticsContext | null;
export interface PosthogConfig {
    key: string;
    host: string;
}
export declare function readPosthogConfig(env?: NodeJS.ProcessEnv): PosthogConfig | null;
export declare function readPublicConfigResponse(env?: NodeJS.ProcessEnv): AnalyticsConfigResponse;
export interface AnalyticsService {
    capture(args: {
        eventName: string;
        context: AnalyticsContext;
        appVersion: string;
        properties: Record<string, unknown>;
        insertId: string;
    }): void;
    shutdown(): Promise<void>;
}
export declare function createAnalyticsService(args: {
    env?: NodeJS.ProcessEnv;
    dataDir: string;
}): AnalyticsService;
export declare const anonymizeArtifactId: typeof anonymizeArtifactIdShared;
export declare function newInsertId(): string;
