UNPKG

1.33 kBTypeScriptView Raw
1/**
2 *
3 * @param {ConfigLoaderOptions} options
4 * @returns {Promise<ConfigLoaderResult>}
5 */
6export function configLoaderGet(options: ConfigLoaderOptions): Promise<ConfigLoaderResult>;
7/**
8 * Clear the config cache.
9 * Is able to do partially removes by either specifying a name or location but not both.
10 *
11 * @param {{
12 * name?: string,
13 * location?: "project"|"user"
14 * }} [options]
15 * @returns {void}
16 */
17export function configLoaderDeleteCache(options?: {
18 name?: string | undefined;
19 location?: "project" | "user" | undefined;
20} | undefined): void;
21/**
22 * @typedef {object} ConfigLoaderOptions
23 * @property {string} name
24 * @property {"project"|"user"} location
25 */
26/**
27 * @typedef {object} ConfigLoaderResult
28 * @property {string} name
29 * @property {"project"|"user"} location
30 * @property {{
31 * directory: string,
32 * filename: string,
33 * }} [resolvedLocation]
34 * @property {object} data
35 */
36/**
37 *
38 * @type {Map<string, ConfigLoaderResult>}
39 */
40export const configLoaderCache: Map<string, ConfigLoaderResult>;
41export type ConfigLoaderOptions = {
42 name: string;
43 location: "project" | "user";
44};
45export type ConfigLoaderResult = {
46 name: string;
47 location: "project" | "user";
48 resolvedLocation?: {
49 directory: string;
50 filename: string;
51 } | undefined;
52 data: object;
53};