Merge pull request #4396 from jarandaf/master

Fix in callback type definition for d3.xhr methods
This commit is contained in:
Masahiro Wakame
2015-05-25 00:03:43 +09:00
Vendored
+12 -12
View File
@@ -304,7 +304,7 @@ declare module D3 {
* @param url Url to request
* @param callback Function to invoke when resource is loaded or the request fails
*/
(url: string, callback?: (xhr: XMLHttpRequest) => void ): Xhr;
(url: string, callback?: (error: any, xhr: XMLHttpRequest) => void ): Xhr;
/**
* Creates an asynchronous request for specified url
*
@@ -312,7 +312,7 @@ declare module D3 {
* @param mime MIME type to request
* @param callback Function to invoke when resource is loaded or the request fails
*/
(url: string, mime: string, callback?: (xhr: XMLHttpRequest) => void ): Xhr;
(url: string, mime: string, callback?: (error: any, xhr: XMLHttpRequest) => void ): Xhr;
};
/**
* Request a text file
@@ -324,7 +324,7 @@ declare module D3 {
* @param url Url to request
* @param callback Function to invoke when resource is loaded or the request fails
*/
(url: string, callback?: (response: string) => void ): Xhr;
(url: string, callback?: (error: any, responseText: string) => void ): Xhr;
/**
* Request a text file
*
@@ -332,7 +332,7 @@ declare module D3 {
* @param mime MIME type to request
* @param callback Function to invoke when resource is loaded or the request fails
*/
(url: string, mime: string, callback?: (response: string) => void ): Xhr;
(url: string, mime: string, callback?: (error: any, responseText: string) => void ): Xhr;
};
/**
* Request a JSON blob
@@ -351,7 +351,7 @@ declare module D3 {
* @param url Url to request
* @param callback Function to invoke when resource is loaded or the request fails
*/
(url: string, callback?: (response: Document) => void ): Xhr;
(url: string, callback?: (error: any, response: Document) => void ): Xhr;
/**
* Request an HTML document fragment.
*
@@ -359,7 +359,7 @@ declare module D3 {
* @param mime MIME type to request
* @param callback Function to invoke when resource is loaded or the request fails
*/
(url: string, mime: string, callback?: (response: Document) => void ): Xhr;
(url: string, mime: string, callback?: (error: any, response: Document) => void ): Xhr;
};
/**
* Request an XML document fragment.
@@ -367,7 +367,7 @@ declare module D3 {
* @param url Url to request
* @param callback Function to invoke when resource is loaded or the request fails
*/
html: (url: string, callback?: (response: DocumentFragment) => void ) => Xhr;
html: (url: string, callback?: (error: any, response: DocumentFragment) => void ) => Xhr;
/**
* Request a comma-separated values (CSV) file.
*/
@@ -654,7 +654,7 @@ declare module D3 {
*
* @param callback Function to invoke on completion of request
*/
get(callback?: (xhr: XMLHttpRequest) => void ): Xhr;
get(callback?: (error: any, xhr: XMLHttpRequest) => void ): Xhr;
/**
* Issue the request using the POST method
*/
@@ -664,14 +664,14 @@ declare module D3 {
*
* @param callback Function to invoke on completion of request
*/
(callback?: (xhr: XMLHttpRequest) => void ): Xhr;
(callback?: (error: any, xhr: XMLHttpRequest) => void ): Xhr;
/**
* Issue the request using the POST method
*
* @param data Data to post back in the request
* @param callback Function to invoke on completion of request
*/
(data: any, callback?: (xhr: XMLHttpRequest) => void ): Xhr;
(data: any, callback?: (error: any, xhr: XMLHttpRequest) => void ): Xhr;
};
/**
* Issues this request using the specified method
@@ -683,7 +683,7 @@ declare module D3 {
* @param method Method to use to make the request
* @param callback Function to invoke on completion of request
*/
(method: string, callback?: (xhr: XMLHttpRequest) => void ): Xhr;
(method: string, callback?: (eror: any, xhr: XMLHttpRequest) => void ): Xhr;
/**
* Issues this request using the specified method
*
@@ -691,7 +691,7 @@ declare module D3 {
* @param data Data to post back in the request
* @param callback Function to invoke on completion of request
*/
(method: string, data: any, callback?: (xhr: XMLHttpRequest) => void ): Xhr;
(method: string, data: any, callback?: (error: any, xhr: XMLHttpRequest) => void ): Xhr;
};
/**
* Aborts this request, if it is currently in-flight