recaptcha-node
Version:
A Node.js library to verify reCAPTCHA v2/v3 response tokens received from a client.
28 lines (27 loc) • 1.24 kB
TypeScript
declare type BaseErrorCreationAttrs = {
/** Original error that triggered this wrapper error. */
original?: Error;
/** A human-readable description of the error. */
message?: string;
};
export declare type RecaptchaErrorCreationAttrs = BaseErrorCreationAttrs;
export declare class RecaptchaError extends Error implements RecaptchaErrorCreationAttrs {
original?: Error;
constructor(attrs: RecaptchaErrorCreationAttrs);
}
declare type APIErrorCreationAttrs = BaseErrorCreationAttrs;
export declare class RecaptchaAPIError extends RecaptchaError implements APIErrorCreationAttrs {
type: 'api-error';
constructor(attrs?: APIErrorCreationAttrs);
}
declare type ConnectionErrorCreationAttrs = BaseErrorCreationAttrs;
export declare class RecaptchaConnectionError extends RecaptchaError implements ConnectionErrorCreationAttrs {
type: 'connection-error';
constructor(attrs?: ConnectionErrorCreationAttrs);
}
declare type InvalidRequestErrorCreationAttrs = BaseErrorCreationAttrs;
export declare class RecaptchaInvalidRequestError extends RecaptchaError implements InvalidRequestErrorCreationAttrs {
type: 'invalid-request-error';
constructor(attrs?: InvalidRequestErrorCreationAttrs);
}
export {};