@nativescript/core
Version:
A JavaScript library providing an easy to use api for interacting with iOS and Android platform APIs.
64 lines (63 loc) • 2.61 kB
TypeScript
export * from './mainthread-helper';
export * from './macrotask-scheduler';
export declare const RESOURCE_PREFIX = "res://";
export declare const SYSTEM_PREFIX = "sys://";
export declare const FILE_PREFIX = "file:///";
export declare function escapeRegexSymbols(source: string): string;
export declare function convertString(value: any): any;
export declare function getModuleName(path: string): string;
/**
* Helps sanitize a module name if it is prefixed with '~/', '~' or '/'
* @param moduleName the name
* @param removeExtension whether to remove extension
*/
export declare function sanitizeModuleName(moduleName: string, removeExtension?: boolean): string;
export declare function isFileOrResourcePath(path: string): boolean;
export declare function isFontIconURI(uri: string): boolean;
export declare function isDataURI(uri: string): boolean;
/**
* Get file extension from file path
* @param path file path
* @returns file extension
*/
export declare function getFileExtension(path: string): string;
export declare function mergeSort(arr: any, compareFunc: any): any;
export declare function merge(left: any, right: any, compareFunc: any): any[];
export declare function hasDuplicates(arr: Array<any>): boolean;
export declare function eliminateDuplicates(arr: Array<any>): Array<any>;
export declare function executeOnMainThread(func: Function): any;
export declare function executeOnUIThread(func: Function): void;
export declare function mainThreadify(func: Function): (...args: any[]) => void;
export declare function debounce(fn: any, delay?: number, { leading }?: {
leading?: boolean;
}): (...args: Array<any>) => void;
export declare function throttle(fn: Function, delay?: number): (...args: any[]) => void;
export declare function queueGC(delay?: number, useThrottle?: boolean): void;
export declare function isEmoji(value: string): boolean;
/**
* Default animation values used throughout core
*/
export declare const CORE_ANIMATION_DEFAULTS: {
duration: number;
spring: {
tension: number;
friction: number;
mass: number;
velocity: number;
};
};
/**
* Get a duration with damping value from various spring related settings.
* Helpful when needing to convert spring settings to isolated duration value.
* @param springSettings various spring settings
* @returns calculated duration with damping from spring settings
*/
export declare function getDurationWithDampingFromSpring(springSettings?: {
tension?: number;
friction?: number;
mass?: number;
velocity?: number;
}): {
duration: number;
damping: number;
};