docs: update getDeviceData documentation with detailed usage and examples#3
docs: update getDeviceData documentation with detailed usage and examples#3aiko-chan-ai wants to merge 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the documentation for the getDeviceData() method across three files: the TypeScript source code (src/client.ts) and both English and Vietnamese documentation files (DOCS.md and DOCS_VI.md). The documentation is enhanced with detailed explanations of what device data includes, usage examples, and descriptions of device store modes. Additionally, the PR includes an unrelated change to .gitattributes that enforces LF line endings.
Changes:
- Enhanced JSDoc comments for
getDeviceData()in src/client.ts with detailed usage information and examples - Updated DOCS.md with comprehensive documentation including device store modes table and database storage examples
- Updated DOCS_VI.md (Vietnamese) with equivalent documentation changes
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/client.ts | Enhanced JSDoc documentation for getDeviceData() method with detailed explanation and database usage example |
| DOCS.md | Expanded documentation with device store modes table, use cases, and additional code examples |
| DOCS_VI.md | Vietnamese translation of the expanded documentation |
| .gitattributes | Added eol=lf to enforce LF line endings (unrelated to documentation update) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * - All sessions and identities | ||
| * | ||
| * Works with all device store modes: | ||
| * - `e2eeMemoryOnly: true` - Get the ephemeral device data before it's lost |
There was a problem hiding this comment.
The documentation references a non-existent option e2eeMemoryOnly: true. Based on the ClientOptions interface in src/types.ts (lines 388-401), the available device store options are only devicePath and deviceData. Memory-only mode is implicitly enabled when neither option is provided to the Client constructor. The correct documentation should reflect this: when neither devicePath nor deviceData is specified, the device data is only stored in memory and lost on disconnect.
| * - `e2eeMemoryOnly: true` - Get the ephemeral device data before it's lost | |
| * - In-memory mode (default when neither `devicePath` nor `deviceData` is set) - Get the ephemeral device data before it's lost |
| | `e2eeMemoryOnly: true` | Get the ephemeral device data before it's lost on disconnect | | ||
| | `deviceData: "..."` | Get the updated state after sessions/keys change | | ||
| | `devicePath: "..."` | Get current state (also auto-saved to file) | |
There was a problem hiding this comment.
The documentation references a non-existent option e2eeMemoryOnly: true. Based on the ClientOptions interface in src/types.ts (lines 388-401), the available device store options are only devicePath and deviceData. Memory-only mode is implicitly enabled when neither option is provided. Update the table to correctly describe the actual device store modes: no options specified (memory-only), deviceData specified, or devicePath specified.
| | `e2eeMemoryOnly: true` | Get the ephemeral device data before it's lost on disconnect | | |
| | `deviceData: "..."` | Get the updated state after sessions/keys change | | |
| | `devicePath: "..."` | Get current state (also auto-saved to file) | | |
| | _No device store options specified_ | Memory-only mode: get ephemeral device data before it's lost on disconnect | | |
| | `deviceData: "..."` | In-memory + caller-managed persistence: get the updated state after sessions/keys change | | |
| | `devicePath: "..."` | File-based persistence: get current state (also auto-saved to file) | |
|
|
||
| | Chế độ | Mô tả | | ||
| |------|-------------| | ||
| | `e2eeMemoryOnly: true` | Lấy dữ liệu tạm thời trước khi mất khi ngắt kết nối | |
There was a problem hiding this comment.
The documentation references a non-existent option e2eeMemoryOnly: true. Based on the ClientOptions interface in src/types.ts (lines 388-401), the available device store options are only devicePath and deviceData. Memory-only mode is implicitly enabled when neither option is provided. Update the table to correctly describe the actual device store modes: no options specified (memory-only), deviceData specified, or devicePath specified.
| | `e2eeMemoryOnly: true` | Lấy dữ liệu tạm thời trước khi mất khi ngắt kết nối | | |
| | Không cấu hình device store (không truyền `devicePath` hoặc `deviceData`) | Lấy dữ liệu tạm thời trong memory-only mode trước khi mất khi ngắt kết nối | |
tks copilot