diff --git a/.gitignore b/.gitignore index decf41f..5e063bb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /target lib/snippets lib/deno_cache_dir.generated.js +lib/deno_cache_dir.generated.d.ts diff --git a/deno.json b/deno.json index 33d93e5..96e01d5 100644 --- a/deno.json +++ b/deno.json @@ -17,7 +17,8 @@ "rs_lib", "**/*.toml", "!lib/snippets/", - "!lib/deno_cache_dir.generated.js" + "!lib/deno_cache_dir.generated.js", + "!lib/deno_cache_dir.generated.d.ts" ] }, "exclude": ["target"], diff --git a/lib/deno_cache_dir.generated.d.ts b/lib/deno_cache_dir.generated.d.ts deleted file mode 100644 index 4aefdd0..0000000 --- a/lib/deno_cache_dir.generated.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -// deno-lint-ignore-file -// deno-fmt-ignore-file - -export interface InstantiateResult { - instance: WebAssembly.Instance; - exports: { - url_to_filename: typeof url_to_filename; - resolve_deno_dir: typeof resolve_deno_dir; - GlobalHttpCache : typeof GlobalHttpCache ; - LocalHttpCache : typeof LocalHttpCache - }; -} - -/** Gets if the Wasm module has been instantiated. */ -export function isInstantiated(): boolean; - - -/** Instantiates an instance of the Wasm module returning its functions. -* @remarks It is safe to call this multiple times and once successfully -* loaded it will always return a reference to the same object. */ -export function instantiate(): InstantiateResult["exports"]; - -/** Instantiates an instance of the Wasm module along with its exports. - * @remarks It is safe to call this multiple times and once successfully - * loaded it will always return a reference to the same object. */ -export function instantiateWithInstance(): InstantiateResult; - -/** -* @param {string} url -* @returns {string} -*/ -export function url_to_filename(url: string): string; -/** -* @param {string | undefined} [maybe_custom_root] -* @returns {string} -*/ -export function resolve_deno_dir(maybe_custom_root?: string): string; -/** -*/ -export class GlobalHttpCache { - free(): void; -/** -* @param {string} path -* @returns {GlobalHttpCache} -*/ - static new(path: string): GlobalHttpCache; -/** -* @param {string} url -* @returns {any} -*/ - getHeaders(url: string): any; -/** -* @param {string} url -* @param {string | undefined} [maybe_checksum] -* @returns {any} -*/ - get(url: string, maybe_checksum?: string): any; -/** -* @param {string} url -* @param {any} headers -* @param {Uint8Array} text -*/ - set(url: string, headers: any, text: Uint8Array): void; -} -/** -*/ -export class LocalHttpCache { - free(): void; -/** -* @param {string} local_path -* @param {string} global_path -* @param {boolean} allow_global_to_local_copy -* @returns {LocalHttpCache} -*/ - static new(local_path: string, global_path: string, allow_global_to_local_copy: boolean): LocalHttpCache; -/** -* @param {string} url -* @returns {any} -*/ - getHeaders(url: string): any; -/** -* @param {string} url -* @param {string | undefined} [maybe_checksum] -* @returns {any} -*/ - get(url: string, maybe_checksum?: string): any; -/** -* @param {string} url -* @param {any} headers -* @param {Uint8Array} text -*/ - set(url: string, headers: any, text: Uint8Array): void; -} diff --git a/rs_lib/src/local.rs b/rs_lib/src/local.rs index 3e66f9c..d3c5dd1 100644 --- a/rs_lib/src/local.rs +++ b/rs_lib/src/local.rs @@ -614,8 +614,12 @@ fn url_to_local_sub_path<'a>( MediaType::Tsx => ".tsx", MediaType::Css => ".css", MediaType::Json => ".json", + MediaType::Jsonc => ".jsonc", + MediaType::Json5 => ".json5", MediaType::Wasm => ".wasm", MediaType::SourceMap => ".js", + MediaType::Html => ".html", + MediaType::Sql => ".sql", MediaType::Unknown => ".js", } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 1be126d..47a730b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.89.0" +channel = "1.91.1" components = ["clippy", "rustfmt"]