import type { FieldPii } from "./pii-types";
import type { CollectionRetention } from "./retention-types";
import type { CollectionSubject } from "./subject-linkage-types";

declare module "payload" {
  // FieldBase.custom is typed as FieldCustom (interface extending Record<string, any>).
  // Augmenting it makes pii available on every field type.
  interface FieldCustom {
    pii?: FieldPii;
  }

  // CollectionConfig.custom is typed as CollectionCustom (interface extending Record<string, any>).
  interface CollectionCustom {
    retention?: CollectionRetention;
    authPii?: Record<string, FieldPii | null>;
    subject?: CollectionSubject | CollectionSubject[];
  }
}
