soonspacejs
Version:
soonspacejs 2.x
47 lines (46 loc) • 2.19 kB
TypeScript
declare const hasOwn: (val: object, key: string | symbol) => key is never;
declare const isString: (val: unknown) => val is string;
declare const isBoolean: (val: unknown) => val is boolean;
declare const isNumber: (val: unknown) => val is number;
declare const isNull: (val: unknown) => val is null;
declare const isUndefined: (val: unknown) => val is null;
declare const isSymbol: (val: unknown) => val is symbol;
declare const isDate: (val: unknown) => val is Date;
declare const isArray: (arg: any) => arg is any[];
declare const isObject: <T = Record<any, any>>(val: unknown) => val is T;
declare const isFunction: (val: unknown) => val is () => void;
declare const isPromise: <T = any>(val: unknown) => val is Promise<T>;
declare const getValueType: (val: any) => string;
declare const sleep: (time: number) => Promise<void>;
declare const getAsciiString: (buf: ArrayBufferLike) => string;
declare const randomString: () => string;
declare const getExtension: (url: string) => string | undefined;
export declare const EPSILON = 0.00001;
export declare function approxZero(number: number, error?: number): boolean;
export declare function approxEquals(a: number, b: number, error?: number): boolean;
export declare function debounce(f: any, delay?: number): (...args: any) => void;
/**
* 分组
* @param list
* @param key
* @returns Map
*/
export declare function groupBy<T extends Record<string, any>, V = string>(list: T[], key: keyof T): Map<V, T[]>;
export declare const objectHandle: <T, R = any>(object: T | T[], handler: (m: T) => R) => R | R[];
export * from './log';
export * from './viewport';
export * from './MinHeap';
export * from './map';
export * from './path';
export * from './cloneDeep';
export * from './material';
export * from './network';
export * from './occlude';
export * from './task';
export * from './xml';
export * from './buffer';
export { hasOwn, };
export { isString, isBoolean, isNumber, isNull, isUndefined, isSymbol, };
export { isDate, isArray, isObject, isFunction, isPromise, };
export { getValueType, sleep, getAsciiString, randomString, getExtension, };
export { exportGltf, } from '../exporters';