mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
refactor: replace var usage with let/const (#7064)
This commit is contained in:
12
tns-core-modules/platform/platform.d.ts
vendored
12
tns-core-modules/platform/platform.d.ts
vendored
@@ -8,19 +8,19 @@
|
||||
/**
|
||||
* Gets a value indicating if the app is running on the Android platform.
|
||||
*/
|
||||
export var isAndroid: boolean;
|
||||
export const isAndroid: boolean;
|
||||
|
||||
/**
|
||||
* Gets a value indicating if the app is running on the iOS platform.
|
||||
*/
|
||||
export var isIOS: boolean;
|
||||
export const isIOS: boolean;
|
||||
|
||||
/*
|
||||
* Enum holding platform names.
|
||||
*/
|
||||
export module platformNames {
|
||||
export var android: string;
|
||||
export var ios: string;
|
||||
export const android: string;
|
||||
export const ios: string;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -119,10 +119,10 @@ export module screen {
|
||||
/**
|
||||
* Gets information about the main screen of the current device.
|
||||
*/
|
||||
export var mainScreen: ScreenMetrics;
|
||||
export const mainScreen: ScreenMetrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the current device information.
|
||||
*/
|
||||
export var device: Device;
|
||||
export const device: Device;
|
||||
|
||||
@@ -62,9 +62,9 @@ class Device implements DeviceDefinition {
|
||||
}
|
||||
|
||||
get uuid(): string {
|
||||
var userDefaults = NSUserDefaults.standardUserDefaults;
|
||||
var uuid_key = "TNSUUID";
|
||||
var app_uuid = userDefaults.stringForKey(uuid_key);
|
||||
const userDefaults = NSUserDefaults.standardUserDefaults;
|
||||
const uuid_key = "TNSUUID";
|
||||
let app_uuid = userDefaults.stringForKey(uuid_key);
|
||||
|
||||
if (!app_uuid) {
|
||||
app_uuid = NSUUID.UUID().UUIDString;
|
||||
@@ -77,7 +77,7 @@ class Device implements DeviceDefinition {
|
||||
|
||||
get language(): string {
|
||||
if (!this._language) {
|
||||
var languages = NSLocale.preferredLanguages;
|
||||
const languages = NSLocale.preferredLanguages;
|
||||
this._language = languages[0];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user