Skip to content

Conversation

leoisadev8
Copy link

@leoisadev8 leoisadev8 commented Feb 11, 2025

Fixes #76

Update createDocument method to improve TypeScript autocompletion.

  • src/models.ts

    • Remove the string index signature from Models.Document.
    • Add a new type AnyDocument extending Models.Document with the string index signature.
  • src/services/databases.ts

    • Update createDocument method to use T extends Models.Document = Models.AnyDocument.
    • Update data parameter type to Omit<T, keyof Models.Document>.

For more details, open the Copilot Workspace session.

Fixes #76

Update `createDocument` method to improve TypeScript autocompletion.

* **src/models.ts**
  - Remove the string index signature from `Models.Document`.
  - Add a new type `AnyDocument` extending `Models.Document` with the string index signature.

* **src/services/databases.ts**
  - Update `createDocument` method to use `T extends Models.Document = Models.AnyDocument`.
  - Update `data` parameter type to `Omit<T, keyof Models.Document>`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/appwrite/sdk-for-web/issues/76?shareId=XXXX-XXXX-XXXX-XXXX).
Copy link

This library is auto-generated by the Appwrite SDK Generator, and does not accept pull requests directly. To learn more about how you can help us improve this SDK, please check the contributing guide.

@github-actions github-actions bot closed this Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Document autocompletion for Databases.createDocument broken
1 participant