/** * Shared optimization types. Pure type declarations — zero runtime weight, * safe to import from any entry or worker script. */ import type { PluginName } from "./plugin.js"; /** Anything a plugin slot accepts: a known name or a raw svgo spelling. */ export type PluginInput = PluginName | string; /** One plugin entry inside `Config.plugins`. */ export interface PluginDescriptor { name: string; params?: Record; } /** svgo.json-shaped optimization config. */ export interface Config { /** Run the plugin set until the output stabilizes. */ multipass?: boolean; /** Global float precision (undefined = library default). */ floatPrecision?: number; /** Explicit plugin list; omitted selects svgo's `preset-default`. */ plugins?: Array; /** Output formatting (js2svg). */ js2svg?: { pretty?: boolean; finalNewline?: boolean; indent?: number; eol?: "lf" | "crlf"; }; /** Output encoding: base64 / enc vibrating URI / unenc. */ datauri?: "base64" | "enc" | "unenc"; /** Source path used for error messages and relative references. */ path?: string; /** * Binding-level hint: offload this optimization to a dedicated module worker * (browser and Node, wherever a `Worker` global exists) so the calling * thread stays responsive. Falls back to the main thread when unavailable. * This option is never sent to the engine. */ worker?: boolean; [key: string]: unknown; } /** Result of a successful `optimize` call. */ export interface OptimizeResult { data: string; } /** Structured fields carried on {@link SvgoError}. */ export interface OptimizeErrorDetails { message: string; status: number; kind: "parse" | "config" | "internal"; } /** Raw exports of the glue-free wasm module. */ export interface WasmExports { memory: WebAssembly.Memory; svg_alloc(size: number): number; svg_free(ptr: number, size: number): void; svg_optimize(inputPtr: number, inputLen: number, configPtr: number, configLen: number, outPtr: number): number; svg_plugin_names(outPtr: number): number; } /** * Totally free of imports and side effects: load the listed wasm URL into a * `Uint8Array` however the caller likes (fetch, fs, cache…). */ export type WasmLoader = (url: string | URL) => Promise; //# sourceMappingURL=types.d.ts.map