15.17.15 • Published 1 year ago

@getcircuit/firestore-types v15.17.15

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

@getcircuit/firestore-types

A workaround to allow us to override Firestore types in our projects. Its default exports are client-side Firestore types.

Rationale

When we aim to share model types between the client and server Firestore, we hit a snag: The types related to Firestore References in our @getcircuit/schema package are based on client Firestore types. However, when these types are consumed in server-side projects (like Engine), it leads to type discrepancies and errors. This package serves as an intermediary to bridge this gap and provides a mechanism to override the Firestore types to the appropriate ones for the given context (client or server).

Usage in @getcircuit/schema

Instead of pulling the types directly from the firebase package, our schema package pulls them from this package instead. This allows us to override the types in a consuming project.

Overriding types in a consuming project

Take this firestore-types.d.ts file for Engine as an example:

declare module '@getcircuit/firestore-types' {
  export type Timestamp = import('@google-cloud/firestore').Timestamp;
  export type GeoPoint = import('@google-cloud/firestore').GeoPoint;
  export type DocumentReference<T = any> =
    import('@google-cloud/firestore').DocumentReference<T>;
  export type CollectionReference<T = any> =
    import('@google-cloud/firestore').CollectionReference<T>;
  export type Query<T = any> = import('@google-cloud/firestore').Query<T>;
  export type QuerySnapshot<T = any> =
    import('@google-cloud/firestore').QuerySnapshot<T>;
  export type DocumentSnapshot<T = any> =
    import('@google-cloud/firestore').DocumentSnapshot<T>;
}

Note: use import() instead of import expressions otherwise the original types will not be overridden.

15.17.15

1 year ago

15.17.14

1 year ago

15.17.13

1 year ago

15.17.12

1 year ago

15.17.11

1 year ago

15.17.10

1 year ago

15.17.9

1 year ago

15.17.8

1 year ago

15.17.7

1 year ago

15.17.6

1 year ago

15.17.5

1 year ago

15.17.4

1 year ago

15.17.3

1 year ago

15.17.2

1 year ago

15.17.1

1 year ago

15.18.0-leo.0

1 year ago

15.17.0

1 year ago

15.16.2-leo.0

1 year ago

15.16.1

1 year ago

15.16.0

1 year ago

15.15.2

1 year ago

15.15.1

1 year ago

15.15.0

1 year ago

15.14.0

1 year ago

15.13.6

1 year ago

15.13.5

1 year ago

15.13.4

1 year ago

15.13.3

1 year ago

15.13.2

1 year ago

15.13.1

1 year ago

15.13.0

1 year ago

15.12.12

1 year ago

15.12.11

1 year ago

15.12.10

1 year ago

15.12.6

1 year ago

15.12.5

1 year ago

15.12.2

1 year ago

15.12.1

1 year ago

15.12.0

1 year ago

15.12.0-slct.0

2 years ago

15.11.0-leo.0

2 years ago

15.9.0-sd.0

2 years ago

15.7.0-select.0

2 years ago

15.6.11

2 years ago

15.6.9-potato.1

2 years ago

15.6.9-potato.0

2 years ago

15.7.0-pow.0

2 years ago

15.6.8-potato.0

2 years ago

15.6.8-intl.0

2 years ago

15.6.8-pow.0

2 years ago

15.6.7

2 years ago

15.6.6

2 years ago

15.6.5-pow.0

2 years ago

15.6.3

2 years ago

15.6.2-pow.0

2 years ago

15.6.0

2 years ago

15.6.0-pow.0

2 years ago

15.2.0-pow.0

2 years ago

15.1.0-dws.0

2 years ago

15.0.0

2 years ago

14.49.0-zoning.0

2 years ago

14.45.3

2 years ago

14.39.2-potato.0

2 years ago

14.39.2

2 years ago

14.36.0-alpha.0

2 years ago

14.35.0

2 years ago

14.34.2

2 years ago

14.34.1

2 years ago

14.34.0

2 years ago

14.33.1

2 years ago