@mindfiredigital/pivothead
Version:
PivotHead is a powerful and flexible library for creating interactive pivot tables in JavaScript applications. It provides a core engine for data manipulation and, in the future, will be compatible with wrappers for React, Vue, Svelte, and Angular, making
77 lines • 1.96 kB
TypeScript
/**
* WebAssembly Loader for High-Performance CSV Parsing
*
* This module handles loading and interacting with the WASM CSV parser
* for near-native performance with large datasets.
*/
import type { WasmCSVResult, WasmModule } from '../types/interfaces';
export type { WasmCSVResult, WasmModule };
export declare class WasmLoader {
private static instance;
private wasmModule;
private isLoaded;
private loadPromise;
private constructor();
/**
* Get singleton instance
*/
static getInstance(): WasmLoader;
/**
* Check if WebAssembly is supported
*/
static isSupported(): boolean;
/**
* Load the WASM module
*/
load(): Promise<void>;
/**
* Internal method to load WASM module
*/
private _loadModule;
/**
* Check if WASM module is loaded
*/
isModuleLoaded(): boolean;
/**
* Parse CSV chunk using WASM
*/
parseCSVChunk(input: string, options?: {
delimiter?: string;
hasHeader?: boolean;
trimValues?: boolean;
}): WasmCSVResult;
/**
* Extract field from CSV data using WASM
*/
extractField(input: string, start: number, end: number, trimValues?: boolean): string;
/**
* Parse number using WASM
*/
parseNumber(input: string): number;
/**
* Detect field type using WASM
* Returns: 0=string, 1=number, 2=boolean, 3=null
*/
detectFieldType(value: string): number;
/**
* Estimate memory usage for parsed data
*/
estimateMemory(rowCount: number, colCount: number): number;
/**
* Get WASM module version
*/
getVersion(): string;
/**
* Run benchmark
*/
benchmark(input: string): number;
/**
* Unload WASM module and free resources
*/
unload(): void;
}
/**
* Singleton instance getter
*/
export declare const getWasmLoader: () => WasmLoader;
//# sourceMappingURL=WasmLoader.d.ts.map