UNPKG

1.05 kBTypeScriptView Raw
1import { Loadable, Mark, Stream } from '../types';
2export declare const consumeMark: (stream: Stream | undefined, marks: string[]) => void;
3export declare const assignLoadableMark: (mark: Mark, loadable: Loadable<any>) => void;
4/**
5 * returns marks used in the stream
6 * @param stream
7 */
8export declare const getUsedMarks: (stream?: Stream) => string[];
9/**
10 * SSR
11 * @returns list or marks used
12 */
13export declare const drainHydrateMarks: (stream?: Stream) => string[];
14/**
15 * Loads a given marks/chunks
16 * @see returns a promise for a given marks only. In order to await all requests currently in flight use {@link waitForMarks}
17 * @param marks
18 * @returns a resolution promise
19 */
20export declare const rehydrateMarks: (marks?: string[] | undefined) => Promise<unknown>;
21/**
22 * waits for the given marks to load
23 * @param marks
24 */
25export declare const waitForMarks: (marks: string[]) => Promise<unknown>;
26/**
27 * @returns a <script> tag with all used marks
28 */
29export declare const printDrainHydrateMarks: (stream?: Stream | undefined) => string;