diff --git a/src/index.ts b/src/index.ts index 3a30d69..537dd59 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,9 @@ /** * Export all from "lib" and "types" */ -import { fetchRequest, FetchError, fetchContent } from "@/lib"; +export * from "@/lib"; +export * from "@/types"; +import { FetchError, fetchContent } from "@/lib"; import { ClientOptions, CMSContent, @@ -11,8 +13,6 @@ import { NotFoundContents, } from "@/types"; -export { fetchRequest, FetchError, fetchContent }; - /** * Class representing a client for fetching CMS content. */ diff --git a/src/lib/fetch.ts b/src/lib/fetch.ts index b012d98..9103f5a 100644 --- a/src/lib/fetch.ts +++ b/src/lib/fetch.ts @@ -42,7 +42,7 @@ export class FetchError extends Error { * } */ export const fetchRequest = async ( - method: string, + method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD", url: RequestInfo | URL, data: any, headers?: HeadersInit, @@ -64,7 +64,7 @@ export const fetchRequest = async ( } catch (error) { console.group("FETCH_REQUEST_ERROR"); console.log("method: ", method); - console.log("url: ", url) + console.log("url: ", url); console.log("data: ", data); console.log("headers: ", headers); console.log("error: ", error); diff --git a/src/types/index.d.ts b/src/types/index.ts similarity index 100% rename from src/types/index.d.ts rename to src/types/index.ts