Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: export all types #31

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/modern-ears-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'fireworkers': minor
---

feat: export all types
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
47 changes: 26 additions & 21 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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<Value>;
}

interface ApiClientObjectMap<T> {
export interface ApiClientObjectMap<T> {
[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;
Expand Down