Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Fix declarations for index.d.ts #66

Merged
merged 1 commit into from Mar 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
declare namespace FeathersErrors {
class FeathersError extends Error {
constructor(msg: string | Error, name: string , code: number, className: String, data: any)
constructor(msg: string | Error, name: string, code: number, className: String, data: any)
}

class BadRequest extends FeathersError {
Expand Down Expand Up @@ -31,6 +31,10 @@ declare namespace FeathersErrors {
constructor(msg: string | Error, data?: any);
}

class Timeout extends FeathersError {
constructor(msg: string | Error, data?: any);
}

class Conflict extends FeathersError {
constructor(msg: string | Error, data?: any);
}
Expand Down Expand Up @@ -64,10 +68,30 @@ declare namespace FeathersErrors {
}
}

declare namespace FeathersErrors {
types: FeathersErrors
function convert(error: any):FeathersError
errors: FeathersErrors
declare namespace FeathersErrors {
interface ErrorContainer {
FeathersError
BadRequest
NotAuthenticated
PaymentError
Forbidden
NotFound
MethodNotAllowed
NotAcceptable
Timeout
Conflict
LengthRequired
Unprocessable
TooManyRequests
GeneralError
NotImplemented
BadGateway
Unavailable
}

function convert(error: any): FeathersError
const types: ErrorContainer
const errors: ErrorContainer
}

export = FeathersErrors
export = FeathersErrors;