From 6be2435c34df8fe59db6b4123fe62b0f71dfbc46 Mon Sep 17 00:00:00 2001 From: nlac Date: Sun, 24 Apr 2016 21:53:28 +0200 Subject: [PATCH] added type definition file for typescript --- dist/js-data-http.d.ts | 45 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 dist/js-data-http.d.ts diff --git a/dist/js-data-http.d.ts b/dist/js-data-http.d.ts new file mode 100644 index 0000000..4978351 --- /dev/null +++ b/dist/js-data-http.d.ts @@ -0,0 +1,45 @@ +declare module JSDataHttp { + + interface IDict { + [key: string]: any; + } + + interface IActionOpts { + adapter?: string, + pathname?: string, + request?: Function, + response?: Function, + responseError?: Function + } + + interface IBaseHttpAdapter { + basePath?: string, + suffix?: string, + debug?: boolean, + forceTrailingSlash?: boolean, + useFetch?: boolean + http?: any, + httpConfig?: IDict + } + + export class HttpAdapter implements IBaseHttpAdapter { + + static version: { + full?: string, + minor?: string, + major?: string, + patch?: string, + alpha?: string | boolean, + beta?: string | boolean + } + static addAction(name: string, opts: IActionOpts): Function + static addActions(opts?: {[key:string]: IActionOpts}): Function + static extend(instanceProps?: IDict, classProps?: IDict): HttpAdapter + + constructor(opts: IBaseHttpAdapter) + } +} + +declare module 'js-data-http' { + export = JSDataHttp.HttpAdapter +} \ No newline at end of file