svelte-craftcms-headless-formie
Version:
Svelte Package for using Craft CMS with the Formie Plugin in headless configuration
38 lines (37 loc) • 1.07 kB
TypeScript
import type { Snippet } from 'svelte';
import type { HTMLButtonAttributes, HTMLFormAttributes } from 'svelte/elements';
export type AfterSubmitState = {
message: string | null;
isSuccess: boolean;
};
export type FormieFormProps = HTMLFormAttributes & {
publicCmsApi: string;
handle: string;
isLoading?: boolean;
recaptchaKey?: string;
siteId?: string | number;
class?: string;
onaftersubmit?: (d: AfterSubmitState) => void;
submitButton: Snippet<[HTMLButtonAttributes & {
text: string;
}]>;
skeletonSnippet?: Snippet;
errorSnippet?: Snippet;
afterSubmitSnippet?: Snippet<[{
state: AfterSubmitState;
}]>;
recaptchaHint?: Snippet;
pagination?: Snippet<[
{
currentIndex: number;
totalPages: number | undefined;
backBtn: MultistepBtnProps | undefined;
nextBtn: MultistepBtnProps | undefined;
}
]>;
};
type MultistepBtnProps = HTMLButtonAttributes & {
text: string;
onclick: (targetIndex: number) => void;
};
export {};