From 013e768fe6f6ce855c4c3a1d37de8bf4d6e6295e Mon Sep 17 00:00:00 2001 From: Alex Iglesias Date: Mon, 11 Mar 2024 18:46:27 +0100 Subject: [PATCH] feat: export all types (#31) * feat: export all types * fix: export --- .changeset/modern-ears-joke.md | 5 ++++ src/index.ts | 2 +- src/types.ts | 47 +++++++++++++++++++--------------- 3 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 .changeset/modern-ears-joke.md diff --git a/.changeset/modern-ears-joke.md b/.changeset/modern-ears-joke.md new file mode 100644 index 0000000..650a406 --- /dev/null +++ b/.changeset/modern-ears-joke.md @@ -0,0 +1,5 @@ +--- +'fireworkers': minor +--- + +feat: export all types diff --git a/src/index.ts b/src/index.ts index 80b3857..3ec7c02 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,5 +4,5 @@ export * from './init'; export * from './query'; export * from './remove'; export * from './set'; -export type { DB } from './types'; +export * from './types'; export * from './update'; diff --git a/src/types.ts b/src/types.ts index 87aeec7..caef544 100644 --- a/src/types.ts +++ b/src/types.ts @@ -47,39 +47,39 @@ export interface StructuredQuery { limit?: number | { value: number }; } -interface Projection { +export interface Projection { fields?: FieldReference[]; } -interface FieldReference { +export interface FieldReference { fieldPath?: string; } -interface CollectionSelector { +export interface CollectionSelector { collectionId?: string; allDescendants?: boolean; } -interface Filter { +export interface Filter { compositeFilter?: CompositeFilter; fieldFilter?: FieldFilter; unaryFilter?: UnaryFilter; } -interface CompositeFilter { +export interface CompositeFilter { op?: CompositeFilterOp; filters?: Filter[]; } -type CompositeFilterOp = 'OPERATOR_UNSPECIFIED' | 'AND' | 'OR'; +export type CompositeFilterOp = 'OPERATOR_UNSPECIFIED' | 'AND' | 'OR'; -interface FieldFilter { +export interface FieldFilter { field?: FieldReference; op?: FieldFilterOp; value?: Value; } -type FieldFilterOp = +export type FieldFilterOp = | 'OPERATOR_UNSPECIFIED' | 'LESS_THAN' | 'LESS_THAN_OR_EQUAL' @@ -92,60 +92,65 @@ type FieldFilterOp = | 'ARRAY_CONTAINS_ANY' | 'NOT_IN'; -type ValueNullValue = 'NULL_VALUE'; +export type ValueNullValue = 'NULL_VALUE'; export type Timestamp = string | { seconds?: string | number; nanos?: number }; -interface LatLng { +export interface LatLng { latitude?: number; longitude?: number; } -interface ArrayValue { +export interface ArrayValue { values?: Value[]; } -interface MapValue { +export interface MapValue { fields?: ApiClientObjectMap; } -interface ApiClientObjectMap { +export interface ApiClientObjectMap { [k: string]: T; } -interface Order { +export interface Order { field?: FieldReference; direction?: OrderDirection; } -type OrderDirection = 'DIRECTION_UNSPECIFIED' | 'ASCENDING' | 'DESCENDING'; +export type OrderDirection = 'DIRECTION_UNSPECIFIED' | 'ASCENDING' | 'DESCENDING'; -interface Cursor { +export interface Cursor { values?: Value[]; before?: boolean; } -interface UnaryFilter { +export interface UnaryFilter { op?: UnaryFilterOp; field?: FieldReference; } -type UnaryFilterOp = 'OPERATOR_UNSPECIFIED' | 'IS_NAN' | 'IS_NULL' | 'IS_NOT_NAN' | 'IS_NOT_NULL'; +export type UnaryFilterOp = + | 'OPERATOR_UNSPECIFIED' + | 'IS_NAN' + | 'IS_NULL' + | 'IS_NOT_NAN' + | 'IS_NOT_NULL'; export interface TransactionOptions { readOnly?: ReadOnly; readWrite?: ReadWrite; } -interface ReadOnly { +export interface ReadOnly { readTime?: string; } -interface ReadWrite { +export interface ReadWrite { retryTransaction?: string; } -interface Status { +export interface Status { code?: number; message?: string; status?: string;