import { CancelableRequest, Response } from 'got'; import { SnowpackConfig, BuildScript } from './config'; export declare const PIKA_CDN = "https://cdn.pika.dev"; export declare const GLOBAL_CACHE_DIR: any; export declare const RESOURCE_CACHE: string; export declare const BUILD_CACHE: string; export declare const PROJECT_CACHE_DIR: any; export declare const DEV_DEPENDENCIES_DIR: string; export declare const HAS_CDN_HASH_REGEX: RegExp; export declare const HTML_JS_REGEX: RegExp; export interface ImportMap { imports: { [packageName: string]: string; }; } export interface CommandOptions { cwd: string; config: SnowpackConfig; lockfile: ImportMap | null; pkgManifest: any; } export declare function isYarn(cwd: string): boolean; export declare function readLockfile(cwd: string): Promise; export declare function writeLockfile(loc: string, importMap: ImportMap): Promise; export declare function fetchCDNResource(resourceUrl: string, responseType?: 'text' | 'json' | 'buffer'): Promise>; export declare function isTruthy(item: T | false | null | undefined): item is T; /** Get the package name + an entrypoint within that package (if given). */ export declare function parsePackageImportSpecifier(imp: string): [string, string | null]; /** * Given a package name, look for that package's package.json manifest. * Return both the manifest location (if believed to exist) and the * manifest itself (if found). * * NOTE: You used to be able to require() a package.json file directly, * but now with export map support in Node v13 that's no longer possible. */ export declare function resolveDependencyManifest(dep: string, cwd: string): [string | null, any | null]; /** * If Rollup erred parsing a particular file, show suggestions based on its * file extension (note: lowercase is fine). */ export declare const MISSING_PLUGIN_SUGGESTIONS: { [ext: string]: string; }; export declare function openInBrowser(protocol: string, port: number, browser: string): Promise; export declare function checkLockfileHash(dir: string): Promise; export declare function updateLockfileHash(dir: string): Promise; export declare function clearCache(): Promise<[void, void, void]>; /** * Given an import string and a list of scripts, return the mount script that matches the import. * * `mount ./src --to /_dist_` and `mount src --to /_dist_` match `src/components/Button` * `mount src --to /_dist_` does not match `package/components/Button` */ export declare function findMatchingMountScript(scripts: BuildScript[], spec: string): BuildScript | null | undefined; /** Get full extensions of files */ export declare function getExt(fileName: string): { /** base extension (e.g. `.js`) */ baseExt: string; /** full extension, if applicable (e.g. `.proxy.js`) */ expandedExt: string; };