Skip to content

Commit 2c3787d

Browse files
authored
Merge pull request #398 from Secreto31126/test-extension
Added .d.ts extension to import type
2 parents 5da46eb + 59fc38d commit 2c3787d

17 files changed

+23
-23
lines changed

src/emitters.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import type {
77
ServerPricing,
88
ServerError,
99
PostData
10-
} from "./types";
11-
import type { WhatsAppAPI } from "./index";
12-
import type { MaybePromise } from "./utils";
10+
} from "./types.d.ts";
11+
import type { WhatsAppAPI } from "./index.d.ts";
12+
import type { MaybePromise } from "./utils.d.ts";
1313

1414
/**
1515
* Callback for "sent" event

src/errors.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// This import makes the docs' links work
1616
// eslint-disable-next-line @typescript-eslint/no-unused-vars
17-
import type { WhatsAppAPI } from "./index";
17+
import type { WhatsAppAPI } from "./index.d.ts";
1818

1919
/**
2020
* The library's base exception class.

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import type {
2323
OnSentArgs,
2424
OnStatus,
2525
OnStatusArgs
26-
} from "./emitters";
26+
} from "./emitters.d.ts";
2727

2828
import { escapeUnicode, MaybePromise } from "./utils.js";
2929
import { DEFAULT_API_VERSION } from "./types.js";

src/messages/contacts.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
ContactUniqueComponent,
55
ContactMultipleComponent
66
} from "../types.js";
7-
import type { AtLeastOne } from "../utils";
7+
import type { AtLeastOne } from "../utils.d.ts";
88

99
/**
1010
* @group Contacts

src/messages/globals.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Section, type ClientTypedMessageComponent } from "../types.js";
2-
import type { AtLeastOne } from "../utils";
2+
import type { AtLeastOne } from "../utils.d.ts";
33

44
/**
55
* TS knowledge intensifies

src/messages/interactive.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import {
44
Section,
55
type InteractiveAction
66
} from "../types.js";
7-
import type { AtLeastOne } from "../utils";
7+
import type { AtLeastOne } from "../utils.d.ts";
88

9-
import type { Document, Image, Video } from "./media";
9+
import type { Document, Image, Video } from "./media.d.ts";
1010

1111
import { CatalogProduct, Product, ProductSection } from "./globals.js";
1212

src/messages/template.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import {
55
type ClientTypedMessageComponent,
66
type TemplateComponent
77
} from "../types.js";
8-
import type { AtLeastOne, XOR } from "../utils";
8+
import type { AtLeastOne, XOR } from "../utils.d.ts";
99

10-
import type { Location } from "./location";
11-
import type { Document, Image, Video } from "./media";
10+
import type { Location } from "./location.d.ts";
11+
import type { Document, Image, Video } from "./media.d.ts";
1212

1313
import { CatalogProduct, Product, ProductSection } from "./globals.js";
1414

src/middleware/adonis.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { WhatsAppAPIMiddleware } from "./globals.js";
22
import { WhatsAppAPIError } from "../errors.js";
33

44
import type { Request } from "@adonisjs/http-server";
5-
import type { GetParams, PostData } from "../types";
5+
import type { GetParams, PostData } from "../types.d.ts";
66

77
/**
88
* AdonisJS middleware for WhatsAppAPI

src/middleware/express.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { WhatsAppAPIMiddleware } from "./globals.js";
22
import { WhatsAppAPIError } from "../errors.js";
33

44
import type { Request } from "express";
5-
import type { GetParams } from "../types";
5+
import type { GetParams } from "../types.d.ts";
66

77
/**
88
* Express.js middleware for WhatsAppAPI

src/middleware/node-http.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { WhatsAppAPIError } from "../errors.js";
44
import type { IncomingMessage } from "node:http";
55
import type { Readable } from "node:stream";
66

7-
import type { GetParams } from "../types";
7+
import type { GetParams } from "../types.d.ts";
88

99
/**
1010
* node:http server middleware for WhatsAppAPI

src/middleware/vercel.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { WhatsAppAPI as NodeHTTPMiddleware } from "./node-http.js";
22
import { WhatsAppAPIError } from "../errors.js";
33

44
import type { VercelRequest } from "@vercel/node";
5-
import type { GetParams } from "../types.js";
5+
import type { GetParams } from "../types.d.ts";
66

77
/**
88
* Vercel serverless functions middleware for WhatsAppAPI (Node/Next.js)

src/middleware/web-standard.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { WhatsAppAPIMiddleware } from "./globals.js";
22
import { WhatsAppAPIError } from "../errors.js";
33

4-
import type { GetParams } from "../types";
4+
import type { GetParams } from "../types.d.ts";
55

66
/**
77
* Web Standard API http server middleware for WhatsAppAPI (deno/bun/SvelteKit/NextJS/Hono)

src/setup/bun.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { WhatsAppAPIConstructorArguments } from "../types";
1+
import type { WhatsAppAPIConstructorArguments } from "../types.d.ts";
22

33
/**
44
* A Bun quick setup for the WhatsAppAPI

src/setup/deno.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { WhatsAppAPIConstructorArguments } from "../types";
1+
import type { WhatsAppAPIConstructorArguments } from "../types.d.ts";
22

33
/**
44
* A Deno quick setup for the WhatsAppAPI

src/setup/node.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { WhatsAppAPIConstructorArguments } from "../types";
1+
import type { WhatsAppAPIConstructorArguments } from "../types.d.ts";
22

33
// If this line of code didn't exist,
44
// setup would be a single file rather than a folder

src/setup/web.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { WhatsAppAPIConstructorArguments } from "../types";
1+
import type { WhatsAppAPIConstructorArguments } from "../types.d.ts";
22

33
/**
44
* A Web quick setup for the WhatsAppAPI

src/types.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import type {
1919
Template,
2020
Reaction,
2121
Contacts
22-
} from "./messages";
23-
import type { AtLeastOne } from "./utils";
22+
} from "./messages/index.d.ts";
23+
import type { AtLeastOne } from "./utils.d.ts";
2424

2525
export const DEFAULT_API_VERSION = "v21.0";
2626

0 commit comments

Comments
 (0)