@microsoft/kiota-http-fetchlibrary
Version:
Kiota request adapter implementation with fetch
61 lines • 2 kB
TypeScript
/**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
* See License in the project root for license information.
* -------------------------------------------------------------------------------------------
*/
/**
* @module RedirectHandlerOptions
*/
import type { RequestOption } from "@microsoft/kiota-abstractions";
/**
*
* A type declaration for shouldRetry callback
*/
export type ShouldRedirect = (response: Response) => boolean;
export declare const RedirectHandlerOptionKey = "RedirectHandlerOption";
export interface RedirectHandlerOptionsParams {
maxRedirects?: number;
shouldRedirect?: ShouldRedirect;
}
/**
* MiddlewareOptions
* A class representing RedirectHandlerOptions
*/
export declare class RedirectHandlerOptions implements RequestOption {
/**
* A member holding default max redirects value
*/
private static readonly DEFAULT_MAX_REDIRECTS;
/**
* A member holding maximum max redirects value
*/
private static readonly MAX_MAX_REDIRECTS;
/**
*
* A member holding default shouldRedirect callback
* @returns true
*/
private static readonly defaultShouldRetry;
/**
*
* A member holding the max redirects value
*/
maxRedirects: number;
/**
*
* A member holding the should redirect callback
*/
shouldRedirect: ShouldRedirect;
/**
*
* To create an instance of RedirectHandlerOptions
* @param [options] - The redirect handler options instance
* @returns An instance of RedirectHandlerOptions
* @throws Error if maxRedirects is more than 20 or less than 0
* @example const options = new RedirectHandlerOptions({ maxRedirects: 5 });
*/
constructor(options?: Partial<RedirectHandlerOptionsParams>);
getKey(): string;
}
//# sourceMappingURL=redirectHandlerOptions.d.ts.map