A library of typescript interfaces that extend existing firebase classes, adding type safety and a better autocomplete experience.

Installation

npm install typesafe-firestore --save-dev

Usage

You most likely want to import TypedCollectionReference and create your collections as shown below.

import firebase from ' firebase/app ' ; import ' firebase/firestore ' ; import { TypedCollectionReference } from ' typesafe-firestore ' ; interface Author { ; ; ; } ;

And then you can use your typesafe collection the same ways you would use the regular firestore library.

AuthorCollection . add ( ) ; AuthorCollection . add ( ) ; AuthorCollection . where ( ' penName ' , ' <= ' , ' Barfunk ' ) ; AuthorCollection . where ( ' realName ' , ' <= ' , ' Barfunk ' ) ;

License

typesafe-firestore is MIT licensed.