1 | import { IFetchOptions } from "@pnp/common";
|
2 | import { IODataParser } from "./parsers.js";
|
3 | import { IQueryable } from "./queryable.js";
|
4 | import { IRequestContext } from "./pipeline.js";
|
5 | export interface IODataBatchRequestInfo {
|
6 | url: string;
|
7 | method: string;
|
8 | options: IFetchOptions;
|
9 | parser: IODataParser<any>;
|
10 | resolve: ((d: any) => void) | null;
|
11 | reject: ((error: any) => void) | null;
|
12 | id: string;
|
13 | index: number;
|
14 | }
|
15 | export declare abstract class Batch {
|
16 | private _batchId;
|
17 | protected _deps: Promise<void>[];
|
18 | protected _reqs: IODataBatchRequestInfo[];
|
19 | protected _rDeps: Promise<void>[];
|
20 | private _index;
|
21 | constructor(_batchId?: string);
|
22 | get batchId(): string;
|
23 | /**
|
24 | * The requests contained in this batch
|
25 | */
|
26 | protected get requests(): IODataBatchRequestInfo[];
|
27 | /**
|
28 | * Not meant for use directly
|
29 | *
|
30 | * @param batchee The IQueryable for this batch to track in order
|
31 | */
|
32 | track(batchee: IQueryable<any>): void;
|
33 | /**
|
34 | * Adds the given request context to the batch for execution
|
35 | *
|
36 | * @param context Details of the request to batch
|
37 | */
|
38 | add<T = any>(context: IRequestContext<T>): Promise<T>;
|
39 | /**
|
40 | * Adds a dependency insuring that some set of actions will occur before a batch is processed.
|
41 | * MUST be cleared using the returned resolve delegate to allow batches to run
|
42 | */
|
43 | addDependency(): () => void;
|
44 | |
45 |
|
46 |
|
47 |
|
48 |
|
49 | addResolveBatchDependency(p: Promise<any>): void;
|
50 | |
51 |
|
52 |
|
53 |
|
54 |
|
55 | execute(): Promise<void>;
|
56 | protected abstract executeImpl(): Promise<void>;
|
57 | }
|
58 |
|
\ | No newline at end of file |