import { BaseRecord } from "./BaseRecord.js";
import { BaseEvent } from "../agent/Events.js";

//#region src/storage/RepositoryEvents.d.ts
declare enum RepositoryEventTypes {
  RecordSaved = "RecordSaved",
  RecordUpdated = "RecordUpdated",
  RecordDeleted = "RecordDeleted",
}
interface RecordSavedEvent<T extends BaseRecord<any, any, any>> extends BaseEvent {
  type: typeof RepositoryEventTypes.RecordSaved;
  payload: {
    record: T;
  };
}
interface RecordUpdatedEvent<T extends BaseRecord<any, any, any>> extends BaseEvent {
  type: typeof RepositoryEventTypes.RecordUpdated;
  payload: {
    record: T;
  };
}
interface RecordDeletedEvent<T extends BaseRecord<any, any, any>> extends BaseEvent {
  type: typeof RepositoryEventTypes.RecordDeleted;
  payload: {
    record: T | {
      id: string;
      type: string;
    };
  };
}
//#endregion
export { RecordDeletedEvent, RecordSavedEvent, RecordUpdatedEvent, RepositoryEventTypes };
//# sourceMappingURL=RepositoryEvents.d.ts.map