import { ReactNode } from 'react'; import { ThankYouPageDef, ThankYouPageDraft } from '../schema/index.ts'; /** * Host integration for thank-you pages. The page itself belongs to the host's * app — their domain, their template, their code — so this package neither * renders nor stores one. It only offers the author the moment to ask for one: * `createPage` mints it and returns where it lives, and the builder writes that * URL into the redirect. * * `pages` is the host's current list, used to name an attached page in the * editor. Optional: the attachment carries a label of its own (see * `AttachedThankYouPage`), so an editor mounted without a list still shows which * page a form points at. When both exist the list wins, being the fresher of the * two — a page renamed in the host's app reads correctly here on the next mount. * * `enabled` is what puts the "create page" button in the redirect card, and it * needs `createPage`: without a handler there is nobody to create anything, and * a button that can't do its job is worse than no button. */ export interface ThankYouPagesApi { pages: ThankYouPageDef[]; createPage?: (draft: ThankYouPageDraft) => Promise; enabled: boolean; } export declare function ThankYouPagesProvider({ pages, createPage, children, }: { pages?: ThankYouPageDef[]; createPage?: (draft: ThankYouPageDraft) => Promise; children: ReactNode; }): import("react").JSX.Element; export declare function useThankYouPages(): ThankYouPagesApi;