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:
36
tns-core-modules/trace/trace.d.ts
vendored
36
tns-core-modules/trace/trace.d.ts
vendored
@@ -88,22 +88,22 @@ export function setErrorHandler(handler: ErrorHandler);
|
||||
* An enum that defines all predefined categories.
|
||||
*/
|
||||
export module categories {
|
||||
export var VisualTreeEvents: string;
|
||||
export var Layout: string;
|
||||
export var Style: string;
|
||||
export var ViewHierarchy: string;
|
||||
export var NativeLifecycle: string;
|
||||
export var Debug: string;
|
||||
export var Navigation: string;
|
||||
export var Test: string;
|
||||
export var Binding: string;
|
||||
export var Error: string;
|
||||
export var Animation: string;
|
||||
export var Transition: string;
|
||||
export const VisualTreeEvents: string;
|
||||
export const Layout: string;
|
||||
export const Style: string;
|
||||
export const ViewHierarchy: string;
|
||||
export const NativeLifecycle: string;
|
||||
export const Debug: string;
|
||||
export const Navigation: string;
|
||||
export const Test: string;
|
||||
export const Binding: string;
|
||||
export const Error: string;
|
||||
export const Animation: string;
|
||||
export const Transition: string;
|
||||
|
||||
export var All: string;
|
||||
export const All: string;
|
||||
|
||||
export var separator: string;
|
||||
export const separator: string;
|
||||
export function concat(...categories: string[]): string;
|
||||
}
|
||||
|
||||
@@ -111,10 +111,10 @@ export module categories {
|
||||
* An enum that defines all predefined message types.
|
||||
*/
|
||||
export module messageType {
|
||||
export var log: number;
|
||||
export var info: number;
|
||||
export var warn: number;
|
||||
export var error: number;
|
||||
export const log: number;
|
||||
export const info: number;
|
||||
export const warn: number;
|
||||
export const error: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -102,41 +102,40 @@ export function addEventListener(listener: EventListener) {
|
||||
}
|
||||
|
||||
export function removeEventListener(listener: EventListener) {
|
||||
var index = _eventListeners.indexOf(listener);
|
||||
const index = _eventListeners.indexOf(listener);
|
||||
if (index >= 0) {
|
||||
_eventListeners.splice(index, 1);
|
||||
}
|
||||
}
|
||||
|
||||
export module messageType {
|
||||
export var log = 0;
|
||||
export var info = 1;
|
||||
export var warn = 2;
|
||||
export var error = 3;
|
||||
export const log = 0;
|
||||
export const info = 1;
|
||||
export const warn = 2;
|
||||
export const error = 3;
|
||||
}
|
||||
|
||||
export module categories {
|
||||
export var VisualTreeEvents = "VisualTreeEvents";
|
||||
export var Layout = "Layout";
|
||||
export var Style = "Style";
|
||||
export var ViewHierarchy = "ViewHierarchy";
|
||||
export var NativeLifecycle = "NativeLifecycle";
|
||||
export var Debug = "Debug";
|
||||
export var Navigation = "Navigation";
|
||||
export var Test = "Test";
|
||||
export var Binding = "Binding";
|
||||
export var BindingError = "BindingError";
|
||||
export var Error = "Error";
|
||||
export var Animation = "Animation";
|
||||
export var Transition = "Transition";
|
||||
export var All = VisualTreeEvents + "," + Layout + "," + Style + "," + ViewHierarchy + "," + NativeLifecycle + "," + Debug + "," + Navigation + "," + Test + "," + Binding + "," + Error + "," + Animation + "," + Transition;
|
||||
export const VisualTreeEvents = "VisualTreeEvents";
|
||||
export const Layout = "Layout";
|
||||
export const Style = "Style";
|
||||
export const ViewHierarchy = "ViewHierarchy";
|
||||
export const NativeLifecycle = "NativeLifecycle";
|
||||
export const Debug = "Debug";
|
||||
export const Navigation = "Navigation";
|
||||
export const Test = "Test";
|
||||
export const Binding = "Binding";
|
||||
export const BindingError = "BindingError";
|
||||
export const Error = "Error";
|
||||
export const Animation = "Animation";
|
||||
export const Transition = "Transition";
|
||||
export const All = VisualTreeEvents + "," + Layout + "," + Style + "," + ViewHierarchy + "," + NativeLifecycle + "," + Debug + "," + Navigation + "," + Test + "," + Binding + "," + Error + "," + Animation + "," + Transition;
|
||||
|
||||
export var separator = ",";
|
||||
export const separator = ",";
|
||||
|
||||
export function concat(): string {
|
||||
var i;
|
||||
var result: string;
|
||||
for (i = 0; i < arguments.length; i++) {
|
||||
let result: string;
|
||||
for (let i = 0; i < arguments.length; i++) {
|
||||
if (!result) {
|
||||
result = arguments[i];
|
||||
continue;
|
||||
@@ -155,7 +154,7 @@ class ConsoleWriter implements TraceWriter {
|
||||
return;
|
||||
}
|
||||
|
||||
var msgType;
|
||||
let msgType;
|
||||
if (type === undefined) {
|
||||
msgType = messageType.log;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user