Skip to content

Commit 306e59a

Browse files
Lint
1 parent abda8e9 commit 306e59a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+48
-114
lines changed

packages/firestore/src/core/bundle.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import { LoadBundleTaskProgress } from '@firebase/firestore-types';
1919

2020
import { MutableDocumentMap } from '../model/collections';
21-
import { Document } from '../model/document';
2221
import { DocumentKey } from '../model/document_key';
22+
import { MutableDocument } from '../model/mutable_document';
2323
import { BundledDocumentMetadata as ProtoBundledDocumentMetadata } from '../protos/firestore_bundle_proto';
2424
import {
2525
Document as ApiDocument,
@@ -28,7 +28,6 @@ import {
2828

2929
import { Query } from './query';
3030
import { SnapshotVersion } from './snapshot_version';
31-
import { MutableDocument } from '../model/mutable_document';
3231

3332
/**
3433
* Represents a bundled document, including the metadata and the document

packages/firestore/src/core/bundle_impl.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import {
2323
localStoreSaveNamedQuery
2424
} from '../local/local_store_impl';
2525
import { documentKeySet, DocumentKeySet } from '../model/collections';
26-
import { Document } from '../model/document';
2726
import { DocumentKey } from '../model/document_key';
27+
import { MutableDocument } from '../model/mutable_document';
2828
import {
2929
BundleMetadata as ProtoBundleMetadata,
3030
NamedQuery as ProtoNamedQuery
@@ -46,7 +46,6 @@ import {
4646
BundleLoadResult
4747
} from './bundle';
4848
import { SnapshotVersion } from './snapshot_version';
49-
import { MutableDocument } from '../model/mutable_document';
5049

5150
/**
5251
* Helper to convert objects from bundles to model objects in the SDK.

packages/firestore/src/core/firestore_client.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ import { Transaction } from './transaction';
8585
import { TransactionRunner } from './transaction_runner';
8686
import { View } from './view';
8787
import { ViewSnapshot } from './view_snapshot';
88-
import { MutableDocument } from '../model/mutable_document';
8988

9089
const LOG_TAG = 'FirestoreClient';
9190
export const MAX_CONCURRENT_LIMBO_RESOLUTIONS = 100;

packages/firestore/src/core/sync_engine_impl.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ import { TargetData, TargetPurpose } from '../local/target_data';
4545
import {
4646
DocumentKeySet,
4747
documentKeySet,
48-
DocumentMap,
49-
MutableDocumentMap
48+
DocumentMap
5049
} from '../model/collections';
5150
import { DocumentKey } from '../model/document_key';
51+
import { MutableDocument } from '../model/mutable_document';
5252
import { Mutation } from '../model/mutation';
5353
import { MutationBatchResult } from '../model/mutation_batch';
5454
import { ResourcePath } from '../model/path';
@@ -114,7 +114,6 @@ import {
114114
ViewChange
115115
} from './view';
116116
import { ViewSnapshot } from './view_snapshot';
117-
import { MutableDocument } from '../model/mutable_document';
118117

119118
const LOG_TAG = 'SyncEngine';
120119

packages/firestore/src/core/target.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18+
import { Document } from '../model/document';
1819
import { DocumentKey } from '../model/document_key';
1920
import { FieldPath, ResourcePath } from '../model/path';
2021
import {
@@ -29,7 +30,6 @@ import {
2930
import { Value as ProtoValue } from '../protos/firestore_proto_api';
3031
import { debugAssert, debugCast, fail } from '../util/assert';
3132
import { isNullOrUndefined } from '../util/types';
32-
import { Document } from '../model/document';
3333

3434
/**
3535
* A Target represents the WatchTarget representation of a Query, which is used

packages/firestore/src/core/transaction.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { fail, debugAssert } from '../util/assert';
3333
import { Code, FirestoreError } from '../util/error';
3434

3535
import { SnapshotVersion } from './snapshot_version';
36-
import { MutableDocument } from '../model/mutable_document';
3736

3837
/**
3938
* Internal transaction object responsible for accumulating the mutations to

packages/firestore/src/core/view_snapshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
*/
1717

1818
import { DocumentKeySet } from '../model/collections';
19+
import { Document } from '../model/document';
1920
import { DocumentKey } from '../model/document_key';
2021
import { DocumentSet } from '../model/document_set';
2122
import { fail } from '../util/assert';
2223
import { SortedMap } from '../util/sorted_map';
2324

2425
import { Query, queryEquals } from './query';
25-
import { Document } from '../model/document';
2626

2727
export const enum ChangeType {
2828
Added,

packages/firestore/src/exp/reference_impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ import { cast } from '../util/input_validation';
6262

6363
import { ensureFirestoreConfigured, FirebaseFirestore } from './database';
6464
import { DocumentSnapshot, QuerySnapshot, SnapshotMetadata } from './snapshot';
65-
import { MutableDocument } from '../model/mutable_document';
6665

6766
/**
6867
* An options object that can be passed to {@link onSnapshot} and {@link

packages/firestore/src/exp/snapshot.ts

Lines changed: 1 addition & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -26,57 +26,14 @@ import {
2626
fieldPathFromArgument,
2727
FirestoreDataConverter as LiteFirestoreDataConverter
2828
} from '../lite/snapshot';
29-
import { DocumentKey } from '../model/document_key';
3029
import { Document } from '../model/document';
30+
import { DocumentKey } from '../model/document_key';
3131
import { debugAssert, fail } from '../util/assert';
3232
import { Code, FirestoreError } from '../util/error';
3333

3434
import { FirebaseFirestore } from './database';
3535
import { SnapshotListenOptions } from './reference_impl';
36-
import { MutableDocument } from '../model/mutable_document';
3736

38-
/**
39-
* Converter used by `withConverter()` to transform user objects of type `T`
40-
* into Firestore data.
41-
*
42-
* Using the converter allows you to specify generic type arguments when
43-
* storing and retrieving objects from Firestore.
44-
*
45-
* @example
46-
* ```typescript
47-
* class Post {
48-
* constructor(readonly title: string, readonly author: string) {}
49-
*
50-
* toString(): string {
51-
* return this.title + ', by ' + this.author;
52-
* }
53-
* }
54-
*
55-
* const postConverter = {
56-
* toFirestore(post: Post): firebase.firestore.DocumentData {
57-
* return {title: post.title, author: post.author};
58-
* },
59-
* fromFirestore(
60-
* snapshot: firebase.firestore.QueryDocumentSnapshot,
61-
* options: firebase.firestore.SnapshotOptions
62-
* ): Post {
63-
* const data = snapshot.data(options)!;
64-
* return new Post(data.title, data.author);
65-
* }
66-
* };
67-
*
68-
* const postSnap = await firebase.firestore()
69-
* .collection('posts')
70-
* .withConverter(postConverter)
71-
* .doc().get();
72-
* const post = postSnap.data();
73-
* if (post !== undefined) {
74-
* post.title; // string
75-
* post.toString(); // Should be defined
76-
* post.someNonExistentProperty; // TS error
77-
* }
78-
* ```
79-
*/
8037
export interface FirestoreDataConverter<T>
8138
extends LiteFirestoreDataConverter<T> {
8239
/**

packages/firestore/src/lite/query.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ import {
6161
import { FieldPath } from './field_path';
6262
import { DocumentReference, Query } from './reference';
6363
import { DocumentSnapshot, fieldPathFromArgument } from './snapshot';
64-
import { MutableDocument } from '../model/mutable_document';
6564

6665
export function validateHasExplicitOrderByForLimitToLast(
6766
query: InternalQuery

packages/firestore/src/lite/reference_impl.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ import {
5959
QueryDocumentSnapshot,
6060
QuerySnapshot
6161
} from './snapshot';
62-
import { MutableDocument } from '../model/mutable_document';
6362

6463
/**
6564
* Converts custom model object of type T into DocumentData by applying the

packages/firestore/src/lite/snapshot.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
UntypedFirestoreDataConverter
2222
} from '../api/user_data_reader';
2323
import { AbstractUserDataWriter } from '../api/user_data_writer';
24+
import { Document } from '../model/document';
2425
import { DocumentKey } from '../model/document_key';
2526
import { FieldPath as InternalFieldPath } from '../model/path';
2627
import { arrayEquals } from '../util/misc';
@@ -34,7 +35,6 @@ import {
3435
queryEqual,
3536
SetOptions
3637
} from './reference';
37-
import { Document } from '../model/document';
3838

3939
/**
4040
* Converter used by `withConverter()` to transform user objects of type `T`

packages/firestore/src/lite/transaction.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ import {
4141
} from './reference_impl';
4242
import { DocumentSnapshot } from './snapshot';
4343
import { validateReference } from './write_batch';
44-
import { MutableDocument } from '../model/mutable_document';
4544

4645
// TODO(mrschmidt) Consider using `BaseTransaction` as the base class in the
4746
// legacy SDK.

packages/firestore/src/local/indexeddb_remote_document_cache.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ import { isCollectionGroupQuery, Query, queryMatches } from '../core/query';
1919
import { SnapshotVersion } from '../core/snapshot_version';
2020
import {
2121
DocumentKeySet,
22-
DocumentMap,
23-
documentMap,
2422
DocumentSizeEntries,
2523
DocumentSizeEntry,
2624
MutableDocumentMap,
2725
mutableDocumentMap
2826
} from '../model/collections';
29-
import { Document } from '../model/document';
3027
import { DocumentKey } from '../model/document_key';
28+
import { MutableDocument } from '../model/mutable_document';
3129
import { ResourcePath } from '../model/path';
3230
import { debugAssert, debugCast, hardAssert } from '../util/assert';
3331
import { primitiveComparator } from '../util/misc';
@@ -56,7 +54,6 @@ import { PersistenceTransaction } from './persistence_transaction';
5654
import { RemoteDocumentCache } from './remote_document_cache';
5755
import { RemoteDocumentChangeBuffer } from './remote_document_change_buffer';
5856
import { IterateOptions, SimpleDbStore } from './simple_db';
59-
import { MutableDocument } from '../model/mutable_document';
6057

6158
export interface IndexedDbRemoteDocumentCache extends RemoteDocumentCache {
6259
// The IndexedDbRemoteDocumentCache doesn't implement any methods on top

packages/firestore/src/local/local_documents_view.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
} from '../model/collections';
3434
import { Document } from '../model/document';
3535
import { DocumentKey } from '../model/document_key';
36+
import { MutableDocument } from '../model/mutable_document';
3637
import { applyMutationToLocalView, PatchMutation } from '../model/mutation';
3738
import { MutationBatch } from '../model/mutation_batch';
3839
import { ResourcePath } from '../model/path';
@@ -43,7 +44,6 @@ import { MutationQueue } from './mutation_queue';
4344
import { PersistencePromise } from './persistence_promise';
4445
import { PersistenceTransaction } from './persistence_transaction';
4546
import { RemoteDocumentCache } from './remote_document_cache';
46-
import { MutableDocument } from '../model/mutable_document';
4747

4848
/**
4949
* A readonly view of the local state of all documents we're tracking (i.e. we

packages/firestore/src/local/local_serializer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import { BundleMetadata, NamedQuery } from '../core/bundle';
2020
import { LimitType, Query, queryWithLimit } from '../core/query';
2121
import { SnapshotVersion } from '../core/snapshot_version';
2222
import { canonifyTarget, isDocumentTarget, Target } from '../core/target';
23-
import { Document } from '../model/document';
2423
import { DocumentKey } from '../model/document_key';
24+
import { MutableDocument } from '../model/mutable_document';
2525
import { MutationBatch } from '../model/mutation_batch';
2626
import {
2727
BundleMetadata as ProtoBundleMetadata,
@@ -58,7 +58,6 @@ import {
5858
DbUnknownDocument
5959
} from './indexeddb_schema';
6060
import { TargetData, TargetPurpose } from './target_data';
61-
import { MutableDocument } from '../model/mutable_document';
6261

6362
/** Serializer for values stored in the LocalStore. */
6463
export class LocalSerializer {

packages/firestore/src/local/memory_persistence.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { ListenSequence } from '../core/listen_sequence';
2020
import { ListenSequenceNumber, TargetId } from '../core/types';
2121
import { Document } from '../model/document';
2222
import { DocumentKey } from '../model/document_key';
23+
import { MutableDocument } from '../model/mutable_document';
2324
import { estimateByteSize } from '../model/values';
2425
import { JsonProtoSerializer } from '../remote/serializer';
2526
import { fail } from '../util/assert';
@@ -52,7 +53,6 @@ import {
5253
} from './persistence_transaction';
5354
import { ReferenceSet } from './reference_set';
5455
import { TargetData } from './target_data';
55-
import { MutableDocument } from '../model/mutable_document';
5656

5757
const LOG_TAG = 'MemoryPersistence';
5858
/**

packages/firestore/src/local/memory_remote_document_cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import {
2525
} from '../model/collections';
2626
import { Document } from '../model/document';
2727
import { DocumentKey } from '../model/document_key';
28+
import { MutableDocument } from '../model/mutable_document';
2829
import { debugAssert } from '../util/assert';
2930
import { SortedMap } from '../util/sorted_map';
3031

@@ -33,7 +34,6 @@ import { PersistencePromise } from './persistence_promise';
3334
import { PersistenceTransaction } from './persistence_transaction';
3435
import { RemoteDocumentCache } from './remote_document_cache';
3536
import { RemoteDocumentChangeBuffer } from './remote_document_change_buffer';
36-
import { MutableDocument } from '../model/mutable_document';
3737

3838
export type DocumentSizer = (doc: Document) => number;
3939

packages/firestore/src/local/query_engine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ import {
3131
DocumentMap,
3232
MutableDocumentMap
3333
} from '../model/collections';
34+
import { MutableDocument } from '../model/mutable_document';
3435
import { debugAssert } from '../util/assert';
3536
import { getLogLevel, LogLevel, logDebug } from '../util/log';
3637
import { SortedSet } from '../util/sorted_set';
3738

3839
import { LocalDocumentsView } from './local_documents_view';
3940
import { PersistencePromise } from './persistence_promise';
4041
import { PersistenceTransaction } from './persistence_transaction';
41-
import { MutableDocument } from '../model/mutable_document';
4242

4343
/**
4444
* A query engine that takes advantage of the target document mapping in the

packages/firestore/src/local/remote_document_cache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ import { Query } from '../core/query';
1919
import { SnapshotVersion } from '../core/snapshot_version';
2020
import { DocumentKeySet, MutableDocumentMap } from '../model/collections';
2121
import { DocumentKey } from '../model/document_key';
22+
import { MutableDocument } from '../model/mutable_document';
2223

2324
import { PersistencePromise } from './persistence_promise';
2425
import { PersistenceTransaction } from './persistence_transaction';
2526
import { RemoteDocumentChangeBuffer } from './remote_document_change_buffer';
26-
import { MutableDocument } from '../model/mutable_document';
2727

2828
/**
2929
* Represents cached documents received from the remote backend.

packages/firestore/src/local/remote_document_change_buffer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717

1818
import { SnapshotVersion } from '../core/snapshot_version';
1919
import { DocumentKeySet, MutableDocumentMap } from '../model/collections';
20-
import { Document } from '../model/document';
2120
import { DocumentKey } from '../model/document_key';
21+
import { MutableDocument } from '../model/mutable_document';
2222
import { debugAssert } from '../util/assert';
2323
import { ObjectMap } from '../util/obj_map';
2424

2525
import { PersistencePromise } from './persistence_promise';
2626
import { PersistenceTransaction } from './persistence_transaction';
27-
import { MutableDocument } from '../model/mutable_document';
2827

2928
/**
3029
* Represents a document change to be applied to remote document cache.

packages/firestore/src/model/document_comparator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { DocumentKey } from './document_key';
1918
import { Document } from './document';
19+
import { DocumentKey } from './document_key';
2020

2121
export type DocumentComparator = (doc1: Document, doc2: Document) => number;
2222

packages/firestore/src/model/document_set.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
import { SortedMap } from '../util/sorted_map';
1919

2020
import { documentMap } from './collections';
21+
import { Document } from './document';
2122
import { DocumentComparator } from './document_comparator';
2223
import { DocumentKey } from './document_key';
23-
import { Document } from './document';
2424

2525
/**
2626
* DocumentSet is an immutable (copy-on-write) collection that holds documents

packages/firestore/src/model/mutable_document.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { DocumentKey } from './document_key';
1918
import { SnapshotVersion } from '../core/snapshot_version';
20-
import { ObjectValue } from './object_value';
19+
2120
import { Document } from './document';
21+
import { DocumentKey } from './document_key';
22+
import { ObjectValue } from './object_value';
2223

2324
const enum DocumentType {
2425
/**

0 commit comments

Comments
 (0)