UNPKG

taglib-wasm

Version:

TagLib-Wasm is the universal tagging library for TypeScript/JavaScript platforms: Browsers, Node.js, Deno, Bun, Cloudflare Workers, and Electron apps

26 lines 1.33 kB
export type RuntimeEnvironment = "deno-wasi" | "node-wasi" | "bun-wasi" | "browser" | "node-emscripten" | "worker" | "cloudflare"; export type WasmBinaryType = "wasi" | "emscripten"; export interface RuntimeDetectionResult { environment: RuntimeEnvironment; wasmType: WasmBinaryType; supportsFilesystem: boolean; supportsStreaming: boolean; performanceTier: 1 | 2 | 3; } /** * Check if a Node.js version meets the minimum requirement (v22.6.0+). * Returns an error message string if the version is too old, or undefined if OK. * Pass undefined for non-Node environments (always returns undefined). */ export declare function checkNodeVersion(nodeVersion: string | undefined): string | undefined; /** Shared Deno-runtime check — do not hand-roll `typeof Deno` tests (taglib-rfr). */ export declare function isDeno(): boolean; export declare function detectRuntime(): RuntimeDetectionResult; /** * Detect whether the runtime supports the Wasm `exnref` type. * Uses `WebAssembly.validate()` with a minimal probe module — synchronous and zero-cost. */ export declare function supportsExnref(): boolean; export declare function getEnvironmentDescription(env: RuntimeEnvironment): string; export declare function canLoadWasmType(wasmType: WasmBinaryType): boolean; //# sourceMappingURL=detector.d.ts.map