UNPKG

1.46 kBTypeScriptView Raw
1/**
2 * HTML encode.
3 *
4 * @param s Raw strings.
5 * @param dq Double quotes.
6 * @param sq Single quotes.
7 * @returns Encoded strings.
8 */
9export declare function htmlEncode(s: string, dq?: boolean, sq?: boolean): string;
10/**
11 * Trim dot slash from head of path.
12 *
13 * @param path Path string.
14 * @returns Trimmed path.
15 */
16export declare function trimDotSlash(path: string): string;
17/**
18 * Find path relative from base, if base matches.
19 *
20 * @param path Path to match against.
21 * @param start Search start.
22 * @param nocase Match case-insensitive.
23 * @returns Returns path, or null.
24 */
25export declare function pathRelativeBase(path: string, start: string, nocase?: boolean): string | null;
26/**
27 * Same as pathRelativeBase, but retuns true on a match, else false.
28 *
29 * @param path Path to match against.
30 * @param start Search start.
31 * @param nocase Match case-insensitive.
32 * @returns Returns true on match, else false.
33 */
34export declare function pathRelativeBaseMatch(path: string, start: string, nocase?: boolean): boolean;
35/**
36 * Trim a file extenion.
37 *
38 * @param path File path.
39 * @param ext File extension.
40 * @param nocase Match case-insensitive.
41 * @returns Path without file extension.
42 */
43export declare function trimExtension(path: string, ext: string, nocase?: boolean): string;
44/**
45 * Get launcher data for an ID.
46 *
47 * @param id Laucher ID.
48 * @returns Launcher data.
49 */
50export declare function launcher(id: string): Promise<Uint8Array>;