From 16c059763390e0a53b3a8db06e7310a5d6dbc8b0 Mon Sep 17 00:00:00 2001 From: Rui Costa Date: Mon, 11 Dec 2023 16:05:25 +0000 Subject: [PATCH] refactor: use types instead of interfaces --- src/fetch.d.ts | 4 ++-- src/mocks/handlers.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/fetch.d.ts b/src/fetch.d.ts index 86b4b1a..0d66287 100644 --- a/src/fetch.d.ts +++ b/src/fetch.d.ts @@ -7,11 +7,11 @@ export type HttpMethod = "GET" | "POST" | "DELETE" | "PUT" | "HEAD" | "PATCH"; export type HeadersInit = Record; -export interface FetchOptions extends RequestOptions { +export type FetchOptions = RequestOptions & { body?: BodyInit | null; headers: HeadersInit; method: HttpMethod; -} +}; export type Response = { headers: Headers; diff --git a/src/mocks/handlers.ts b/src/mocks/handlers.ts index e77fd35..e63b856 100644 --- a/src/mocks/handlers.ts +++ b/src/mocks/handlers.ts @@ -2,12 +2,12 @@ import { http, HttpResponse } from "msw"; import { cancelDelay, delay } from "./helpers/delay"; -interface IRequestData { +type IRequestData = { body?: string; headers: Record; method: string; query: Record; -} +}; async function handler(args: { request: Request }) { const { request } = args;