Skip to content

Commit 4faced0

Browse files
author
Vladimir Enchev
committed
http internal references refactored
1 parent eb4eab2 commit 4faced0

File tree

4 files changed

+26
-8
lines changed

4 files changed

+26
-8
lines changed

BCL.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@
159159
<TypeScriptCompile Include="android17.d.ts" />
160160
<TypeScriptCompile Include="promises\promises.ts" />
161161
<TypeScriptCompile Include="promises\index.ts" />
162-
<TypeScriptCompile Include="http\http.ts">
163-
<DependentUpon>http.d.ts</DependentUpon>
164-
</TypeScriptCompile>
165162
<TypeScriptCompile Include="ios7.d.ts" />
166163
<TypeScriptCompile Include="globals\index.ts" />
167164
<TypeScriptCompile Include="timer\index.ts" />
@@ -190,6 +187,7 @@
190187
<DependentUpon>http-request.d.ts</DependentUpon>
191188
</TypeScriptCompile>
192189
<TypeScriptCompile Include="application\application-common.ts" />
190+
<TypeScriptCompile Include="http\http-common.ts" />
193191
<Content Include="image-source\Readme.md" />
194192
<TypeScriptCompile Include="http\http.d.ts" />
195193
<TypeScriptCompile Include="local-settings\index.ts" />

http/http.ts renamed to http/http-common.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ import http = require("http/http-request");
44

55
// merge request
66
export var request = http.request;
7-
export interface HttpResponse extends http.HttpResponse { }
8-
export interface HttpRequestOptions extends http.HttpRequestOptions { }
9-
export interface HttpContent extends http.HttpContent { }
107

118
/**
129
* Gets string from url.

http/http.d.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,27 @@ export declare function getJSON<T>(url: string): promises.Promise<T>
99
export declare function getJSON<T>(options: request.HttpRequestOptions): promises.Promise<T>
1010

1111
export declare function getImage(url: string): promises.Promise<image.ImageSource>
12-
export declare function getImage(options: request.HttpRequestOptions): promises.Promise<image.ImageSource>
12+
export declare function getImage(options: request.HttpRequestOptions): promises.Promise<image.ImageSource>
13+
14+
export declare function request(options: HttpRequestOptions): promises.Promise<HttpResponse>;
15+
16+
export interface HttpRequestOptions {
17+
url: string;
18+
method: string;
19+
headers?: any;
20+
content?: any;
21+
timeout?: number;
22+
}
23+
24+
export interface HttpResponse {
25+
statusCode: number;
26+
headers: any;
27+
content?: HttpContent;
28+
}
29+
30+
export interface HttpContent {
31+
raw: any;
32+
toString: () => string;
33+
toJSON: () => any;
34+
toImage: () => image.ImageSource;
35+
}

http/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
declare var module, require;
2-
module.exports = require("http/http");
2+
module.exports = require("http/http-common");

0 commit comments

Comments
 (0)