mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
http internal references refactored
This commit is contained in:
@ -159,9 +159,6 @@
|
||||
<TypeScriptCompile Include="android17.d.ts" />
|
||||
<TypeScriptCompile Include="promises\promises.ts" />
|
||||
<TypeScriptCompile Include="promises\index.ts" />
|
||||
<TypeScriptCompile Include="http\http.ts">
|
||||
<DependentUpon>http.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="ios7.d.ts" />
|
||||
<TypeScriptCompile Include="globals\index.ts" />
|
||||
<TypeScriptCompile Include="timer\index.ts" />
|
||||
@ -190,6 +187,7 @@
|
||||
<DependentUpon>http-request.d.ts</DependentUpon>
|
||||
</TypeScriptCompile>
|
||||
<TypeScriptCompile Include="application\application-common.ts" />
|
||||
<TypeScriptCompile Include="http\http-common.ts" />
|
||||
<Content Include="image-source\Readme.md" />
|
||||
<TypeScriptCompile Include="http\http.d.ts" />
|
||||
<TypeScriptCompile Include="local-settings\index.ts" />
|
||||
|
@ -4,9 +4,6 @@ import http = require("http/http-request");
|
||||
|
||||
// merge request
|
||||
export var request = http.request;
|
||||
export interface HttpResponse extends http.HttpResponse { }
|
||||
export interface HttpRequestOptions extends http.HttpRequestOptions { }
|
||||
export interface HttpContent extends http.HttpContent { }
|
||||
|
||||
/**
|
||||
* Gets string from url.
|
25
http/http.d.ts
vendored
25
http/http.d.ts
vendored
@ -9,4 +9,27 @@ export declare function getJSON<T>(url: string): promises.Promise<T>
|
||||
export declare function getJSON<T>(options: request.HttpRequestOptions): promises.Promise<T>
|
||||
|
||||
export declare function getImage(url: string): promises.Promise<image.ImageSource>
|
||||
export declare function getImage(options: request.HttpRequestOptions): promises.Promise<image.ImageSource>
|
||||
export declare function getImage(options: request.HttpRequestOptions): promises.Promise<image.ImageSource>
|
||||
|
||||
export declare function request(options: HttpRequestOptions): promises.Promise<HttpResponse>;
|
||||
|
||||
export interface HttpRequestOptions {
|
||||
url: string;
|
||||
method: string;
|
||||
headers?: any;
|
||||
content?: any;
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
export interface HttpResponse {
|
||||
statusCode: number;
|
||||
headers: any;
|
||||
content?: HttpContent;
|
||||
}
|
||||
|
||||
export interface HttpContent {
|
||||
raw: any;
|
||||
toString: () => string;
|
||||
toJSON: () => any;
|
||||
toImage: () => image.ImageSource;
|
||||
}
|
@ -1,2 +1,2 @@
|
||||
declare var module, require;
|
||||
module.exports = require("http/http");
|
||||
module.exports = require("http/http-common");
|
Reference in New Issue
Block a user