Make sure ton add the following values to your .env
:
FIREBASE_PROJECT_ID
FIREBASE_PRIVATE_KEY
FIREBASE_CLIENT_EMAIL
Then run the following command :
npx fetch-firestore-types
# yarn
yarn add fetch-firestore-types
# npm
npm install fetch-firestore-types
Make sure ton add the following values to your .env
:
FIREBASE_PROJECT_ID
FIREBASE_PRIVATE_KEY
FIREBASE_CLIENT_EMAIL
import { FetchNewTypes } from "fetch-firestore-types/dist/main";
await FetchNewTypes();
Name | Default value | Description |
---|---|---|
outDir | "/types" |
The folder where the type file will be generated |
queryResultsLength | 25 |
Number of items per collection to creates types on |
Params can be passed as arguments in any order, except for the outDir which might be followed by the path.
npx fetch-appwrite-types includeDBName outDir /types queryResultsLength 50
await FetchNewTypes({
outDir: "/types",
queryResultsLength: 50,
})
Appwrite type | Generated type (simple) |
---|---|
String | string |
Integer / Double | integer |
Boolean | boolean |
Null | null |
Array | Array<any> |
Object | Object |