Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix autocomplete for Databases.createDocument #119

Closed
wants to merge 1 commit into from

Conversation

Gl1tchblade
Copy link

@Gl1tchblade Gl1tchblade 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
# for free to join this conversation on GitHub. Already have an account? # 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