This commit is contained in:
Jeongho Nam
2016-09-14 16:35:08 +09:00
4 changed files with 15 additions and 3 deletions
+12 -1
View File
@@ -5,6 +5,7 @@
import * as request from 'superagent';
import * as fs from 'fs';
import * as assert from 'assert';
// Examples taken from https://github.com/visionmedia/superagent/blob/gh-pages/docs/index.md
// and https://github.com/visionmedia/superagent/blob/master/Readme.md
@@ -302,4 +303,14 @@ request
request
.get('/search')
.then((response) => {})
.catch((error) => {});
.catch((error) => {});
// Requesting binary data.
// adapted from: https://github.com/visionmedia/superagent/blob/v2.0.0/test/client/request.js#L110
request
.get('/blob')
.responseType('blob')
.end(function (err, res) {
assert(res.xhr instanceof XMLHttpRequest)
assert(res.xhr.response instanceof Blob);
});
+2
View File
@@ -77,6 +77,7 @@ declare module "superagent" {
notAcceptable: boolean;
notFound: boolean;
forbidden: boolean;
xhr: XMLHttpRequest;
get(header: string): string;
}
@@ -96,6 +97,7 @@ declare module "superagent" {
pipe(stream: NodeJS.WritableStream, options?: Object): stream.Writable;
query(val: Object): this;
redirects(n: number): this;
responseType(type: string): this;
send(data: string): this;
send(data: Object): this;
send(): this;
+1 -1
View File
@@ -24,7 +24,7 @@ d.remove();
d.toggle();
d.position();
d.destroy();
d.element.appendChild(document.createElement("div"));
d.content.appendChild(document.createElement("div"));
d.tether.position();
d.on("open", () => false);
-1
View File
@@ -10,7 +10,6 @@ declare class Drop {
constructor(options: Drop.IDropOptions);
public content: HTMLElement;
public element: HTMLElement;
public tether: Tether;
public open(): void;
public close(): void;