UNPKG

@image-tracer-ts/browser

Version:

Platform-specific bindings for image-tracer-ts. Turn images into SVG files in browsers.

25 lines (20 loc) 1.26 kB
import { ImageTracer, Options, ImageDrawer } from '@image-tracer-ts/core'; export * from '@image-tracer-ts/core'; declare class ImageTracerBrowser extends ImageTracer { static fromUrl<OutputType = string>(url: string, options: Partial<Options>, drawer?: ImageDrawer<OutputType> | null): Promise<string | OutputType>; static fromBuffer<OutputType = string>(buffer: ArrayBuffer, options: Partial<Options>, drawer?: ImageDrawer<OutputType> | null): Promise<string | OutputType>; static fromFile<OutputType = string>(file: File, options: Partial<Options>, drawer?: ImageDrawer<OutputType> | null): Promise<string | OutputType>; static fromImageData<OutputType = string>(imageData: ImageData, options: Partial<Options>, drawer?: ImageDrawer<OutputType> | null): Promise<string | OutputType>; } declare namespace ImageLoader { function loadUrl(url: string): Promise<ImageData>; function loadImageDataFromBuffer(buffer: ArrayBuffer): Promise<ImageData>; function loadImageDataFromFile(file: File): Promise<ImageData>; function loadImageDataFromBytes(bytes: Uint8Array): Promise<ImageData>; } declare global { interface Window { imageTracer: typeof ImageTracerBrowser; } } export { ImageLoader, ImageTracerBrowser };