UNPKG

2.56 kBTypeScriptView Raw
1export * from './mainthread-helper';
2export * from './macrotask-scheduler';
3export declare const RESOURCE_PREFIX = "res://";
4export declare const FILE_PREFIX = "file:///";
5export declare function escapeRegexSymbols(source: string): string;
6export declare function convertString(value: any): any;
7export declare function getModuleName(path: string): string;
8/**
9 * Helps sanitize a module name if it is prefixed with '~/', '~' or '/'
10 * @param moduleName the name
11 * @param removeExtension whether to remove extension
12 */
13export declare function sanitizeModuleName(moduleName: string, removeExtension?: boolean): string;
14export declare function isFileOrResourcePath(path: string): boolean;
15export declare function isFontIconURI(uri: string): boolean;
16export declare function isDataURI(uri: string): boolean;
17/**
18 * Get file extension from file path
19 * @param path file path
20 * @returns file extension
21 */
22export declare function getFileExtension(path: string): string;
23export declare function mergeSort(arr: any, compareFunc: any): any;
24export declare function merge(left: any, right: any, compareFunc: any): any[];
25export declare function hasDuplicates(arr: Array<any>): boolean;
26export declare function eliminateDuplicates(arr: Array<any>): Array<any>;
27export declare function executeOnMainThread(func: Function): any;
28export declare function executeOnUIThread(func: Function): void;
29export declare function mainThreadify(func: Function): (...args: any[]) => void;
30export declare function debounce(fn: any, delay?: number, { leading }?: {
31 leading?: boolean;
32}): (...args: Array<any>) => void;
33export declare function throttle(fn: Function, delay?: number): (...args: any[]) => void;
34export declare function queueGC(delay?: number, useThrottle?: boolean): void;
35export declare function isEmoji(value: string): boolean;
36/**
37 * Default animation values used throughout core
38 */
39export declare const CORE_ANIMATION_DEFAULTS: {
40 duration: number;
41 spring: {
42 tension: number;
43 friction: number;
44 mass: number;
45 velocity: number;
46 };
47};
48/**
49 * Get a duration with damping value from various spring related settings.
50 * Helpful when needing to convert spring settings to isolated duration value.
51 * @param springSettings various spring settings
52 * @returns calculated duration with damping from spring settings
53 */
54export declare function getDurationWithDampingFromSpring(springSettings?: {
55 tension?: number;
56 friction?: number;
57 mass?: number;
58 velocity?: number;
59}): {
60 duration: number;
61 damping: number;
62};