Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

Commit

Permalink
Fix inconsistent spacing and Response.json typings
Browse files Browse the repository at this point in the history
  • Loading branch information
auguwu committed Mar 16, 2021
1 parent 7fd17f0 commit bc6920f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
31 changes: 16 additions & 15 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ declare namespace orchid {
/**
* Converts the body to a JSON object or array
*/
public json<T extends object | any[] = { [key: string]: string; }>(): T;
public json<T extends object | any[] = { [key: string]: any; }>(): T;

/**
* Returns the body as a Buffer
Expand Down Expand Up @@ -697,26 +697,27 @@ declare namespace orchid {
}

export abstract class Serializer<T = any> {
/**
* Constructs a new instance of [Serializer]
* @param contentType The content-type to use to serialize
*/
constructor(contentType: string | RegExp);
/**
* Constructs a new instance of [Serializer]
* @param contentType The content-type to use to serialize
*/
constructor(contentType: string | RegExp);

/**
* Serializes data and returns the output
* @param data The data (that is a Buffer) to serialize
* @returns The data represented as [T].
* @throws {SyntaxError} When the user hasn't overloaded this function
*/
abstract serialize(data: Buffer): T;
/**
* Serializes data and returns the output
* @param data The data (that is a Buffer) to serialize
* @returns The data represented as [T].
* @throws {SyntaxError} When the user hasn't overloaded this function
*/
abstract serialize(data: Buffer): T;
}

export class JsonSerializer<T extends object = {}> extends Serializer<T> {
serialize(data: Buffer): T;
serialize(data: Buffer): T;
}

export class TextSerializer extends Serializer<string> {
serialize(data: Buffer);
serialize(data: Buffer): string;
}

// ~ Namespaces ~
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@augu/orchid",
"description": "🛬 Simple and lightweight way to create a HTTP request to the world, with more features sprinkled in.",
"version": "2.2.2",
"version": "2.2.3",
"main": "build/index.js",
"license": "MIT",
"types": "index.d.ts",
Expand Down

0 comments on commit bc6920f

Please sign in to comment.