@google-cloud/recaptcha-edge
Version:
A reCAPTCHA Enterprise Typescript library for Edge Compute Platforms.
41 lines (40 loc) • 1.57 kB
TypeScript
/**
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Library specific errors.
*/
import { AllowAction, BlockAction } from "./action";
/**
* Error type for reCAPTCHA processing.
*/
export declare class RecaptchaError extends Error {
recommendedAction?: AllowAction | BlockAction;
constructor(message: string, recommendedAction?: AllowAction | BlockAction);
recommended_action_enum(): "block" | "allow";
toJSON(): object;
}
/** An Error that occurs during initialization. */
export declare class InitError extends RecaptchaError {
constructor(message: string, recommendedAction?: AllowAction | BlockAction);
}
/** An Error that occurs during response parsing. */
export declare class ParseError extends RecaptchaError {
constructor(message: string, recommendedAction?: AllowAction | BlockAction);
}
/** An Error that occurs when reCAPTCHA is unreachable. */
export declare class NetworkError extends RecaptchaError {
constructor(message: string, recommendedAction?: AllowAction | BlockAction);
}