import type { Schedule, ScheduleFilter, ScheduleTrigger, ScheduleTriggerListOptions, ScheduleUpdate, CreateIndexOptions, PruneOptions, PruneResult, RetentionTablesDescriptor, TableRetentionPolicy } from '@mastra/core/storage'; import { SchedulesStorage } from '@mastra/core/storage'; import type { PgDomainConfig } from '../../db/index.js'; export declare class SchedulesPG extends SchedulesStorage { #private; /** Tables managed by this domain */ static readonly MANAGED_TABLES: readonly ["mastra_schedules", "mastra_schedule_triggers"]; /** * The fire/run history (`schedule_triggers`, one row per fire) is the growth * table; schedule definitions are config and excluded. Anchored on * `actual_fire_at`, a bigint epoch-ms column (numeric comparison, not * timestamptz). */ static readonly retentionTables: RetentionTablesDescriptor; constructor(config: PgDomainConfig); init(): Promise; /** * Lazily ensures a btree index exists on each configured policy's retention * anchor column so age-based `prune()` deletes stay fast. The default * composite index leads with `schedule_id`, so a bare `actual_fire_at` range * scan can't use it. Called from the prune path (not init) so only * deployments that configure retention pay the index's write/disk overhead. * Created even with `skipDefaultIndexes` — retention is an explicit opt-in, * so its supporting index is not part of the default index set. */ private ensureRetentionIndexes; /** * Delete trigger (fire history) rows whose `actual_fire_at` is older than the * `triggers` policy's `maxAge`, batched. Schedule definitions are never pruned. */ prune(policies: Record, options?: PruneOptions): Promise; /** * Returns default index definitions for the schedules domain. * @param schemaPrefix - Prefix for index names (e.g. "my_schema_" or "") */ static getDefaultIndexDefs(schemaPrefix: string): CreateIndexOptions[]; getDefaultIndexDefinitions(): CreateIndexOptions[]; createDefaultIndexes(): Promise; createCustomIndexes(): Promise; static getExportDDL(schemaName?: string): string[]; dangerouslyClearAll(): Promise; createSchedule(schedule: Schedule): Promise; getSchedule(id: string): Promise; listSchedules(filter?: ScheduleFilter): Promise; listDueSchedules(now: number, limit?: number): Promise; updateSchedule(id: string, patch: ScheduleUpdate): Promise; updateScheduleNextFire(id: string, expectedNextFireAt: number, newNextFireAt: number, lastFireAt: number, lastRunId: string): Promise; deleteSchedule(id: string): Promise; recordTrigger(trigger: ScheduleTrigger): Promise; listTriggers(scheduleId: string, opts?: ScheduleTriggerListOptions): Promise; } //# sourceMappingURL=index.d.ts.map