mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
No more ambient modules for tns-core-modules/* subpackages.
- Use path mappings in tsconfig.json to resolve module typings - Only use ambient mobules for global API's - Move single-file modules to a subdir with the same name so that we can provide a hand-written typing next to it (via package.json) - Delete all mentions of tns-core-modules.d.ts - Delete reference d.ts assembly build steps. Not needed anymore. - HACK! Use a <reference> for global typings in application.d.ts to avoid publishing a separate @types/tns-core-modules package. - Rename declarations.d.ts to tns-core-modules.d.ts to preserve JS project mappings in references.d.ts (the only place we use those)
This commit is contained in:
committed by
Hristo Deshev
parent
1af8c6ca8e
commit
b45cbe929b
@@ -1,5 +1,6 @@
|
||||
{
|
||||
"name" : "trace",
|
||||
"main" : "trace",
|
||||
"nativescript": {}
|
||||
"name" : "trace",
|
||||
"main" : "trace",
|
||||
"types" : "trace.d.ts",
|
||||
"nativescript": {}
|
||||
}
|
||||
|
||||
206
tns-core-modules/trace/trace.d.ts
vendored
206
tns-core-modules/trace/trace.d.ts
vendored
@@ -1,124 +1,122 @@
|
||||
/**
|
||||
* Allows you to trace and print specific information based on categories.
|
||||
*/
|
||||
declare module "trace" {
|
||||
/**
|
||||
* Enables the trace module.
|
||||
*/
|
||||
export function enable(): void;
|
||||
/**
|
||||
* Enables the trace module.
|
||||
*/
|
||||
export function enable(): void;
|
||||
|
||||
/**
|
||||
* Disables the trace module.
|
||||
*/
|
||||
export function disable(): void;
|
||||
|
||||
/**
|
||||
* A function that returns whether the tracer is enabled and there is a point in writing messages.
|
||||
* Check this to avoid writing complex string templates.
|
||||
* Send error messages even if tracing is disabled.
|
||||
*/
|
||||
export function isEnabled(): boolean;
|
||||
/**
|
||||
* Disables the trace module.
|
||||
*/
|
||||
export function disable(): void;
|
||||
|
||||
/**
|
||||
* Adds a TraceWriter instance to the trace module.
|
||||
* @param writer The TraceWriter instance to add.
|
||||
*/
|
||||
export function addWriter(writer: TraceWriter);
|
||||
/**
|
||||
* A function that returns whether the tracer is enabled and there is a point in writing messages.
|
||||
* Check this to avoid writing complex string templates.
|
||||
* Send error messages even if tracing is disabled.
|
||||
*/
|
||||
export function isEnabled(): boolean;
|
||||
|
||||
/**
|
||||
* Removes a TraceWriter instance from the trace module.
|
||||
* @param writer The TraceWriter instance to remove.
|
||||
*/
|
||||
export function removeWriter(writer: TraceWriter);
|
||||
/**
|
||||
* Adds a TraceWriter instance to the trace module.
|
||||
* @param writer The TraceWriter instance to add.
|
||||
*/
|
||||
export function addWriter(writer: TraceWriter);
|
||||
|
||||
/**
|
||||
* Clears all the writers from the trace module.
|
||||
*/
|
||||
export function clearWriters();
|
||||
/**
|
||||
* Removes a TraceWriter instance from the trace module.
|
||||
* @param writer The TraceWriter instance to remove.
|
||||
*/
|
||||
export function removeWriter(writer: TraceWriter);
|
||||
|
||||
/**
|
||||
* Sets the categories the module will trace.
|
||||
* @param categories The comma-separated list of categories. If not specified all messages from all categories will be traced.
|
||||
*/
|
||||
export function setCategories(categories: string);
|
||||
/**
|
||||
* Clears all the writers from the trace module.
|
||||
*/
|
||||
export function clearWriters();
|
||||
|
||||
/**
|
||||
* Adds categories to existing categories the module will trace.
|
||||
* @param categories The comma-separated list of categories. If not specified all messages from all categories will be traced.
|
||||
*/
|
||||
export function addCategories(categories: string);
|
||||
/**
|
||||
* Sets the categories the module will trace.
|
||||
* @param categories The comma-separated list of categories. If not specified all messages from all categories will be traced.
|
||||
*/
|
||||
export function setCategories(categories: string);
|
||||
|
||||
/**
|
||||
* Check if category is already set in trace module.
|
||||
* @param category The category to check.
|
||||
*/
|
||||
export function isCategorySet(category: string): boolean;
|
||||
/**
|
||||
* Adds categories to existing categories the module will trace.
|
||||
* @param categories The comma-separated list of categories. If not specified all messages from all categories will be traced.
|
||||
*/
|
||||
export function addCategories(categories: string);
|
||||
|
||||
/**
|
||||
* Writes a message using the available writers.
|
||||
* @param message The message to be written.
|
||||
* @param category The category of the message.
|
||||
* @param type Optional, the type of the message - info, warning, error.
|
||||
*/
|
||||
export function write(message: any, category: string, type?: number);
|
||||
/**
|
||||
* Check if category is already set in trace module.
|
||||
* @param category The category to check.
|
||||
*/
|
||||
export function isCategorySet(category: string): boolean;
|
||||
|
||||
/**
|
||||
* Notifies all the attached listeners for an event that has occurred in the sender object.
|
||||
* @param object The Object instance that raised the event.
|
||||
* @param name The name of the raised event.
|
||||
* @param data An optional parameter that passes the data associated with the event.
|
||||
*/
|
||||
export function notifyEvent(object: Object, name: string, data?: any);
|
||||
/**
|
||||
* Writes a message using the available writers.
|
||||
* @param message The message to be written.
|
||||
* @param category The category of the message.
|
||||
* @param type Optional, the type of the message - info, warning, error.
|
||||
*/
|
||||
export function write(message: any, category: string, type?: number);
|
||||
|
||||
export function addEventListener(listener: EventListener);
|
||||
/**
|
||||
* Notifies all the attached listeners for an event that has occurred in the sender object.
|
||||
* @param object The Object instance that raised the event.
|
||||
* @param name The name of the raised event.
|
||||
* @param data An optional parameter that passes the data associated with the event.
|
||||
*/
|
||||
export function notifyEvent(object: Object, name: string, data?: any);
|
||||
|
||||
export function removeEventListener(listener: EventListener);
|
||||
export function addEventListener(listener: EventListener);
|
||||
|
||||
/**
|
||||
* An enum that defines all predefined categories.
|
||||
*/
|
||||
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 function removeEventListener(listener: EventListener);
|
||||
|
||||
export var All: string;
|
||||
/**
|
||||
* 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 var separator: string;
|
||||
export function concat(...categories: string[]): string;
|
||||
}
|
||||
export var All: string;
|
||||
|
||||
/**
|
||||
* An enum that defines all predefined message types.
|
||||
*/
|
||||
module messageType {
|
||||
export var log: number;
|
||||
export var info: number;
|
||||
export var warn: number;
|
||||
export var error: number;
|
||||
}
|
||||
export var separator: string;
|
||||
export function concat(...categories: string[]): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* An interface used to define a writer used by trace to print (log).
|
||||
*/
|
||||
export interface TraceWriter {
|
||||
write(message: any, category: string, type?: number);
|
||||
}
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* An interface used to trace information about specific event.
|
||||
*/
|
||||
export interface EventListener {
|
||||
filter: string;
|
||||
on(object: Object, name: string, data?: any);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* An interface used to define a writer used by trace to print (log).
|
||||
*/
|
||||
export interface TraceWriter {
|
||||
write(message: any, category: string, type?: number);
|
||||
}
|
||||
|
||||
/**
|
||||
* An interface used to trace information about specific event.
|
||||
*/
|
||||
export interface EventListener {
|
||||
filter: string;
|
||||
on(object: Object, name: string, data?: any);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user