UNPKG

1.05 kBTypeScriptView Raw
1/// <reference types="node" />
2import urlMod from "url";
3import { NullableSourceText } from "./source-map/source-store";
4/**
5 * Returns the `string` corresponding to the provided URL record.
6 */
7export declare type GetText = (url: Readonly<urlMod.URL>) => Promise<string>;
8/**
9 * Synchronous variant of `GetText`.
10 */
11export declare type GetTextSync = (url: Readonly<urlMod.URL>) => string;
12/**
13 * Returns the string corresponding to the provided `url`.
14 *
15 * @param url URL for the text content.
16 */
17export declare function getText(url: Readonly<urlMod.URL>): Promise<string>;
18/**
19 * Synchronous variant of `getText`.
20 */
21export declare function getTextSync(url: Readonly<urlMod.URL>): string;
22export declare function getTextByDataUrl(url: Readonly<urlMod.URL>): string;
23export declare function getTextByFileUrl(url: Readonly<urlMod.URL>): Promise<string>;
24export declare function getTextByFileUrlSync(url: Readonly<urlMod.URL>): string;
25export declare function getTextSyncFromSourceStore(sources: Iterable<[string, NullableSourceText]>): GetTextSync;