Skip to content

Commit

Permalink
refactor: use types instead of interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
ruicsh committed Dec 11, 2023
1 parent b3e57ef commit 16c0597
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/fetch.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export type HttpMethod = "GET" | "POST" | "DELETE" | "PUT" | "HEAD" | "PATCH";

export type HeadersInit = Record<string, string>;

export interface FetchOptions extends RequestOptions {
export type FetchOptions = RequestOptions & {
body?: BodyInit | null;
headers: HeadersInit;
method: HttpMethod;
}
};

export type Response<T = unknown> = {
headers: Headers;
Expand Down
4 changes: 2 additions & 2 deletions src/mocks/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { http, HttpResponse } from "msw";

import { cancelDelay, delay } from "./helpers/delay";

interface IRequestData {
type IRequestData = {
body?: string;
headers: Record<string, string>;
method: string;
query: Record<string, string>;
}
};

async function handler(args: { request: Request }) {
const { request } = args;
Expand Down

0 comments on commit 16c0597

Please sign in to comment.