Skip to content

Commit

Permalink
Added TS-Types
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianFun123 committed Oct 11, 2020
1 parent fddcfa4 commit 2388235
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 0 deletions.
13 changes: 13 additions & 0 deletions types/Cajax.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export default Cajax;
declare class Cajax {
static post(url: any, data?: {}, options?: {}): CajaxRequest;
static get(url: any, data?: {}, options?: {}): CajaxRequest;
static put(url: any, data?: {}, options?: {}): CajaxRequest;
static delete(url: any, data?: {}, options?: {}): CajaxRequest;
static trace(url: any, data?: {}, options?: {}): CajaxRequest;
static connect(url: any, data?: {}, options?: {}): CajaxRequest;
static options(url: any, data?: {}, options?: {}): CajaxRequest;
static update(url: any, data?: {}, options?: {}): CajaxRequest;
static ajax(json: any): CajaxRequest;
}
import CajaxRequest from "./CajaxRequest.js";
25 changes: 25 additions & 0 deletions types/CajaxRequest.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export default CajaxRequest;
declare class CajaxRequest {
constructor(url: any, method: any, data?: any, options?: {});
onResponseFunction: () => void;
catchFunction: () => void;
thenFunction: () => void;
params: any;
method: any;
url: any;
fetch: Promise<void>;
options: {};
data: string | FormData;
contenttype: string;
xhr: XMLHttpRequest;
response(func: any): CajaxRequest;
then(func: any): CajaxRequest;
progress(func: any): CajaxRequest;
catch(func: any): CajaxRequest;
custom(func: any): CajaxRequest;
contentType(type: any): CajaxRequest;
send(): CajaxRequest;
}
declare namespace CajaxRequest {
const useFetch: boolean;
}
11 changes: 11 additions & 0 deletions types/CajaxResponse.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default interface CajaxResponse {
resType: string;
response: string;
responseText: string;
ok: Boolean;
status: Number;
statusText: string;
url: string;
res: any;
json(): object;
}
11 changes: 11 additions & 0 deletions types/Prajax.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export default class Prajax {
static post(url: any, data?: {}, options?: {}): any;
static get(url: any, data?: {}, options?: {}): any;
static put(url: any, data?: {}, options?: {}): any;
static delete(url: any, data?: {}, options?: {}): any;
static trace(url: any, data?: {}, options?: {}): any;
static connect(url: any, data?: {}, options?: {}): any;
static options(url: any, data?: {}, options?: {}): any;
static update(url: any, data?: {}, options?: {}): any;
static ajax(json: any): any;
}
15 changes: 15 additions & 0 deletions types/PrajaxClient.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default PrajaxClient;
declare class PrajaxClient {
constructor(options: any);
baseUrl: any;
options(url: any, data?: {}, options?: {}): any;
data: any;
get(url: any, data?: {}, options?: {}): any;
post(url: any, data?: {}, options?: {}): any;
put(url: any, data?: {}, options?: {}): any;
delete(url: any, data?: {}, options?: {}): any;
trace(url: any, data?: {}, options?: {}): any;
connect(url: any, data?: {}, options?: {}): any;
update(url: any, data?: {}, options?: {}): any;
ajax(json: any): any;
}
2 changes: 2 additions & 0 deletions types/PrajaxPromise.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export default PrajaxPromise;
declare function PrajaxPromise(url: any, method: any, data?: any, options?: {}): any;

0 comments on commit 2388235

Please sign in to comment.