Skip to content

Instantly share code, notes, and snippets.

@keesey
Created October 24, 2013 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keesey/7140353 to your computer and use it in GitHub Desktop.
Save keesey/7140353 to your computer and use it in GitHub Desktop.
interface Oboe
{
(url: string): Oboe.Call;
doDelete(url: string): Oboe.Call;
doDelete(request: Oboe.Request): Oboe.Call;
doGet(url: string): Oboe.Call;
doGet(request: Oboe.Request): Oboe.Call;
doPatch(url: string, body: any): Oboe.Call;
doPatch(request: Oboe.BodyRequest): Oboe.Call;
doPost(url: string, body: any): Oboe.Call;
doPost(request: Oboe.BodyRequest): Oboe.Call;
doPut(url: string, body: any): Oboe.Call;
doPut(request: Oboe.BodyRequest): Oboe.Call;
}
module Oboe
{
export interface Call
{
abort(): void;
fail(callback: (error: Error) => any): Call;
node(pattern: string, callback: (result: any, path: string[], context: any) => any): Call;
node(callbacks: {
[pattern: string]: (result: any, path: string[], context: any) => any
}): Call;
path(pattern: string, callback: (result: any, path: string[], context: any) => any): Call;
path(callbacks: {
[pattern: string]: (result: any, path: string[], context: any) => any
}): Call;
root(): any;
}
export interface Request
{
headers?: { [key: string]: any; };
url: string;
}
export interface BodyRequest extends Request
{
body: any;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment