firebase-auth-cloudflare-workers
Version:
Zero-dependencies firebase auth library for Cloudflare Workers.
40 lines (39 loc) • 1.51 kB
TypeScript
/** Http method type definition. */
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD';
/** API callback function type definition. */
export type ApiCallbackFunction = (data: object) => void;
/**
* Class that defines all the settings for the backend API endpoint.
*
* @param endpoint - The Firebase Auth backend endpoint.
* @param httpMethod - The http method for that endpoint.
* @constructor
*/
export declare class ApiSettings {
private version;
private endpoint;
private httpMethod;
private requestValidator;
private responseValidator;
constructor(version: 'v1' | 'v2', endpoint: string, httpMethod?: HttpMethod);
/** @returns The backend API resource version. */
getVersion(): 'v1' | 'v2';
/** @returns The backend API endpoint. */
getEndpoint(): string;
/** @returns The request HTTP method. */
getHttpMethod(): HttpMethod;
/**
* @param requestValidator - The request validator.
* @returns The current API settings instance.
*/
setRequestValidator(requestValidator: ApiCallbackFunction | null): ApiSettings;
/** @returns The request validator. */
getRequestValidator(): ApiCallbackFunction;
/**
* @param responseValidator - The response validator.
* @returns The current API settings instance.
*/
setResponseValidator(responseValidator: ApiCallbackFunction | null): ApiSettings;
/** @returns The response validator. */
getResponseValidator(): ApiCallbackFunction;
}