From a8d7020bee894165d513bdc2c34a10a73403d96b Mon Sep 17 00:00:00 2001 From: Kegan Myers Date: Fri, 28 Feb 2014 10:32:43 -0600 Subject: [PATCH] Document GenericRequest --- lib/Typertext/GenericRequest.ts | 39 ++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/lib/Typertext/GenericRequest.ts b/lib/Typertext/GenericRequest.ts index e487a18..f5e590d 100644 --- a/lib/Typertext/GenericRequest.ts +++ b/lib/Typertext/GenericRequest.ts @@ -1,16 +1,53 @@ //TODO comment everything +/** + * @module Typertext + * @submodule Http + * @submodule Json + */ module Typertext { import HttpMethod = Typertext.Http.HttpMethod; import HttpPostData = Typertext.Http.HttpPostData; - import HttpResponseHandler = Typertext.Http.HttpResponseHandler; import HttpUrl = Typertext.Http.HttpUrl; + /** + * A class to simplify passing both the status and data of a completed proxy request + * + * @interface GenericRequest + * @uses Typertext.Http.HttpMethod + * @uses Typertext.Http.HttpPostData + * @uses Typertext.Http.HttpUrl + * + * @author Kegan Myers + * @version 0.2.1 + */ export interface GenericRequest>> { + + /** + * A convenience method which will simply use the RawRequest method with a GET + * + * @param {HttpUrl} request + * @param {GenericResponseHandler} callback + */ Get(request:HttpUrl, callback:T):void; + /** + * A convenience method which will simply use the RawRequest method with a GET + * + * @param {HttpUrl} request + * @param {HttpPostData} postData + * @param {GenericResponseHandler} callback + */ Post(request:HttpUrl, postData:HttpPostData, callback:T):void; + /** + * A method which calls the server and passes returned data to an optionally specified callback + * + * @param {HttpMethid} method + * @param {HttpUrl} request + * @param {HttpPostData} postData + * @param {GenericResponseHandler} callback + */ RawRequest(method:HttpMethod, request:HttpUrl, postData?:HttpPostData, callback?:T):void; } } \ No newline at end of file