cdn-resolve
Version:
Resolves import paths to their CDN equivalents
25 lines (23 loc) • 903 B
text/typescript
interface SkypackOptions {
min?: boolean;
dts?: boolean;
}
/**
* Build a Skypack URL for a given module.
* @param {string} module - The module to resolve.
* @param {SkypackOptions} options - configuration options.
* @returns {URL} The build Skypack URL.
*/
declare function buildSkypackUrl(module: string, options?: SkypackOptions): URL | undefined;
interface SkypackHeaders {
typesUrl?: string;
pinnedUrl?: string;
importUrl?: string;
}
/**
* Resolves the Skypack URL and retrieves the necessary information from the headers.
* @param {URL | string} url - The Skypack URL to resolve.
* @returns {SkypackHeaders} A promise that resolves to a SkypackResult object containing the resolved URLs.
*/
declare function resolveSkypackHeaders(url: URL | string): Promise<SkypackHeaders>;
export { type SkypackHeaders, type SkypackOptions, buildSkypackUrl, resolveSkypackHeaders };