From 59fc38d0581f4829beebc6c9e28858b8d19ad47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Raiti?= <46955459+Secreto31126@users.noreply.github.com> Date: Thu, 2 Jan 2025 04:54:10 -0300 Subject: [PATCH] What if...? --- src/emitters.ts | 6 +++--- src/errors.ts | 2 +- src/index.ts | 2 +- src/messages/contacts.ts | 2 +- src/messages/globals.ts | 2 +- src/messages/interactive.ts | 4 ++-- src/messages/template.ts | 6 +++--- src/middleware/adonis.ts | 2 +- src/middleware/express.ts | 2 +- src/middleware/node-http.ts | 2 +- src/middleware/vercel.ts | 2 +- src/middleware/web-standard.ts | 2 +- src/setup/bun.ts | 2 +- src/setup/deno.ts | 2 +- src/setup/node.ts | 2 +- src/setup/web.ts | 2 +- src/types.ts | 4 ++-- 17 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/emitters.ts b/src/emitters.ts index 91c3124f..62ecd58a 100644 --- a/src/emitters.ts +++ b/src/emitters.ts @@ -7,9 +7,9 @@ import type { ServerPricing, ServerError, PostData -} from "./types"; -import type { WhatsAppAPI } from "./index"; -import type { MaybePromise } from "./utils"; +} from "./types.d.ts"; +import type { WhatsAppAPI } from "./index.d.ts"; +import type { MaybePromise } from "./utils.d.ts"; /** * Callback for "sent" event diff --git a/src/errors.ts b/src/errors.ts index 853482cd..da37c0b4 100644 --- a/src/errors.ts +++ b/src/errors.ts @@ -14,7 +14,7 @@ // This import makes the docs' links work // eslint-disable-next-line @typescript-eslint/no-unused-vars -import type { WhatsAppAPI } from "./index"; +import type { WhatsAppAPI } from "./index.d.ts"; /** * The library's base exception class. diff --git a/src/index.ts b/src/index.ts index bd94c735..e83b4f00 100644 --- a/src/index.ts +++ b/src/index.ts @@ -23,7 +23,7 @@ import type { OnSentArgs, OnStatus, OnStatusArgs -} from "./emitters"; +} from "./emitters.d.ts"; import { escapeUnicode, MaybePromise } from "./utils.js"; import { DEFAULT_API_VERSION } from "./types.js"; diff --git a/src/messages/contacts.ts b/src/messages/contacts.ts index 6d4e864b..1e84cc7f 100644 --- a/src/messages/contacts.ts +++ b/src/messages/contacts.ts @@ -4,7 +4,7 @@ import { ContactUniqueComponent, ContactMultipleComponent } from "../types.js"; -import type { AtLeastOne } from "../utils"; +import type { AtLeastOne } from "../utils.d.ts"; /** * @group Contacts diff --git a/src/messages/globals.ts b/src/messages/globals.ts index 38eb98a8..4d8370dc 100644 --- a/src/messages/globals.ts +++ b/src/messages/globals.ts @@ -1,5 +1,5 @@ import { Section, type ClientTypedMessageComponent } from "../types.js"; -import type { AtLeastOne } from "../utils"; +import type { AtLeastOne } from "../utils.d.ts"; /** * TS knowledge intensifies diff --git a/src/messages/interactive.ts b/src/messages/interactive.ts index cc93b5a4..0e9d0d2b 100644 --- a/src/messages/interactive.ts +++ b/src/messages/interactive.ts @@ -4,9 +4,9 @@ import { Section, type InteractiveAction } from "../types.js"; -import type { AtLeastOne } from "../utils"; +import type { AtLeastOne } from "../utils.d.ts"; -import type { Document, Image, Video } from "./media"; +import type { Document, Image, Video } from "./media.d.ts"; import { CatalogProduct, Product, ProductSection } from "./globals.js"; diff --git a/src/messages/template.ts b/src/messages/template.ts index 4c947af9..9e5b0d38 100644 --- a/src/messages/template.ts +++ b/src/messages/template.ts @@ -5,10 +5,10 @@ import { type ClientTypedMessageComponent, type TemplateComponent } from "../types.js"; -import type { AtLeastOne, XOR } from "../utils"; +import type { AtLeastOne, XOR } from "../utils.d.ts"; -import type { Location } from "./location"; -import type { Document, Image, Video } from "./media"; +import type { Location } from "./location.d.ts"; +import type { Document, Image, Video } from "./media.d.ts"; import { CatalogProduct, Product, ProductSection } from "./globals.js"; diff --git a/src/middleware/adonis.ts b/src/middleware/adonis.ts index 729c7ef6..ec807e0a 100644 --- a/src/middleware/adonis.ts +++ b/src/middleware/adonis.ts @@ -2,7 +2,7 @@ import { WhatsAppAPIMiddleware } from "./globals.js"; import { WhatsAppAPIError } from "../errors.js"; import type { Request } from "@adonisjs/http-server"; -import type { GetParams, PostData } from "../types"; +import type { GetParams, PostData } from "../types.d.ts"; /** * AdonisJS middleware for WhatsAppAPI diff --git a/src/middleware/express.ts b/src/middleware/express.ts index 41a018d3..8e1f657b 100644 --- a/src/middleware/express.ts +++ b/src/middleware/express.ts @@ -2,7 +2,7 @@ import { WhatsAppAPIMiddleware } from "./globals.js"; import { WhatsAppAPIError } from "../errors.js"; import type { Request } from "express"; -import type { GetParams } from "../types"; +import type { GetParams } from "../types.d.ts"; /** * Express.js middleware for WhatsAppAPI diff --git a/src/middleware/node-http.ts b/src/middleware/node-http.ts index 58a8e9da..95be4fa5 100644 --- a/src/middleware/node-http.ts +++ b/src/middleware/node-http.ts @@ -4,7 +4,7 @@ import { WhatsAppAPIError } from "../errors.js"; import type { IncomingMessage } from "node:http"; import type { Readable } from "node:stream"; -import type { GetParams } from "../types"; +import type { GetParams } from "../types.d.ts"; /** * node:http server middleware for WhatsAppAPI diff --git a/src/middleware/vercel.ts b/src/middleware/vercel.ts index e978d100..6e4ee4f3 100644 --- a/src/middleware/vercel.ts +++ b/src/middleware/vercel.ts @@ -2,7 +2,7 @@ import { WhatsAppAPI as NodeHTTPMiddleware } from "./node-http.js"; import { WhatsAppAPIError } from "../errors.js"; import type { VercelRequest } from "@vercel/node"; -import type { GetParams } from "../types.js"; +import type { GetParams } from "../types.d.ts"; /** * Vercel serverless functions middleware for WhatsAppAPI (Node/Next.js) diff --git a/src/middleware/web-standard.ts b/src/middleware/web-standard.ts index 10713525..58a72b87 100644 --- a/src/middleware/web-standard.ts +++ b/src/middleware/web-standard.ts @@ -1,7 +1,7 @@ import { WhatsAppAPIMiddleware } from "./globals.js"; import { WhatsAppAPIError } from "../errors.js"; -import type { GetParams } from "../types"; +import type { GetParams } from "../types.d.ts"; /** * Web Standard API http server middleware for WhatsAppAPI (deno/bun/SvelteKit/NextJS/Hono) diff --git a/src/setup/bun.ts b/src/setup/bun.ts index e45475ce..9ac69857 100644 --- a/src/setup/bun.ts +++ b/src/setup/bun.ts @@ -1,4 +1,4 @@ -import type { WhatsAppAPIConstructorArguments } from "../types"; +import type { WhatsAppAPIConstructorArguments } from "../types.d.ts"; /** * A Bun quick setup for the WhatsAppAPI diff --git a/src/setup/deno.ts b/src/setup/deno.ts index 083d6119..92285c64 100644 --- a/src/setup/deno.ts +++ b/src/setup/deno.ts @@ -1,4 +1,4 @@ -import type { WhatsAppAPIConstructorArguments } from "../types"; +import type { WhatsAppAPIConstructorArguments } from "../types.d.ts"; /** * A Deno quick setup for the WhatsAppAPI diff --git a/src/setup/node.ts b/src/setup/node.ts index 5f77ed1b..690cfeb5 100644 --- a/src/setup/node.ts +++ b/src/setup/node.ts @@ -1,4 +1,4 @@ -import type { WhatsAppAPIConstructorArguments } from "../types"; +import type { WhatsAppAPIConstructorArguments } from "../types.d.ts"; // If this line of code didn't exist, // setup would be a single file rather than a folder diff --git a/src/setup/web.ts b/src/setup/web.ts index 184b6131..14ad839b 100644 --- a/src/setup/web.ts +++ b/src/setup/web.ts @@ -1,4 +1,4 @@ -import type { WhatsAppAPIConstructorArguments } from "../types"; +import type { WhatsAppAPIConstructorArguments } from "../types.d.ts"; /** * A Web quick setup for the WhatsAppAPI diff --git a/src/types.ts b/src/types.ts index 5a27ce40..39111ff3 100644 --- a/src/types.ts +++ b/src/types.ts @@ -19,8 +19,8 @@ import type { Template, Reaction, Contacts -} from "./messages"; -import type { AtLeastOne } from "./utils"; +} from "./messages/index.d.ts"; +import type { AtLeastOne } from "./utils.d.ts"; export const DEFAULT_API_VERSION = "v21.0";