import type { AnalyticsRecord, AnalyticsService } from '@pikku/core/analytics'; import type { Kysely } from 'kysely'; /** * A durable {@link AnalyticsService} that appends events to a table pikku owns. * * The destination of last resort, and the one a project gets for free: without * it an app that declares events either wires a vendor sink or watches them go * to the logger, and neither is somewhere you can answer a question from. It is * append-only by design — there is no read side here, because querying events * is what a warehouse or the console does with the rows, not what the ingest * path needs. * * Every column is text on every engine, so the same table reads the same * whether it was filled by a locally-run project or a deployed stage. Names are * written camelCase, as the declaration spells them, and `CamelCasePlugin` * turns both into the physical snake_case the migration created. */ export declare class KyselyAnalyticsService implements AnalyticsService { private db; private initialized; constructor(db: Kysely); /** * Refuse to start unless the table is already there. * * Never creates it: `pikku db generate` writes the migration and `pikku db * migrate` applies it, and those are the only authors of this table. */ init(): Promise; write(batch: AnalyticsRecord[]): Promise; }