1 | import { StatusCode, CspDirective } from '@shopify/network';
|
2 | import { EffectKind } from '@shopify/react-effect';
|
3 | export { NetworkContext } from './context';
|
4 | export declare const EFFECT_ID: unique symbol;
|
5 | interface Options {
|
6 | headers?: Record<string, string>;
|
7 | }
|
8 | export declare class NetworkManager {
|
9 | readonly effect: EffectKind;
|
10 | private statusCodes;
|
11 | private redirectUrl?;
|
12 | private readonly csp;
|
13 | private readonly headers;
|
14 | private readonly requestHeaders;
|
15 | constructor({ headers }?: Options);
|
16 | reset(): void;
|
17 | getHeader(header: string): string;
|
18 | setHeader(header: string, value: string): void;
|
19 | redirectTo(url: string, status?: StatusCode): void;
|
20 | addStatusCode(statusCode: StatusCode): void;
|
21 | addCspDirective(directive: CspDirective, value: string | string[] | boolean): void;
|
22 | extract(): {
|
23 | status: number | undefined;
|
24 | headers: Map<string, string>;
|
25 | redirectUrl: string | undefined;
|
26 | };
|
27 | }
|