DefinitelyTyped/types/nanoajax/index.d.ts
2017-08-20 15:37:53 -07:00

20 lines
578 B
TypeScript

// Type definitions for nanoajax v0.2.4
// Project: https://github.com/yanatan16/nanoajax
// Definitions by: Nathan Cahill <https://github.com/nathancahill>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface RequestParameters {
url: string;
headers?: { [key: string]: string; };
body?: string | FormData;
method?: string;
cors?: boolean;
}
interface Callback {
(statusCode: number, response: string, request: XMLHttpRequest): any
}
export declare function ajax(params: RequestParameters, callback: Callback): XMLHttpRequest