// Retyped versions of some of the angular services using the native promise typings, so we can use native promises in unit tests type HttpPromise = Promise> interface HttpService { get(url: string, config?: ng.IRequestShortcutConfig): HttpPromise; delete(url: string, config?: ng.IRequestShortcutConfig): HttpPromise; head(url: string, config?: ng.IRequestShortcutConfig): HttpPromise; jsonp(url: string, config?: ng.IRequestShortcutConfig): HttpPromise; post(url: string, data: any, config?: ng.IRequestShortcutConfig): HttpPromise; put(url: string, data: any, config?: ng.IRequestShortcutConfig): HttpPromise; patch(url: string, data: any, config?: ng.IRequestShortcutConfig): HttpPromise; } interface TimeoutService { (fn: (...args: any[]) => T, delay?: number, invokeApply?: boolean, ...args: any[]): Promise; } interface QService { when(value: Promise | T): Promise; when(): Promise; reject(reason?: any): Promise; defer(): Deferred; all(promises: Promisify): Promise; } type Promisify = { [P in keyof T]: Promise; } interface Deferred { resolve(value?: T | Promise): void; reject(reason?: any): void; promise: Promise; }