Skip to content

Commit 917a198

Browse files
Ricardo LopesAmericas
authored andcommitted
Add TypeScript typings
1 parent 8fb7ceb commit 917a198

11 files changed

+54
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"license": "SEE LICENSE IN LICENSE",
66
"author": "Uphold",
77
"main": "src/index.js",
8+
"types": "types/index.d.ts",
89
"scripts": {
910
"changelog": "github-changelog-generator --future-release=v$npm_package_version > CHANGELOG.md",
1011
"cover": "yarn test -- --coverage",

types/errors/bad-request-error.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { HttpError } from './http-error';
2+
export declare class BadRequestError extends HttpError {
3+
constructor(message?: string, props?: object);
4+
constructor(props?: object);
5+
}

types/errors/conflict-error.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { HttpError } from './http-error';
2+
export declare class ConflictError extends HttpError {
3+
constructor(message?: string, props?: object);
4+
constructor(props?: object);
5+
}

types/errors/forbidden-error.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { HttpError } from './http-error';
2+
export declare class ForbiddenError extends HttpError {
3+
constructor(message?: string, props?: object);
4+
constructor(props?: object);
5+
}

types/errors/gone-error.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { HttpError } from './http-error';
2+
export declare class GoneError extends HttpError {
3+
constructor(message?: string, props?: object);
4+
constructor(props?: object);
5+
}

types/errors/http-error.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import StandardHttpError from 'standard-http-error';
2+
export declare class HttpError extends StandardHttpError {
3+
}

types/errors/not-found-error.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { HttpError } from './http-error';
2+
export declare class NotFoundError extends HttpError {
3+
constructor(message?: string, props?: object);
4+
constructor(props?: object);
5+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { HttpError } from './http-error';
2+
export declare class ServiceUnavailableError extends HttpError {
3+
constructor(message?: string, props?: object);
4+
constructor(props?: object);
5+
}

types/errors/unauthorized-error.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { HttpError } from './http-error';
2+
export declare class UnauthorizedError extends HttpError {
3+
constructor(message?: string, props?: object);
4+
constructor(props?: object);
5+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { HttpError } from './http-error';
2+
export declare class ValidationFailedError extends HttpError {
3+
errors?: object;
4+
5+
constructor(errors?: object);
6+
}

0 commit comments

Comments
 (0)