mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
feat(hmr): preserve navigation history on applying changes (#7146)
This commit is contained in:
@@ -28,6 +28,11 @@ export function convertString(value: any): any {
|
||||
return result;
|
||||
}
|
||||
|
||||
export function getModuleName(path: string): string {
|
||||
let moduleName = path.replace("./", "");
|
||||
return moduleName.substring(0, moduleName.lastIndexOf("."));
|
||||
}
|
||||
|
||||
export module layout {
|
||||
const MODE_SHIFT = 30;
|
||||
const MODE_MASK = 0x3 << MODE_SHIFT;
|
||||
@@ -148,4 +153,4 @@ export function hasDuplicates(arr: Array<any>): boolean {
|
||||
|
||||
export function eliminateDuplicates(arr: Array<any>): Array<any> {
|
||||
return Array.from(new Set(arr));
|
||||
}
|
||||
}
|
||||
|
||||
12
tns-core-modules/utils/utils.d.ts
vendored
12
tns-core-modules/utils/utils.d.ts
vendored
@@ -185,13 +185,13 @@ export module ad {
|
||||
export module ios {
|
||||
/**
|
||||
* @deprecated use the respective native property directly
|
||||
*
|
||||
*
|
||||
* Checks if the property is a function and if it is, calls it on this.
|
||||
* Designed to support backward compatibility for methods that became properties.
|
||||
* Will not work on delegates since it checks if the propertyValue is a function, and delegates are marshalled as functions.
|
||||
* Example: getter(NSRunLoop, NSRunLoop.currentRunLoop).runUntilDate(NSDate.dateWithTimeIntervalSinceNow(waitTime));
|
||||
*/
|
||||
export function getter<T>(_this: any, propertyValue: T | {(): T}): T;
|
||||
export function getter<T>(_this: any, propertyValue: T | { (): T }): T;
|
||||
|
||||
// Common properties between UILabel, UITextView and UITextField
|
||||
export interface TextUIView {
|
||||
@@ -255,7 +255,7 @@ export module ios {
|
||||
* @param rootViewController The root UIViewController instance to start searching from (normally window.rootViewController).
|
||||
* Returns the visible UIViewController.
|
||||
*/
|
||||
export function getVisibleViewController(rootViewController: any/* UIViewController*/ ): any/* UIViewController*/;
|
||||
export function getVisibleViewController(rootViewController: any/* UIViewController*/): any/* UIViewController*/;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,6 +305,12 @@ export function escapeRegexSymbols(source: string): string
|
||||
*/
|
||||
export function convertString(value: any): any
|
||||
|
||||
/**
|
||||
* Gets module name from path.
|
||||
* @param path The module path.
|
||||
*/
|
||||
export function getModuleName(path: string): string
|
||||
|
||||
/**
|
||||
* Sorts an array by using merge sort algorithm (which ensures stable sort since the built-in Array.sort() does not promise a stable sort).
|
||||
* @param arr - array to be sorted
|
||||
|
||||
Reference in New Issue
Block a user