@wats/types 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
# @wats/types
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared TypeScript contracts for WATS and WhatsApp Cloud API payloads: config, webhook envelopes, message unions, status payloads, contacts, entities, and errors.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add @wats/types
|
|
9
|
+
npm i @wats/types
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Usage
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import type { WhatsAppMessage, WhatsAppMessageStatus } from "@wats/types";
|
|
16
|
+
|
|
17
|
+
function describeMessage(message: WhatsAppMessage): string {
|
|
18
|
+
return message.type;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function isRead(status: WhatsAppMessageStatus): boolean {
|
|
22
|
+
return status.status === "read";
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Use this package when you need WATS domain types without the Graph client, webhook adapter, CLI, or service runtime. Runtime helpers live in the other `@wats/*` packages.
|
|
27
|
+
|
|
28
|
+
Docs: https://github.com/Switchbord/wats
|
|
29
|
+
License: MIT
|