Files
NativeScript/declarations.d.ts
Hristo Deshev 690a11fed4 Pull ES6 promises to a separate d.ts file.
So we can use the es6-promise typing in the future.
2015-06-11 15:35:13 +03:00

82 lines
2.4 KiB
TypeScript

/* tslint:disable:no-unused-variable */
interface Console {
time(reportName: string): void;
timeEnd(reportName: string): void;
assert(test: boolean, message: string, ...formatParams: any[]): void;
info(message: any, ...formatParams: any[]): void;
warn(message: any, ...formatParams: any[]): void;
error(message: any, ...formatParams: any[]): void;
log(message: any, ...formatParams: any[]): void;
trace(): void;
dump(obj: any): void;
dir(obj: any): void;
}
declare var console: Console;
declare var global;
declare var require;
// Global functions
declare function Log(data: any): void;
declare function log(data: any): void;
declare function float(num: number): any;
declare function long(num: number): any;
declare function fail(data: any): void;
declare var __dirname: string;
declare var __filename: string;
declare class XMLHttpRequest {
onreadystatechange: Function;
open(method: string, url: string, async?: boolean, user?: string, password?: string): void;
abort(): void;
send(data?: string): void;
setRequestHeader(header: string, value: string): void;
getAllResponseHeaders(): string;
getResponseHeader(header: string): string;
overrideMimeType(mime: string): void;
readyState: number;
responseText: string;
status: number;
}
/**
* Calls a function after a specified delay.
* @param callback The function to be called.
* @param milliseconds The time to wait before the function is called. Defaults to 0.
*/
declare function setTimeout(callback: Function, milliseconds?: number): number;
/**
* Clears the delay set by a call to the setTimeout function.
* @param id The identifier returned by the previously called setTimeout() method.
*/
declare function clearTimeout(id: number): void;
/**
* Calls a function repeatedly with a delay between each call.
* @param callback The function to be called.
* @param milliseconds The delay between each function call.
*/
declare function setInterval(callback: Function, milliseconds?: number): number;
/**
* Clears repeated function which was set up by calling setInterval().
* @param id The identifier returned by the setInterval() method.
*/
declare function clearInterval(id: number): void;
declare class WeakRef<T> {
constructor(obj: T);
get(): T;
clear(): void;
}
declare module module {
var id: string;
var filename: string;
var exports: any;
}
// Same as module.exports
declare var exports: any;