UNPKG

1.62 kBTypeScriptView Raw
1/// <reference types="node" />
2/**
3 * Create return value once.
4 *
5 * @param create Create function.
6 * @returns Returned value.
7 */
8export declare function once<T>(create: () => T): () => T;
9/**
10 * Trim dot slash from head of path.
11 *
12 * @param path Path string.
13 * @returns Trimmed path.
14 */
15export declare function trimDotSlash(path: string): string;
16/**
17 * Find path relative from base, if base matches.
18 *
19 * @param path Path to match against.
20 * @param start Search start.
21 * @param nocase Match case-insensitive.
22 * @returns Returns path, or null.
23 */
24export declare function pathRelativeBase(path: string, start: string, nocase?: boolean): string | null;
25/**
26 * Same as pathRelativeBase, but retuns true on a match, else false.
27 *
28 * @param path Path to match against.
29 * @param start Search start.
30 * @param nocase Match case-insensitive.
31 * @returns Returns true on match, else false.
32 */
33export declare function pathRelativeBaseMatch(path: string, start: string, nocase?: boolean): boolean;
34/**
35 * Trim a file extenion.
36 *
37 * @param path File path.
38 * @param ext File extension.
39 * @param nocase Match case-insensitive.
40 * @returns Path without file extension.
41 */
42export declare function trimExtension(path: string, ext: string, nocase?: boolean): string;
43/**
44 * Get ArrayBuffer from Buffer.
45 *
46 * @param buffer Buffer instance.
47 * @returns ArrayBuffer copy.
48 */
49export declare function bufferToArrayBuffer(buffer: Readonly<Buffer>): ArrayBuffer;
50/**
51 * Get launcher data for an ID.
52 *
53 * @param id Laucher ID.
54 * @returns Launcher data.
55 */
56export declare function launcher(id: string): Promise<Buffer>;