package promise @native interface Promise : Ipromise { } @native interface Ipromise { var resolve: (value: T) -> IThenable var reject: (value: T) -> IThenable var all: (array: Array>) -> IThenable> var denodeify: (fn: Function) -> (args: Array) -> IThenable var nodeify: (fn: Function) -> Function } @native interface IThenable { fun then(onFulfilled: ((value: T) -> dynamic /* IThenable | R */)? = null, onRejected: ((error: Any) -> dynamic /* IThenable | R */)? = null): IThenable fun catch(onRejected: ((error: Any) -> dynamic /* IThenable | R */)? = null): IThenable fun done(onFulfilled: ((value: T) -> dynamic /* IThenable | R */)? = null, onRejected: ((error: Any) -> dynamic /* IThenable | R */)? = null): IThenable fun nodeify(callback: Function): IThenable }