import { FieldError, FieldError as FieldError$1, FormDef, StoredSubmission, StoredSubmission as StoredSubmission$1 } from "@platform-modules/forms";
//#region src/seams.d.ts
type SubmitResult = {
  ok: true;
  id: string;
} | {
  ok: false;
  errors: FieldError[];
};
/** PUBLIC submit — the host's intake route. The SERVER runs validate + anti-spam; the browser only POSTs. */
type SubmitFn = (formId: string, data: Record<string, unknown>, renderToken?: string) => Promise<SubmitResult>;
/** ADMIN inbox — admin-authorized, formId-scoped routes. NO cross-form global read (IDOR floor). */
interface SubmissionClient {
  list(formId: string, opts?: {
    limit?: number;
    cursor?: string;
    includeSpam?: boolean;
  }): Promise<{
    items: StoredSubmission[];
    nextCursor?: string;
  }>;
  get(formId: string, id: string): Promise<StoredSubmission | null>;
  delete(formId: string, id: string): Promise<void>;
}
//#endregion
//#region src/errors.d.ts
declare class FormsClientError extends Error {
  readonly code: string;
  constructor(message: string, code?: string);
}
declare function isFormsClientError(e: unknown): e is FormsClientError;
//#endregion
//#region src/useFormSubmit.d.ts
declare function useFormSubmit(submit: SubmitFn): {
  submit: (formId: string, data: Record<string, unknown>, renderToken?: string) => Promise<SubmitResult>;
  pending: boolean;
  fieldErrors: FieldError$1[];
};
//#endregion
//#region src/FormRenderer.d.ts
interface FormRendererProps {
  form: FormDef;
  submit: SubmitFn;
  renderToken?: string;
  onSuccess?: (id: string) => void;
}
declare function FormRenderer({ form, submit, renderToken, onSuccess }: FormRendererProps): import("react").JSX.Element;
//#endregion
//#region src/useSubmissions.d.ts
interface UseSubmissionsOpts {
  limit?: number;
  cursor?: string;
  includeSpam?: boolean;
}
declare function useSubmissions(client: SubmissionClient, formId: string, opts?: UseSubmissionsOpts): {
  items: StoredSubmission$1[];
  loading: boolean;
  error: FormsClientError | null;
  hasMore: boolean;
  loadMore: () => Promise<void>;
  remove: (id: string) => Promise<void>;
  reload: () => void;
};
//#endregion
//#region src/SubmissionsTable.d.ts
interface SubmissionsTableProps {
  client: SubmissionClient;
  formId: string;
  /**
   * Render a stored `createdAt` ISO string for display. The host owns date
   * presentation (locale, ordering) — a CMS bound to a day-month-year
   * convention passes its own `Intl.DateTimeFormat` here. Defaults to the
   * runtime locale via `toLocaleString` (never a raw ISO string).
   */
  formatDate?: (iso: string) => string;
}
declare function SubmissionsTable({ client, formId, formatDate }: SubmissionsTableProps): import("react").JSX.Element;
//#endregion
export { type FieldError, FormRenderer, FormsClientError, type StoredSubmission, type SubmissionClient, SubmissionsTable, type SubmitFn, type SubmitResult, isFormsClientError, useFormSubmit, useSubmissions };