Skip to content

Commit

Permalink
feat: add types (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
snyamathi committed Aug 3, 2021
1 parent 04c27fa commit 3cd2e64
Show file tree
Hide file tree
Showing 4 changed files with 1,439 additions and 5,619 deletions.
2 changes: 2 additions & 0 deletions .npmrc
@@ -0,0 +1,2 @@
registry = https://registry.npmjs.org/
package-lock = true
24 changes: 24 additions & 0 deletions index.d.ts
@@ -0,0 +1,24 @@
declare module 'fumble' {
const http: {
badGateway: (message?: string, options?: { debug?: any }) => HttpError;
badRequest: (message?: string, options?: { debug?: any }) => HttpError;
conflict: (message?: string, options?: { debug?: any }) => HttpError;
create: (status?: number, message?: string, options?: { debug?: any }) => HttpError;
forbidden: (message?: string, options?: { debug?: any }) => HttpError;
gone: (message?: string, options?: { debug?: any }) => HttpError;
internalServerError: (message?: string, options?: { debug?: any }) => HttpError;
methodNotAllowed: (message?: string, options?: { debug?: any }) => HttpError;
notFound: (message?: string, options?: { debug?: any }) => HttpError;
notImplemented: (message?: string, options?: { debug?: any }) => HttpError;
preconditionFailed: (message?: string, options?: { debug?: any }) => HttpError;
proxyAuthenticationRequired: (message?: string, options?: { debug?: any }) => HttpError;
serviceUnavailable:(message?: string, options?: { debug?: any }) => HttpError;
tooManyRequests: (message?: string, options?: { debug?: any }) => HttpError;
unauthorized: (message?: string, options?: { debug?: any }) => HttpError;
};

class HttpError extends Error {
debug?: any;
statusCode: number;
}
}

0 comments on commit 3cd2e64

Please sign in to comment.