80 lines
1.1 KiB
TypeScript
80 lines
1.1 KiB
TypeScript
|
|
|
||
|
|
/**
|
||
|
|
* @author fenris
|
||
|
|
*/
|
||
|
|
type char = string;
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author fenris
|
||
|
|
*/
|
||
|
|
declare var require : (path : string)=>any;
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author fenris
|
||
|
|
*/
|
||
|
|
declare var process : any;
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author fenris
|
||
|
|
*/
|
||
|
|
declare class Buffer
|
||
|
|
{
|
||
|
|
public toString() : string;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author fenris
|
||
|
|
*/
|
||
|
|
declare class Promise<type_result, type_reason>
|
||
|
|
{
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author fenris
|
||
|
|
*/
|
||
|
|
public constructor
|
||
|
|
(
|
||
|
|
executor : (resolve : (result ?: type_result)=>void, reject ?: (reason ?: type_reason)=>void)=>void
|
||
|
|
)
|
||
|
|
;
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author fenris
|
||
|
|
*/
|
||
|
|
public then<type_result_, type_reason_>
|
||
|
|
(
|
||
|
|
onFulfilled : (result : type_result)=>any,
|
||
|
|
onRejected ?: (reason : type_reason)=>any
|
||
|
|
)
|
||
|
|
: Promise<type_result_, type_reason_>
|
||
|
|
;
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author fenris
|
||
|
|
*/
|
||
|
|
public catch<type_result_, type_reason_>
|
||
|
|
(
|
||
|
|
onRejected : (reason : type_reason)=>any
|
||
|
|
)
|
||
|
|
: Promise<type_result_, type_reason_>
|
||
|
|
;
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @author fenris
|
||
|
|
*/
|
||
|
|
public static resolve<type_result, type_reason>
|
||
|
|
(
|
||
|
|
result : type_result
|
||
|
|
)
|
||
|
|
: Promise<type_result, type_reason>
|
||
|
|
;
|
||
|
|
|
||
|
|
}
|
||
|
|
|