diff --git a/BCL.csproj b/BCL.csproj index 5fbc893ce..85257e659 100644 --- a/BCL.csproj +++ b/BCL.csproj @@ -128,16 +128,16 @@ - - web_client.d.ts + + http_client.d.ts - - web_client.d.ts + + http_client.d.ts - + - + @@ -146,8 +146,8 @@ - - + + console.d.ts @@ -166,7 +166,7 @@ - + diff --git a/Promises/index.ts b/Promises/index.ts index a26b560fd..20143b03a 100644 --- a/Promises/index.ts +++ b/Promises/index.ts @@ -1,2 +1,2 @@ declare var module, require; -module.exports = require("Promises/promises"); \ No newline at end of file +module.exports = require("promises/promises"); \ No newline at end of file diff --git a/WebClient/index.ts b/WebClient/index.ts deleted file mode 100644 index 5f7bab652..000000000 --- a/WebClient/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare var module, require; -module.exports = require("WebClient/web_client"); \ No newline at end of file diff --git a/WebClient/Readme.md b/net/Readme.md similarity index 100% rename from WebClient/Readme.md rename to net/Readme.md diff --git a/WebClient/web_client.android.ts b/net/http_client.android.ts similarity index 99% rename from WebClient/web_client.android.ts rename to net/http_client.android.ts index fcbc29308..79944b8d0 100644 --- a/WebClient/web_client.android.ts +++ b/net/http_client.android.ts @@ -5,7 +5,7 @@ import image_module = require("Image/image"); import app_module = require("Application/application"); -export class Client { +export class HttpClient { /** * Downloads string from url. */ diff --git a/WebClient/web_client.d.ts b/net/http_client.d.ts similarity index 93% rename from WebClient/web_client.d.ts rename to net/http_client.d.ts index 609e80bf3..f73613ef8 100644 --- a/WebClient/web_client.d.ts +++ b/net/http_client.d.ts @@ -3,7 +3,7 @@ */ import image_module = require("Image/image"); -export declare class Client { +export declare class HttpClient { private static get(url: string, successCallback?: (result: any) => void, errorCallback?: (e: Error) => void) getString(url: string, successCallback?: (result: string) => void, errorCallback?: (e: Error) => void) getJSON(url: string, successCallback?: (result: Object) => void, errorCallback?: (e: Error) => void) diff --git a/WebClient/web_client.ios.ts b/net/http_client.ios.ts similarity index 91% rename from WebClient/web_client.ios.ts rename to net/http_client.ios.ts index b9a393342..674abeb54 100644 --- a/WebClient/web_client.ios.ts +++ b/net/http_client.ios.ts @@ -3,15 +3,15 @@ */ import image_module = require("Image/image"); -import promises_module = require("Promises/promises"); +import promises_module = require("promises/promises"); -export class Client { +export class HttpClient { /** * Downloads string from url. */ public getString(url: string, successCallback: (result: string) => void, errorCallback?: (e: Error) => void) { try { - Client.get(url, function (data) { + HttpClient.get(url, function (data) { if (successCallback) { successCallback(Foundation.NSString.initWithDataEncoding(data, 4).toString()); } @@ -25,7 +25,7 @@ export class Client { public static getString(url : string) { var d = new promises_module.Promises.Deferred(); - new Client().getString(url, r => d.resolve(r), e => d.reject(e)); + new HttpClient().getString(url, r => d.resolve(r), e => d.reject(e)); return d.promise(); } @@ -44,7 +44,7 @@ export class Client { } public getImage(url: string, successCallback: (result: image_module.Image) => void, errorCallback?: (e: Error) => void) { - Client.get(url, function (data) { + HttpClient.get(url, function (data) { if (successCallback) { var image = new image_module.Image(); image.loadFromData(data); @@ -57,11 +57,11 @@ export class Client { if (!successCallback && !errorCallback) { var d = new promises_module.Promises.Deferred(); - Client.getUrl(url, r => d.resolve(r), e => d.reject(e)); + HttpClient.getUrl(url, r => d.resolve(r), e => d.reject(e)); return d.promise(); } - Client.getUrl(url, successCallback, errorCallback); + HttpClient.getUrl(url, successCallback, errorCallback); } private static getUrl(url: string, successCallback: (result: any) => void, errorCallback?: (e: Error) => void) { diff --git a/net/index.ts b/net/index.ts new file mode 100644 index 000000000..2845fb071 --- /dev/null +++ b/net/index.ts @@ -0,0 +1,2 @@ +declare var module, require; +module.exports = require("net/http_client"); \ No newline at end of file