Skip to content

Commit

Permalink
fix: typescript return type annotations (#97)
Browse files Browse the repository at this point in the history
* Fix return types for createRequestError, formatGraphQLErrors

* Add build to prepare

* Revert "Add build to prepare"

This reverts commit 2905f8d.

* Remove 'default' keyword.

Co-authored-by: David Emanuel Luksic <david.luksic@ablacon.com>
  • Loading branch information
deluksic and David Emanuel Luksic committed Mar 31, 2020
1 parent c0e3145 commit 509f97d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,5 +303,16 @@ export type GraphQLResponseErrors = Array<{
stack?: string[];
}>;

export function createRequestError(request: RelayRequestAny, response?: RelayResponse);
export function formatGraphQLErrors(request: RelayRequest, errors: GraphQLResponseErrors);
export class RRNLError extends Error {
constructor(msg: string);
}

export class RRNLRequestError extends RRNLError {
req: RelayRequestAny;
res?: RelayResponse;

constructor(msg: string);
}

export function createRequestError(request: RelayRequestAny, response?: RelayResponse): RRNLRequestError;
export function formatGraphQLErrors(request: RelayRequest, errors: GraphQLResponseErrors): string;

0 comments on commit 509f97d

Please sign in to comment.