-
-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fixing typing structure and configuration
- Loading branch information
1 parent
7ebb616
commit a79dabe
Showing
8 changed files
with
285 additions
and
113 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,32 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "es6", | ||
"module": "commonjs", | ||
"strict": true, | ||
/* Basic Options */ | ||
|
||
"target": "es5", | ||
"module": "es6", | ||
"outDir": "dist", | ||
"pretty": true, | ||
"declaration": true, | ||
"lib": ["ES2015", "ES2016", "ES2017", "DOM"], | ||
|
||
/* Module Resolution Options */ | ||
|
||
"moduleResolution": "node", | ||
"esModuleInterop": true, | ||
"baseUrl": "./", | ||
|
||
/* Strict Type-Checking Options */ | ||
|
||
"strictPropertyInitialization": true, | ||
"strictNullChecks": true, | ||
"noImplicitAny": false, | ||
"downlevelIteration": true, | ||
|
||
/* Additional Checks */ | ||
|
||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"pretty": false, | ||
"esModuleInterop": true, | ||
"declaration": false, | ||
"outDir": "dist/latest" | ||
"noImplicitReturns": true | ||
}, | ||
"include": [ | ||
"src/**/*", | ||
"test/tests/**/*" | ||
], | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} | ||
"include": ["typings/*", "src/**/*"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
declare function encodeURIComponent(uriComponent: string | number | boolean): string; | ||
|
||
declare interface Global { | ||
URL: typeof URL, | ||
URLSearchParams: typeof URLSearchParams, | ||
encodeURIComponent: typeof encodeURIComponent | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/// <reference path="globals.d.ts" /> | ||
/// <reference path="services.d.ts" /> | ||
/// <reference path="infrastructure.d.ts" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Bundler | ||
interface Constructor { | ||
new (...args: any): any; | ||
} | ||
|
||
type Mapper<T extends { [name: string]: Constructor }, P extends keyof T> = { | ||
[name in P]: InstanceType<T[name]> | ||
}; | ||
|
||
interface Bundle<T extends { [name: string]: Constructor }, P extends keyof T> { | ||
new (options?: any): Mapper<T, P>; | ||
} | ||
|
||
// Base Service | ||
interface Sudo { | ||
sudo?: string | number; | ||
} | ||
|
||
interface Requester { | ||
get: Function; | ||
post: Function; | ||
put: Function; | ||
delete: Function; | ||
stream?: Function; | ||
} | ||
|
||
interface BaseServiceOptions extends Sudo { | ||
oauthToken?: string; | ||
token?: string; | ||
jobToken?: string; | ||
host?: string; | ||
url?: string; | ||
version?: string; | ||
rejectUnauthorized?: boolean; | ||
camelize?: boolean; | ||
requester?: Requester; | ||
} | ||
|
||
// RequestHelper | ||
interface PaginationOptions { | ||
total: number; | ||
next: number | null; | ||
current: number; | ||
previous: number | null; | ||
perPage: number; | ||
totalPages: number; | ||
} | ||
|
||
interface DefaultRequestOptions extends Sudo { | ||
body?: object | FormData; | ||
query?: object; | ||
} | ||
|
||
interface BaseRequestOptions extends Sudo { | ||
[key: string]: any; | ||
} | ||
|
||
interface PaginatedRequestOptions extends BaseRequestOptions { | ||
showPagination?: boolean; | ||
maxPages?: number; | ||
page?: number; | ||
perPage?: number; | ||
} | ||
|
||
type PaginationResponse = { data: object[], pagination: PaginationOptions } | ||
type GetResponse = PaginationResponse | object | object[]; | ||
type PostResponse = object; | ||
type PutResponse = object; | ||
type DelResponse = object; | ||
|
Oops, something went wrong.