import { ODataParser } from "../odata/core"; import { ODataBatch } from "../sharepoint/batch"; import { ICachingOptions } from "../odata/caching"; import { FetchOptions } from "../net/utils"; import { RequestClient } from "./requestclient"; /** * Defines the context for a given request to be processed in the pipeline */ export interface RequestContext { batch: ODataBatch; batchDependency: () => void; cachingOptions: ICachingOptions; hasResult?: boolean; isBatched: boolean; isCached: boolean; options: FetchOptions; parser: ODataParser; pipeline?: Array<(c: RequestContext) => Promise>>; requestAbsoluteUrl: string; requestId: string; result?: T; verb: string; clientFactory: () => RequestClient; } /** * Sets the result on the context */ export declare function setResult(context: RequestContext, value: any): Promise>; /** * Executes the current request context's pipeline * * @param context Current context */ export declare function pipe(context: RequestContext): Promise; /** * decorator factory applied to methods in the pipeline to control behavior */ export declare function requestPipelineMethod(alwaysRun?: boolean): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void; /** * Contains the methods used within the request pipeline */ export declare class PipelineMethods { /** * Logs the start of the request */ static logStart(context: RequestContext): Promise>; /** * Handles caching of the request */ static caching(context: RequestContext): Promise>; /** * Sends the request */ static send(context: RequestContext): Promise>; /** * Logs the end of the request */ static logEnd(context: RequestContext): Promise>; static readonly default: ((context: RequestContext) => Promise>)[]; }