Initial clean commit
This commit is contained in:
30
src/types/turnstile.d.ts
vendored
Normal file
30
src/types/turnstile.d.ts
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_CONTACT_API_URL?: string;
|
||||
readonly VITE_TURNSTILE_SITE_KEY?: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
|
||||
type TurnstileWidgetId = string | number;
|
||||
|
||||
type TurnstileRenderOptions = {
|
||||
sitekey: string;
|
||||
action?: string;
|
||||
callback?: (token: string) => void;
|
||||
"expired-callback"?: () => void;
|
||||
"error-callback"?: () => void;
|
||||
};
|
||||
|
||||
type TurnstileApi = {
|
||||
render: (container: string | HTMLElement, options: TurnstileRenderOptions) => TurnstileWidgetId;
|
||||
reset: (widgetId?: TurnstileWidgetId) => void;
|
||||
remove: (widgetId: TurnstileWidgetId) => void;
|
||||
};
|
||||
|
||||
interface Window {
|
||||
turnstile?: TurnstileApi;
|
||||
}
|
||||
Reference in New Issue
Block a user