/** * Simple cache decorator implementation * @param {number} maxSize - Maximum cache size * @returns {Function} Decorator function */ export function cache(maxSize?: number): Function; /** * Slice a data array into (overlapping) frames * @param {Array|Float32Array} x - Array to frame * @param {Object} options - Framing parameters * @param {number} options.frameLength - Length of each frame * @param {number} options.hopLength - Number of steps to advance between frames * @param {number} [options.axis=-1] - Axis along which to frame * @returns {Array} Array of frames */ export function frame(x: any[] | Float32Array, { frameLength, hopLength, axis }: { frameLength: number; hopLength: number; axis?: number; }): any[]; /** * Validate audio data for processing * @param {Array|Float32Array} y - Audio data to validate * @param {boolean} [mono=true] - Whether to enforce mono audio * @returns {boolean} True if valid * @throws {ParameterError} If validation fails */ export function validAudio(y: any[] | Float32Array, mono?: boolean): boolean; /** * Ensure value is integer-typed * @param {number} x - Value to cast * @param {Function} [castFn=Math.floor] - Casting function * @returns {number} Integer value */ export function validInt(x: number, castFn?: Function): number; /** * Check if value is a positive integer * @param {*} x - Value to check * @returns {boolean} True if positive integer */ export function isPositiveInt(x: any): boolean; /** * Pad array to center data * @param {Array} data - Array to pad * @param {Object} options - Padding options * @param {number} options.size - Target size * @param {number} [options.axis=-1] - Axis to pad along * @param {string} [options.mode='constant'] - Padding mode * @param {number} [options.constantValue=0] - Value for constant padding * @returns {Array} Padded array */ export function padCenter(data: any[], { size, axis, mode, constantValue }: { size: number; axis?: number; mode?: string; constantValue?: number; }): any[]; /** * Fix array length by padding or trimming * @param {Array} data - Array to fix * @param {Object} options - Fix options * @param {number} options.size - Target size * @param {number} [options.axis=-1] - Axis along which to fix * @param {string} [options.mode='constant'] - Padding mode if needed * @param {number} [options.constantValue=0] - Value for constant padding * @returns {Array} Fixed-length array */ export function fixLength(data: any[], { size, axis, mode, constantValue }: { size: number; axis?: number; mode?: string; constantValue?: number; }): any[]; /** * Normalize array along an axis * @param {Array} S - Array to normalize * @param {Object} options - Normalization options * @param {number|null} [options.norm=Infinity] - Norm type (1, 2, Infinity, or null) * @param {number} [options.axis=0] - Axis to normalize along * @param {number|null} [options.threshold=null] - Threshold for small norms * @param {boolean|null} [options.fill=null] - How to handle small norms * @returns {Array} Normalized array */ export function normalize(S: any[], { norm, axis, threshold, fill }?: { norm?: number | null; axis?: number; threshold?: number | null; fill?: boolean | null; }): any[]; /** * Find local maxima in an array * @param {Array} x - Input array * @param {Object} options - Detection options * @param {number} [options.axis=0] - Axis along which to compute * @returns {Array} Boolean array indicating local maxima */ export function localmax(x: any[], { axis }?: { axis?: number; }): any[]; /** * Find local minima in an array * @param {Array} x - Input array * @param {Object} options - Detection options * @param {number} [options.axis=0] - Axis along which to compute * @returns {Array} Boolean array indicating local minima */ export function localmin(x: any[], { axis }?: { axis?: number; }): any[]; /** * Peak picking algorithm with advanced filtering * @param {Array} x - Input signal * @param {Object} options - Peak picking parameters * @param {number} options.preMax - Samples before n for max computation * @param {number} options.postMax - Samples after n for max computation * @param {number} options.preAvg - Samples before n for mean computation * @param {number} options.postAvg - Samples after n for mean computation * @param {number} options.delta - Threshold offset for mean * @param {number} options.wait - Samples to wait after picking a peak * @param {boolean} [options.sparse=true] - Return sparse indices or dense array * @returns {Array} Peak indices (sparse) or boolean array (dense) */ export function peakPick(x: any[], { preMax, postMax, preAvg, postAvg, delta, wait, sparse }: { preMax: number; postMax: number; preAvg: number; postAvg: number; delta: number; wait: number; sparse?: boolean; }): any[]; /** * Compute tiny value for numeric precision * @param {number|Array} x - Value to get precision limit for * @returns {number} Tiny value for the data type */ export function tiny(_x: any): number; /** * Compute squared magnitude efficiently * @param {number|Array|Object} x - Input value, array, or complex number * @param {string} [dtype] - Optional output data type (ignored in JS) * @returns {number|Array} Squared magnitude */ export function abs2(x: number | any[] | any, _dtype: any): number | any[]; /** * Construct complex phasor from angles * @param {number|Array} angles - Angles in radians * @param {Object} options - Phasor options * @param {number|Array} [options.mag] - Optional magnitude scaling * @returns {Object|Array} Complex phasor(s) with real and imag components */ export function phasor(angles: number | any[], { mag }?: { mag?: number | any[]; }): any | any[]; /** * Utility for finding indices and values * @param {Array} arr - Array to search * @param {Function} predicate - Test function * @returns {Array} Indices where predicate is true */ export function findIndices(arr: any[], predicate: Function): any[]; /** * Create evenly spaced values * @param {number} start - Start value * @param {number} stop - Stop value * @param {number} num - Number of values * @returns {Array} Evenly spaced values */ export function linspace(start: number, stop: number, num: number): any[]; /** * Check MP3 playback support and optionally show a warning banner. * * @returns {string} The result of canPlayType for 'audio/mp3'. */ export function warnIfNoMp3Support(): string; /** * Aggregate a multi-dimensional array between specified boundaries * Synchronizes features to segment boundaries * @param {Array} data - Feature matrix [d x t] * @param {Array} idx - Segment boundaries (slices or indices) * @param {Function|null} aggregate - Aggregation function (default: mean) * @param {boolean} pad - Pad boundaries * @param {number} axis - Time axis * @returns {Array} Synchronized features [d x n_segments] */ export function sync(data: any[], idx: any[], aggregate?: Function | null, pad?: boolean, axis?: number): any[]; /** * Short-term history embedding: vertically concatenate a data vector or matrix * with delayed copies of itself * @param {Array} data - Feature matrix [d x t] * @param {number} n_steps - Number of history steps (delay taps) * @param {number} delay - Delay between steps * @param {Object} kwargs - Additional arguments * @returns {Array} Stacked features [(n_steps * d) x t] */ export function stack_memory(data: any[], n_steps?: number, delay?: number, kwargs?: any): any[]; /** * Shear a matrix by a given factor * * Applies a shearing transformation along the specified axis * Used for time-frequency analysis and spectrogram enhancement * * @param {Array} X - Input matrix [n_rows][n_cols] * @param {number} factor - Shear factor (default 1) * @param {number} axis - Axis to shear (-1 for time/columns, 0 for frequency/rows) * @returns {Array} Sheared matrix */ export function shear(X: any[], factor?: number, axis?: number): any[]; /** * Sort an array along its rows or columns * * @param {Array} S - Input array [n_rows][n_cols] * @param {number} axis - Axis to sort (0 for rows, -1 for columns) * @param {boolean} index - If true, return indices instead of sorted values * @param {Function} value - Optional function to compute sort values * @returns {Array|Object} Sorted array or {values, indices} */ export function axis_sort(S: any[], axis?: number, index?: boolean, value?: Function): any[] | any; /** * Expand the dimensions of an input array * * @param {Array} x - Input array * @param {number} ndim - Target number of dimensions * @param {Array|number} axes - Axes to preserve (others will be singleton) * @returns {Array} Expanded array */ export function expand_to(x: any[], ndim: number, axes: any[] | number): any[]; /** * Set all cells of a matrix to a given value if they're outside a diagonal band * * @param {Array} x - Input matrix (modified in place) [n][n] * @param {number} radius - Diagonal band radius * @param {number} value - Fill value (default 0) */ export function fill_off_diagonal(x: any[], radius: number, value?: number): void; /** * Return a row-sparse matrix approximating the input * * Retains only values above a quantile threshold in each row, * setting others to zero (creating a sparse-like structure) * * @param {Array} x - Input matrix [n_rows][n_cols] * @param {number} quantile - Quantile threshold (0-1, default 0.01) * @param {String} dtype - Output data type (ignored in JS) * @returns {Array} Sparsified matrix */ export function sparsify_rows(x: any[], quantile?: number, dtype?: string): any[]; /** * Determine whether a variable contains valid audio data * * Valid audio must be: * - A typed array or regular array * - One-dimensional * - Finite (no NaN or Infinity values) * - Non-empty * * @param {Array|Float32Array|Float64Array} y - Input audio data * @param {boolean} mono - If true, require strictly 1D (default: true) * @returns {boolean} True if audio data is valid * * @example * valid_audio([1, 2, 3]) // true * valid_audio([NaN, 1, 2]) // false * valid_audio([]) // false */ export function valid_audio(y: any[] | Float32Array | Float64Array, mono?: boolean): boolean; /** * Ensure that an input value is integer-typed * * @param {number} x - Input value * @param {Function} cast - Optional casting function (default: Math.round) * @returns {number} Integer value * @throws {ParameterError} If input cannot be cast to integer * * @example * valid_int(3.7) // 4 * valid_int(3.7, Math.floor) // 3 * valid_int(NaN) // throws ParameterError */ export function valid_int(x: number, cast?: Function): number; /** * Ensure that an array is a valid representation of time intervals * * Valid intervals must be: * - A 2D array with shape [n, 2] * - All values finite * - interval[i][0] <= interval[i][1] for all i (start <= end) * - Non-negative times (if required) * * @param {Array} intervals - Array of [start, end] time intervals * @returns {boolean} True if intervals are valid * * @example * valid_intervals([[0, 1], [1, 2], [2, 3]]) // true * valid_intervals([[0, 1], [2, 1]]) // false (end < start) * valid_intervals([[0, 1, 2]]) // false (wrong shape) */ export function valid_intervals(intervals: any[]): boolean; /** * Convert an integer buffer to floating point values * * @param {TypedArray|Array} x - Integer buffer to convert * @param {number} n_bytes - Number of bytes per sample (1, 2, or 4) * @param {String} dtype - Output dtype (ignored in JS, always returns Float32Array) * @returns {Float32Array} Normalized floating point values in range [-1, 1] */ export function buf_to_float(x: TypedArray | any[], n_bytes?: number, dtype?: string): Float32Array; /** * Count the number of unique values in a multi-dimensional array along an axis * * @param {Array} data - Input array * @param {number} axis - Axis along which to count unique values (default: -1) * @returns {Array|number} Count(s) of unique values */ export function count_unique(data: any[], axis?: number): any[] | number; /** * Estimate the gradient of a function over a uniformly sampled periodic domain * * @param {Array} data - Input array * @param {number} edge_order - Gradient accuracy at boundaries (1 or 2, default: 1) * @param {number} axis - Axis along which to compute gradient (default: -1) * @returns {Array} Gradient array (same shape as input) */ export function cyclic_gradient(data: any[], edge_order?: number, axis?: number): any[]; /** * Find the real numpy dtype corresponding to a complex dtype * * In JavaScript, we just return appropriate TypedArray constructors * * @param {String|Function} d - Complex dtype identifier * @param {Function} default_type - Default real type (default: Float32Array) * @returns {Function} Real TypedArray constructor */ export function dtype_c2r(d: string | Function, default_type?: Function): Function; /** * Find the complex numpy dtype corresponding to a real dtype * * In JavaScript, complex numbers are typically represented as objects {real, imag} * or pairs of Float32/Float64Arrays, so we return the appropriate float type * * @param {String|Function} d - Real dtype identifier * @param {Function} default_type - Default complex type (default: Float32Array) * @returns {Function} Complex-compatible TypedArray constructor */ export function dtype_r2c(d: string | Function, default_type?: Function): Function; /** * Fix a list of frames to lie within [x_min, x_max] * * @param {Array} frames - Frame indices to fix * @param {number} x_min - Minimum allowed frame index (default: 0) * @param {number} x_max - Maximum allowed frame index (default: null, no upper bound) * @param {boolean} pad - If true, pad to ensure coverage of [x_min, x_max] (default: true) * @returns {Array} Fixed frame indices */ export function fix_frames(frames: any[], x_min?: number, x_max?: number, pad?: boolean): any[]; /** * Generate a slice array from an index array * * @param {Array} idx - Sorted array of indices * @param {number} idx_min - Minimum index (default: null, use min of idx) * @param {number} idx_max - Maximum index (default: null, use max of idx) * @param {number} step - Step size (default: null, infer from idx) * @param {boolean} pad - Pad to cover [idx_min, idx_max] (default: true) * @returns {Array} Array of {start, end, step} slice objects */ export function index_to_slice(idx: any[], idx_min?: number, idx_max?: number, step?: number, pad?: boolean): any[]; /** * Determine if the input array consists of all unique values along an axis * * @param {Array} data - Input array * @param {number} axis - Axis along which to check uniqueness (default: -1) * @returns {boolean|Array} True/false or array of boolean values */ export function is_unique(data: any[], axis?: number): boolean | any[]; /** * Stack one or more arrays along a target axis * * @param {Array} arrays - List of arrays to stack * @param {number} axis - Axis along which to stack (default: 0) * @returns {Array} Stacked array */ export function stack(arrays: any[], axis?: number): any[]; /** * Get the FFT library currently used by pleco-audio * * Returns information about the FFT implementation being used. * In JavaScript, this always returns the native Web Audio API FFT. * * @returns {Object} FFT library information * * @example * const fftInfo = get_fftlib(); * console.log(fftInfo.name); // 'Web Audio API' * console.log(fftInfo.backend); // 'native' */ export function get_fftlib(): any; /** * Set the FFT library used by pleco-audio * * In JavaScript/browser environment, FFT is always provided by Web Audio API. * This function exists for API compatibility but has no effect. * * @param {string} lib - FFT library name (ignored, for API compatibility) * * @example * set_fftlib('native'); // No effect, always uses Web Audio API * console.warn('FFT library is always Web Audio API in browser'); */ export function set_fftlib(lib?: string): any; /** * Jaccard similarity between two intervals * * Computes the Jaccard index (intersection over union) between two intervals. * * @private * @param {Array} int_a - First interval [start, end] * @param {Array} int_b - Second interval [start, end] * @returns {number} Jaccard similarity [0, 1] */ export function __jaccard(int_a: any[], int_b: any[]): number; /** * Event matching core algorithm * * Matches events from one sequence to another using nearest neighbor search. * * @private * @param {Array|Float32Array} output - Output array to fill with matches * @param {Array|Float32Array} events_from - Source events * @param {Array|Float32Array} events_to - Target events to match against * @param {boolean} left - Include left boundary (default: true) * @param {boolean} right - Include right boundary (default: true) */ export function __match_events_helper(output: any[] | Float32Array, events_from: any[] | Float32Array, events_to: any[] | Float32Array, left?: boolean, right?: boolean): void; /** * Find best Jaccard match from query to candidates * * @private * @param {Array} query - Query interval [start, end] * @param {Array} intervals_to - Array of candidate intervals * @param {Array} candidates - Array of candidate indices to check * @returns {number} Index of best matching interval, or -1 if no match */ export function __match_interval_overlaps(query: any[], intervals_to: any[], candidates: any[]): number; /** * Interval matching algorithm * * Matches intervals from one set to another using Jaccard similarity. * * @private * @param {Array} intervals_from - Source intervals [[start, end], ...] * @param {Array} intervals_to - Target intervals to match against * @param {boolean} strict - If true, only match if Jaccard > 0 (default: true) * @returns {Array} Array of matched indices */ export function __match_intervals(intervals_from: any[], intervals_to: any[], strict?: boolean): any[]; /** * Shear a dense array * * Applies shearing transformation to a dense array. * Shearing shifts each row/column by a factor proportional to its index. * * @private * @param {Array} X - Input 2D array * @param {number} factor - Shearing factor (+1 or -1, default: +1) * @param {number} axis - Axis to shear along (-1 for columns, 0 for rows, default: -1) * @returns {Array} Sheared array */ export function __shear_dense(X: any[], factor?: number, axis?: number): any[]; /** * Shear a sparse matrix * * Fast shearing for sparse matrices represented as coordinate lists. * * @private * @param {Object} X - Sparse matrix {rows: [], cols: [], data: [], shape: [m, n]} * @param {number} factor - Shearing factor (+1 or -1, default: +1) * @param {number} axis - Axis to shear along (-1 for columns, 0 for rows, default: -1) * @returns {Object} Sheared sparse matrix */ export function __shear_sparse(X: any, factor?: number, axis?: number): any; /** * Stencil for local maxima computation * * Numba stencil operation in Python, simplified for JavaScript. * Checks if the center value is a local maximum. * * @private * @param {Array} x - 3-element window [left, center, right] * @returns {boolean} True if center is local maximum */ export function __localmax_sten(x: any[]): boolean; /** * Vectorized wrapper for local maxima stencil * * @private * @param {Array|Float32Array} x - Input array * @param {Array|Float32Array} y - Output array (boolean/0-1 values) */ export function _localmax(x: any[] | Float32Array, y: any[] | Float32Array): void; /** * Stencil for local minima computation * * @private * @param {Array} x - 3-element window [left, center, right] * @returns {boolean} True if center is local minimum */ export function __localmin_sten(x: any[]): boolean; /** * Vectorized wrapper for local minima stencil * * @private * @param {Array|Float32Array} x - Input array * @param {Array|Float32Array} y - Output array (boolean/0-1 values) */ export function _localmin(x: any[] | Float32Array, y: any[] | Float32Array): void; /** * Count unique values in an array * * @private * @param {Array|Float32Array} x - Input array * @returns {number} Number of unique values */ export function __count_unique(x: any[] | Float32Array): number; /** * Determine if array has all unique values * * @private * @param {Array|Float32Array} x - Input array * @returns {boolean} True if all values are unique */ export function __is_unique(x: any[] | Float32Array): boolean; /** * Vectorized wrapper for peak-picking algorithm * * Identifies peaks in a signal based on local maxima and thresholds. * * @private * @param {Array|Float32Array} x - Input signal * @param {number} pre_max - Number of samples before current for local maximum * @param {number} post_max - Number of samples after current for local maximum * @param {number} pre_avg - Number of samples before current for moving average * @param {number} post_avg - Number of samples after current for moving average * @param {number} delta - Threshold offset for peak detection * @param {number} wait - Minimum gap between peaks * @param {Array|Float32Array} peaks - Output array to fill with peak indices * @returns {number} Number of peaks found */ export function __peak_pick(x: any[] | Float32Array, pre_max: number, post_max: number, pre_avg: number, post_avg: number, delta: number, wait: number, peaks: any[] | Float32Array): number; /** * Efficiently compute abs2 on complex inputs * * For complex number a + bi, returns a^2 + b^2 (magnitude squared). * * @private * @param {number|Object} x - Real number or complex {re, im} object * @returns {number} Squared magnitude */ export function _cabs2(x: number | any): number; /** * Phasor angle computation helper * * Computes the complex phasor (unit magnitude complex number) for given angles. * * @private * @param {Array|Float32Array} x - Array of angles in radians * @returns {Array} Array of complex phasors [{re, im}, ...] */ export function _phasor_angles(x: any[] | Float32Array): any[]; /** * Ensure array is contiguous (JavaScript equivalent) * * In JavaScript, typed arrays are always contiguous. * This is a no-op that ensures compatibility. * * @private * @param {Array|TypedArray} x - Input array * @returns {TypedArray} Contiguous array (Float32Array) */ export function __ascontiguousarray(x: any[] | TypedArray): TypedArray; /** * Memory-stacking helper function * * Stacks features with a time-delay embedding. * Creates a lagged representation of features for temporal modeling. * * @private * @param {Array} history - Historical feature matrix buffer * @param {Array} data - New data to add * @param {number} n_steps - Number of time steps to stack * @param {number} delay - Delay between steps * @returns {Array} Stacked feature matrix */ export function __stack(history: any[], data: any[], n_steps: number, delay: number): any[]; /** * Generic decorator wrapper for applying decorators to functions * Private helper - JavaScript equivalent of Python's decorator wrapper pattern * * Used internally by deprecated(), moved(), and vectorize() decorators. * * @private * @param {Function} decorator - Decorator function to apply * @param {Function} fn - Function to wrap * @param {...any} args - Arguments to pass to decorator * @returns {Function} Wrapped function */ export function __wrapper(decorator: Function, fn: Function, ...args: any[]): Function; /** * Vectorize a scalar function to work on arrays * Private helper - JavaScript equivalent of numpy.vectorize * * Creates a vectorized version of a function that applies element-wise * to array inputs. * * @private * @param {Function} fn - Scalar function to vectorize * @param {...any} args - Arguments (arrays or scalars) * @returns {any|Array} Result (scalar if all inputs scalar, array otherwise) */ export function _vec(fn: Function, ...args: any[]): any | any[]; /** * Create a vectorized version of a function * JavaScript equivalent of numpy.vectorize decorator * * Returns a function that automatically applies element-wise to array inputs. * Supports broadcasting of scalar arguments. * * @param {Function} fn - Scalar function to vectorize * @param {Object} options - Vectorization options * @param {boolean} options.signature - Function signature (optional, for documentation) * @param {string} options.otypes - Output types (optional, ignored in JS) * @returns {Function} Vectorized function * * @example * // Vectorize a scalar function * const scalarAdd = (a, b) => a + b; * const vectorAdd = vectorize(scalarAdd); * * vectorAdd(1, 2); // 3 (scalar inputs) * vectorAdd([1, 2, 3], 10); // [11, 12, 13] (broadcast scalar) * vectorAdd([1, 2], [3, 4]); // [4, 6] (element-wise) * * @example * // Use as decorator pattern * function square(x) { return x * x; } * const vectorSquare = vectorize(square); * vectorSquare([1, 2, 3, 4]); // [1, 4, 9, 16] */ export function vectorize(fn: Function, options?: { signature: boolean; otypes: string; }): Function; /** * Get list of files matching a pattern * * In browser environment, works with File objects from FileList or drag-drop. * Cannot access arbitrary filesystem paths (browser security restriction). * * @param {FileList|Array} files - File list or array of File objects * @param {string|RegExp} pattern - Pattern to match filenames against * @returns {Array} Filtered list of matching files * * @example * // Filter files from file input * const input = document.querySelector('input[type="file"]'); * input.addEventListener('change', (e) => { * const audioFiles = __get_files(e.target.files, /\.(mp3|wav|ogg)$/i); * console.log('Audio files:', audioFiles.map(f => f.name)); * }); */ export function __get_files(files: FileList | Array, pattern?: string | RegExp): Array; /** * Load a resource file from package data * * In browser environment, loads resources from URLs or embedded data. * Returns a promise that resolves to the resource content. * * @param {string} packageName - Package or module name (e.g., 'pleco-audio') * @param {string} resourcePath - Resource path relative to package * @param {string} responseType - Expected response type: 'json', 'text', 'blob', 'arrayBuffer' * @returns {Promise} Resource content * * @example * // Load JSON resource * const data = await _resource_file('pleco-audio', 'data/example.json', 'json'); * console.log(data); * * @example * // Load audio file * const audioBlob = await _resource_file('pleco-audio', 'samples/test.wav', 'blob'); * const audioUrl = URL.createObjectURL(audioBlob); */ export function _resource_file(packageName: string, resourcePath: string, responseType?: string): Promise; /** * Get version of a module or package * * Returns version information for loaded modules/packages. * In browser environment, checks package.json or embedded version metadata. * * @param {string} moduleName - Module name to get version for * @returns {string|null} Version string (e.g., '1.0.0') or null if unknown * * @example * const version = __get_mod_version('pleco-audio'); * console.log(`pleco-audio version: ${version}`); * * @example * // Check multiple dependencies * const modules = ['pleco-audio', 'd3', 'tone']; * modules.forEach(mod => { * console.log(`${mod}: ${__get_mod_version(mod) || 'unknown'}`); * }); */ export function __get_mod_version(moduleName: string): string | null; /** * Return the version information for pleco-audio and its dependencies * * Displays library version, browser environment, and Web Audio API support. * * @returns {Object} Version information object * * @example * const versions = show_versions(); * console.log(versions.library); // 'pleco-audio' * console.log(versions.version); // '1.0.0' * console.log(versions.environment); // 'browser' * * @example * // Print formatted version info * show_versions(); // Logs version table to console */ export function show_versions(): any; /** * Utility Functions for JavaScript * Core signal processing utilities for audio analysis * Provides framing, validation, normalization, and peak detection */ export const MAX_MEM_BLOCK: number; /** * Custom error class for parameter validation */ export class ParameterError extends Error { constructor(message: any); } /** * Check if value is a positive integer * @param {*} x - Value to check * @returns {boolean} True if positive integer */ export function is_positive_int(x: any): boolean; export { softmask } from "./xa-normalize.js"; /** * Any JavaScript typed-array view over an ArrayBuffer. */ export type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array;