import type { OperationContext } from '@origintrail-official/dkg-core'; import type { DashboardDB } from './db.js'; /** * Records the lifecycle of node operations (publish, query, sync, etc.) * in the dashboard SQLite database. If no DB is configured (e.g. in tests), * all methods are no-ops. */ export declare class OperationTracker { private readonly db; private readonly starts; private readonly phaseStarts; constructor(db: DashboardDB | null); start(ctx: OperationContext, meta?: { peerId?: string; contextGraphId?: string; details?: Record; }): void; complete(ctx: OperationContext, meta?: { tripleCount?: number; details?: Record; }): void; fail(ctx: OperationContext, err: unknown): void; cancel(ctx: OperationContext, reason: unknown): void; private finish; startPhase(ctx: OperationContext, phase: string): void; completePhase(ctx: OperationContext, phase: string): void; setCost(ctx: OperationContext, cost: { gasUsed?: bigint; gasPrice?: bigint; gasCost?: bigint; tracCost?: bigint; }): void; setTxHash(ctx: OperationContext, txHash?: string, chainId?: number): void; /** * Execute `fn` as a tracked phase — no timing gaps, no forgotten end calls. * On success completes the phase; on error fails the phase and re-throws. */ trackPhase(ctx: OperationContext, phase: string, fn: () => Promise): Promise; /** * Create an onPhase callback wired to this tracker instance. * Pass this to DKGAgent/Publisher methods that accept `onPhase`. */ phaseCallback(ctx: OperationContext): (phase: string, status: 'start' | 'end') => void; } //# sourceMappingURL=operation-tracker.d.ts.map