Commit 53f58ac
committed
Fix autocomplete for Databases.createDocument
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).1 parent 3bb1cfa commit 53f58ac
2 files changed
+12
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
59 | | - | |
| 58 | + | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
215 | 220 | | |
216 | 221 | | |
217 | 222 | | |
| |||
978 | 983 | | |
979 | 984 | | |
980 | 985 | | |
981 | | - | |
982 | | - | |
| 986 | + | |
| 987 | + | |
983 | 988 | | |
984 | 989 | | |
985 | 990 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
| 60 | + | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
0 commit comments