Types API¶
Core value objects in tryx.types define identity, message metadata, and result contracts used across client namespaces.
Identity and Source Types¶
JID¶
Canonical WhatsApp identifier:
user: account or group numeric/opaque idserver: domain segment (s.whatsapp.net,g.us, etc.)
MessageSource¶
Routing context for a message:
- sender identity
- target chat identity
- from-me and group flags
- alternate identity hints for multi-device routing
MessageInfo¶
Message metadata envelope:
idtypetimestampsource- edit and verification metadata
Send and Media Result Types¶
| Type | Produced by |
|---|---|
UploadResponse | upload, upload_file |
SendResult | send_* methods |
MediaReuploadResult | request_media_reupload |
ProfilePicture | client.contact.get_profile_picture |
Advanced Metadata Types¶
MsgBotInfoMsgMetaInfoDeviceSentMeta
These are useful when building sync-aware systems and diagnostics.
Practical Typed Patterns¶
Privacy Type Bridge¶
Privacy and status workflows (documented in Privacy Namespace and Status Namespace) rely on typed enums from the client surface, including:
PrivacyCategoryPrivacyValueDisallowedListActionStatusPrivacySetting
Type-first architecture
Keep handler boundaries typed. Convert external payloads into typed objects early, and keep business logic free of ad-hoc dict parsing.