1 |
|
2 | import { SkypackSDK } from '../vendor/types/skypack';
|
3 | import { ImportMap, LockfileManifest, PackageSource, SnowpackConfig } from './types';
|
4 | export declare const GLOBAL_CACHE_DIR: any;
|
5 | export declare const LOCKFILE_NAME = "snowpack.deps.json";
|
6 | export declare const NATIVE_REQUIRE: any;
|
7 | export declare const remotePackageSDK: SkypackSDK;
|
8 | export declare const BUILD_CACHE: string;
|
9 | export declare const HTML_JS_REGEX: RegExp;
|
10 | export declare const HTML_STYLE_REGEX: RegExp;
|
11 | export declare const CSS_REGEX: RegExp;
|
12 | export declare const SVELTE_VUE_REGEX: RegExp;
|
13 |
|
14 |
|
15 |
|
16 | export declare function deleteFromBuildSafe(dir: string, config: SnowpackConfig): void;
|
17 |
|
18 | export declare function readFile(filepath: URL): Promise<string | Buffer>;
|
19 | export declare function readLockfile(cwd: string): Promise<LockfileManifest | null>;
|
20 | export declare function convertLockfileToSkypackImportMap(origin: string, lockfile: LockfileManifest): ImportMap;
|
21 | export declare function convertSkypackImportMapToLockfile(dependencies: Record<string, string>, importMap: ImportMap): LockfileManifest;
|
22 | export declare function writeLockfile(loc: string, importMap: LockfileManifest): Promise<void>;
|
23 | export declare function isTruthy<T>(item: T | false | null | undefined): item is T;
|
24 | export declare function getPackageSource(source: 'remote' | 'local'): PackageSource;
|
25 |
|
26 |
|
27 |
|
28 |
|
29 | export declare function isFsEventsEnabled(): boolean;
|
30 |
|
31 | export declare function parsePackageImportSpecifier(imp: string): [string, string | null];
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | export declare function resolveDependencyManifest(dep: string, cwd: string): [string | null, any | null];
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | export declare const MISSING_PLUGIN_SUGGESTIONS: {
|
46 | [ext: string]: string;
|
47 | };
|
48 | export declare function openInBrowser(protocol: string, hostname: string, port: number, browser: string): Promise<void>;
|
49 | export declare function checkLockfileHash(dir: string): Promise<boolean>;
|
50 | export declare function updateLockfileHash(dir: string): Promise<void>;
|
51 | export declare function clearCache(): Promise<[void, void, void]>;
|
52 |
|
53 |
|
54 |
|
55 | export declare function findMatchingAliasEntry(config: SnowpackConfig, spec: string): {
|
56 | from: string;
|
57 | to: string;
|
58 | type: 'package' | 'path' | 'url';
|
59 | } | undefined;
|
60 |
|
61 |
|
62 |
|
63 | export declare function getExtensionMatch(fileName: string, extensionMap: Record<string, string[]>): [string, string[]] | undefined;
|
64 | export declare function isRemoteUrl(val: string): boolean;
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | export declare function sanitizePackageName(filepath: string): string;
|
71 |
|
72 | export declare function cssSourceMappingURL(code: string, sourceMappingURL: string): string;
|
73 |
|
74 | export declare function jsSourceMappingURL(code: string, sourceMappingURL: string): string;
|
75 |
|
76 | export declare function relativeURL(path1: string, path2: string): string;
|
77 |
|
78 | export declare function appendHtmlToHead(doc: string, htmlToAdd: string): string;
|
79 | export declare function isJavaScript(pathname: string): boolean;
|
80 | export declare function getExtension(str: string): string;
|
81 | export declare function hasExtension(str: string, ext: string): boolean;
|
82 | export declare function replaceExtension(fileName: string, oldExt: string, newExt: string): string;
|
83 | export declare function addExtension(fileName: string, newExt: string): string;
|
84 | export declare function removeExtension(fileName: string, oldExt: string): string;
|
85 |
|
86 | export declare function addLeadingSlash(path: string): string;
|
87 |
|
88 | export declare function addTrailingSlash(path: string): string;
|
89 |
|
90 | export declare function removeLeadingSlash(path: string): string;
|
91 |
|
92 | export declare function removeTrailingSlash(path: string): string;
|
93 | export declare const HMR_CLIENT_CODE: string;
|
94 | export declare const HMR_OVERLAY_CODE: string;
|
95 | export declare const INIT_TEMPLATE_FILE: string;
|