@paparootru/vue3-smart-captcha
Version:
Yandex Smart Captcha for Vue3 projects
104 lines (86 loc) • 2.63 kB
TypeScript
import { ComponentOptionsMixin } from 'vue';
import { ComponentProvideOptions } from 'vue';
import { DefineComponent } from 'vue';
import { ExtractPropTypes } from 'vue';
import { Plugin as Plugin_2 } from 'vue';
import { PropType } from 'vue';
import { PublicProps } from 'vue';
declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
declare type __VLS_Prettify<T> = {
[K in keyof T]: T[K];
} & {};
declare type __VLS_TypePropsToRuntimeProps<T> = {
[K in keyof T]-?: {} extends Pick<T, K> ? {
type: PropType<__VLS_NonUndefinedable<T[K]>>;
} : {
type: PropType<T[K]>;
required: true;
};
};
declare type __VLS_WithDefaults<P, D> = {
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
default: D[K];
}> : P[K];
};
declare interface CaptchaProps {
loadWidget?: boolean,
timeout?: number
}
/**
* @link https://cloud.yandex.ru/docs/smartcaptcha/concepts/widget-methods#render
*/
declare interface RenderParams {
sitekey: string,
callback?: (token: Token) => void,
hl?: SupportedLangs,
test?: boolean,
webview?: boolean,
invisible?: boolean,
shieldPosition?: ShieldPosition,
hideShield?: boolean,
}
declare type ShieldPosition =
| 'top-left'
| 'center-left'
| 'bottom-left'
| 'top-right'
| 'center-right'
| 'bottom-right'
export declare const SmartCaptcha: DefineComponent<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<RenderParams & CaptchaProps & Subscriptions>, {
loadWidget: boolean;
timeout: number;
}>>, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
widgetInitialized: (widgetId: number) => void;
}, string, PublicProps, Readonly<ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<RenderParams & CaptchaProps & Subscriptions>, {
loadWidget: boolean;
timeout: number;
}>>> & Readonly<{
onWidgetInitialized?: ((widgetId: number) => any) | undefined;
}>, {
loadWidget: boolean;
timeout: number;
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
export declare const SmartCaptchaPlugin: Plugin_2;
declare interface Subscriptions {
onChallengeVisible?: () => void,
onChallengeHidden?: () => void,
onNetworkError?: () => void,
onSuccess?: (token: Token) => void,
onTokenExpired?: () => void,
}
declare type SupportedLangs =
| 'ru'
| 'en'
| 'be'
| 'kk'
| 'tt'
| 'uk'
| 'uz'
| 'tr'
declare type Token = string
export { }
declare global {
interface Window {
smartCaptcha: SmartCaptcha
}
}