File: environment.d.ts

package info (click to toggle)
gjs 1.87.1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 7,128 kB
  • sloc: cpp: 38,390; javascript: 31,939; ansic: 15,994; sh: 1,743; python: 791; xml: 137; makefile: 40
file content (44 lines) | stat: -rw-r--r-- 1,584 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
// SPDX-FileCopyrightText: 2020 Evan Welsh <contact@evanwelsh.com>

declare var moduleGlobalThis: Global;

declare var atob: (text: string) => string;
declare var compileInternalModule: CompileFunc;
declare var compileModule: CompileFunc;
declare var getRegistry: (global: Global) => Map<string, Module>;
declare var getSourceMapRegistry:
    (global: Global) => Map<string, SourceMapConsumer>;
declare var loadResourceOrFile: (uri: string) => string;
declare var loadResourceOrFileAsync: (uri: string) => Promise<string>;
declare var parseURI: (uri: string) => Uri;
declare var resolveRelativeResourceOrFile:
    (uri: string, relativePath: string) => Uri;
declare var setGlobalModuleLoader:
    (global: Global, loader: InternalModuleLoader) => void;
declare var setModulePrivate: (module: Module, private: ModulePrivate) => void;
declare var uriExists: (uri: string) => boolean;

/**
 * Use '__internal: never' to prevent any object from being type compatible with
 * Module because it is an internal type.
 */
declare type Module = { __internal: never };
declare type Global = typeof globalThis;
declare type SchemeHandler = {
    load(uri: Uri): string;
    loadAsync(uri: Uri): Promise<string>;
};

declare type Query = { [key: string]: string | undefined };
declare type CompileFunc = (uri: string, source: string) => Module;
declare type ResolvedModule = [Module, string, string];

declare type Uri = {
    uri: string;
    uriWithQuery: string;
    scheme: string;
    host: string;
    path: string;
    query: Query;
};