UNPKG

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