From 056deeb6a0c4743bc60c6ffbb2948929bff2514b Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Tue, 20 Oct 2020 10:06:37 -0700 Subject: [PATCH 1/2] support ref doc generation for firestore exp --- .gitignore | 1 + common/api-review/firestore.api.md | 756 ++++++++++++++++++++++++ common/api-review/firestore.lite.api.md | 553 +++++++++++++++++ packages/firestore/api-extractor.json | 11 + packages/firestore/package.json | 5 +- 5 files changed, 1325 insertions(+), 1 deletion(-) create mode 100644 common/api-review/firestore.api.md create mode 100644 common/api-review/firestore.lite.api.md create mode 100644 packages/firestore/api-extractor.json diff --git a/.gitignore b/.gitignore index 93f49bb5bb0..dc9fe690372 100644 --- a/.gitignore +++ b/.gitignore @@ -88,6 +88,7 @@ packages-exp/**/temp # temp markdowns generated for individual SDKs packages-exp/**/docs +packages/**/docs # files generated by api-extractor that should not be tracked tsdoc-metadata.json \ No newline at end of file diff --git a/common/api-review/firestore.api.md b/common/api-review/firestore.api.md new file mode 100644 index 00000000000..74887c03920 --- /dev/null +++ b/common/api-review/firestore.api.md @@ -0,0 +1,756 @@ +## API Report File for "@firebase/firestore" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { FirebaseApp } from '@firebase/app-types-exp'; + +// @public (undocumented) +export function addDoc( + reference: CollectionReference, + data: T +): Promise>; + +// @public (undocumented) +export function arrayRemove(...elements: any[]): FieldValue; + +// @public (undocumented) +export function arrayUnion(...elements: any[]): FieldValue; + +// @public (undocumented) +export class Bytes { + // (undocumented) + static fromBase64String(base64: string): Blob; + + // (undocumented) + static fromUint8Array(array: Uint8Array): Blob; + + // (undocumented) + isEqual(other: Blob): boolean; + + // (undocumented) + toBase64(): string; + + // (undocumented) + toUint8Array(): Uint8Array; +} + +// @public (undocumented) +export const CACHE_SIZE_UNLIMITED: number; + +// @public (undocumented) +export function clearIndexedDbPersistence( + firestore: FirebaseFirestore +): Promise; + +// @public (undocumented) +export function collection( + firestore: FirebaseFirestore, + path: string, + ...pathComponents: string[] +): CollectionReference; + +// @public (undocumented) +export function collection( + reference: CollectionReference, + path: string, + ...pathComponents: string[] +): CollectionReference; + +// @public (undocumented) +export function collection( + reference: DocumentReference, + path: string, + ...pathComponents: string[] +): CollectionReference; + +// @public (undocumented) +export function collectionGroup( + firestore: FirebaseFirestore, + collectionId: string +): Query; + +// @public (undocumented) +export class CollectionReference extends Query { + // (undocumented) + readonly id: string; + // (undocumented) + get parent(): DocumentReference | null; + // (undocumented) + readonly path: string; + // (undocumented) + readonly type: 'collection'; + // (undocumented) + withConverter( + converter: FirestoreDataConverter + ): CollectionReference; +} + +// @public (undocumented) +export function deleteDoc(reference: DocumentReference): Promise; + +// @public (undocumented) +export function deleteField(): FieldValue; + +// @public (undocumented) +export function disableNetwork(firestore: FirebaseFirestore): Promise; + +// @public (undocumented) +export function doc( + firestore: FirebaseFirestore, + path: string, + ...pathComponents: string[] +): DocumentReference; + +// @public (undocumented) +export function doc( + reference: CollectionReference, + path?: string, + ...pathComponents: string[] +): DocumentReference; + +// @public (undocumented) +export function doc( + reference: DocumentReference, + path: string, + ...pathComponents: string[] +): DocumentReference; + +// @public (undocumented) +export interface DocumentChange { + // (undocumented) + readonly doc: QueryDocumentSnapshot; + // (undocumented) + readonly newIndex: number; + // (undocumented) + readonly oldIndex: number; + // (undocumented) + readonly type: DocumentChangeType; +} + +// @public (undocumented) +export type DocumentChangeType = 'added' | 'removed' | 'modified'; + +// @public (undocumented) +export interface DocumentData { + // (undocumented) + [field: string]: any; +} + +// @public (undocumented) +export function documentId(): FieldPath; + +// @public (undocumented) +export class DocumentReference { + // (undocumented) + readonly converter: FirestoreDataConverter | null; + // (undocumented) + readonly firestore: FirebaseFirestore; + // (undocumented) + readonly id: string; + // (undocumented) + get parent(): CollectionReference; + // (undocumented) + readonly path: string; + // (undocumented) + readonly type: 'document'; + // (undocumented) + withConverter(converter: FirestoreDataConverter): DocumentReference; +} + +// @public (undocumented) +export class DocumentSnapshot { + protected constructor(); + + // (undocumented) + data(options?: SnapshotOptions): T | undefined; + + // (undocumented) + exists(): this is QueryDocumentSnapshot; + + // (undocumented) + get(fieldPath: string | FieldPath, options?: SnapshotOptions): any; + + // (undocumented) + readonly id: string; + + // (undocumented) + readonly metadata: SnapshotMetadata; + + // (undocumented) + readonly ref: DocumentReference; +} + +// @public (undocumented) +export function enableIndexedDbPersistence( + firestore: FirebaseFirestore, + persistenceSettings?: PersistenceSettings +): Promise; + +// @public (undocumented) +export function enableMultiTabIndexedDbPersistence( + firestore: FirebaseFirestore +): Promise; + +// @public (undocumented) +export function enableNetwork(firestore: FirebaseFirestore): Promise; + +// @public (undocumented) +export function endAt(snapshot: DocumentSnapshot): QueryConstraint; + +// @public (undocumented) +export function endAt(...fieldValues: any[]): QueryConstraint; + +// @public (undocumented) +export function endBefore(snapshot: DocumentSnapshot): QueryConstraint; + +// @public (undocumented) +export function endBefore(...fieldValues: any[]): QueryConstraint; + +// @public (undocumented) +export class FieldPath { + constructor(...fieldNames: string[]); + // (undocumented) + isEqual(other: FieldPath): boolean; +} + +// @public (undocumented) +export class FieldValue { + // (undocumented) + isEqual(other: FieldValue): boolean; +} + +// @public (undocumented) +export class FirebaseFirestore { + // (undocumented) + readonly app: FirebaseApp; +} + +// @public (undocumented) +export interface FirestoreDataConverter { + // (undocumented) + fromFirestore( + snapshot: QueryDocumentSnapshot, + options?: SnapshotOptions + ): T; + // (undocumented) + toFirestore(modelObject: T): DocumentData; + // (undocumented) + toFirestore(modelObject: Partial, options: SetOptions): DocumentData; +} + +// @public (undocumented) +export interface FirestoreError { + // (undocumented) + code: FirestoreErrorCode; + // (undocumented) + message: string; + // (undocumented) + name: string; + // (undocumented) + stack?: string; +} + +// @public (undocumented) +export type FirestoreErrorCode = + | 'cancelled' + | 'unknown' + | 'invalid-argument' + | 'deadline-exceeded' + | 'not-found' + | 'already-exists' + | 'permission-denied' + | 'resource-exhausted' + | 'failed-precondition' + | 'aborted' + | 'out-of-range' + | 'unimplemented' + | 'internal' + | 'unavailable' + | 'data-loss' + | 'unauthenticated'; + +// @public (undocumented) +export class GeoPoint { + constructor(latitude: number, longitude: number); + + // (undocumented) + isEqual(other: GeoPoint): boolean; + + // (undocumented) + readonly latitude: number; + + // (undocumented) + readonly longitude: number; +} + +// @public (undocumented) +export function getDoc( + reference: DocumentReference +): Promise>; + +// @public (undocumented) +export function getDocFromCache( + reference: DocumentReference +): Promise>; + +// @public (undocumented) +export function getDocFromServer( + reference: DocumentReference +): Promise>; + +// @public (undocumented) +export function getDocs(query: Query): Promise>; + +// @public (undocumented) +export function getDocsFromCache(query: Query): Promise>; + +// @public (undocumented) +export function getDocsFromServer( + query: Query +): Promise>; + +// @public (undocumented) +export function getFirestore(app: FirebaseApp): FirebaseFirestore; + +// @public (undocumented) +export function increment(n: number): FieldValue; + +// @public (undocumented) +export function initializeFirestore( + app: FirebaseApp, + settings: Settings +): FirebaseFirestore; + +// @public (undocumented) +export function limit(limit: number): QueryConstraint; + +// @public (undocumented) +export function limitToLast(limit: number): QueryConstraint; + +// @public (undocumented) +export type LogLevel = + | 'debug' + | 'error' + | 'silent' + | 'warn' + | 'info' + | 'verbose'; + +// @public (undocumented) +export function onSnapshot( + reference: DocumentReference, + observer: { + next?: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + } +): () => void; + +// @public (undocumented) +export function onSnapshot( + reference: DocumentReference, + options: SnapshotListenOptions, + observer: { + next?: (snapshot: DocumentSnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + } +): () => void; + +// @public (undocumented) +export function onSnapshot( + reference: DocumentReference, + onNext: (snapshot: DocumentSnapshot) => void, + onError?: (error: FirestoreError) => void, + onCompletion?: () => void +): () => void; + +// @public (undocumented) +export function onSnapshot( + reference: DocumentReference, + options: SnapshotListenOptions, + onNext: (snapshot: DocumentSnapshot) => void, + onError?: (error: FirestoreError) => void, + onCompletion?: () => void +): () => void; + +// @public (undocumented) +export function onSnapshot( + query: Query, + observer: { + next?: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + } +): () => void; + +// @public (undocumented) +export function onSnapshot( + query: Query, + options: SnapshotListenOptions, + observer: { + next?: (snapshot: QuerySnapshot) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + } +): () => void; + +// @public (undocumented) +export function onSnapshot( + query: Query, + onNext: (snapshot: QuerySnapshot) => void, + onError?: (error: FirestoreError) => void, + onCompletion?: () => void +): () => void; + +// @public (undocumented) +export function onSnapshot( + query: Query, + options: SnapshotListenOptions, + onNext: (snapshot: QuerySnapshot) => void, + onError?: (error: FirestoreError) => void, + onCompletion?: () => void +): () => void; + +// @public (undocumented) +export function onSnapshotsInSync( + firestore: FirebaseFirestore, + observer: { + next?: (value: void) => void; + error?: (error: FirestoreError) => void; + complete?: () => void; + } +): () => void; + +// @public (undocumented) +export function onSnapshotsInSync( + firestore: FirebaseFirestore, + onSync: () => void +): () => void; + +// @public (undocumented) +export function orderBy( + fieldPath: string | FieldPath, + directionStr?: OrderByDirection +): QueryConstraint; + +// @public (undocumented) +export type OrderByDirection = 'desc' | 'asc'; + +// @public (undocumented) +export interface PersistenceSettings { + // (undocumented) + forceOwnership?: boolean; +} + +// @public (undocumented) +export class Query { + protected constructor(); + // (undocumented) + readonly converter: FirestoreDataConverter | null; + // (undocumented) + readonly firestore: FirebaseFirestore; + // (undocumented) + readonly type: 'query' | 'collection'; + // (undocumented) + withConverter(converter: FirestoreDataConverter): Query; +} + +// @public (undocumented) +export function query( + query: CollectionReference | Query, + ...constraints: QueryConstraint[] +): Query; + +// @public (undocumented) +export class QueryConstraint { + // (undocumented) + readonly type: QueryConstraintType; +} + +// @public (undocumented) +export type QueryConstraintType = + | 'where' + | 'orderBy' + | 'limit' + | 'limitToLast' + | 'startAt' + | 'startAfter' + | 'endAt' + | 'endBefore'; + +// @public (undocumented) +export class QueryDocumentSnapshot extends DocumentSnapshot< + T +> { + // (undocumented) + data(options?: SnapshotOptions): T; +} + +// @public (undocumented) +export function queryEqual(left: Query, right: Query): boolean; + +// @public (undocumented) +export class QuerySnapshot { + // (undocumented) + docChanges(options?: SnapshotListenOptions): Array>; + // (undocumented) + readonly docs: Array>; + // (undocumented) + readonly empty: boolean; + // (undocumented) + forEach( + callback: (result: QueryDocumentSnapshot) => void, + thisArg?: any + ): void; + // (undocumented) + readonly metadata: SnapshotMetadata; + // (undocumented) + readonly query: Query; + // (undocumented) + readonly size: number; +} + +// @public (undocumented) +export function refEqual( + left: DocumentReference | CollectionReference, + right: DocumentReference | CollectionReference +): boolean; + +// @public (undocumented) +export function runTransaction( + firestore: FirebaseFirestore, + updateFunction: (transaction: Transaction) => Promise +): Promise; + +// @public (undocumented) +export function serverTimestamp(): FieldValue; + +// @public (undocumented) +export function setDoc( + reference: DocumentReference, + data: T +): Promise; + +// @public (undocumented) +export function setDoc( + reference: DocumentReference, + data: Partial, + options: SetOptions +): Promise; + +// @public (undocumented) +export function setLogLevel(logLevel: LogLevel): void; + +// @public (undocumented) +export type SetOptions = + | { + readonly merge?: boolean; + } + | { + readonly mergeFields?: Array; + }; + +// @public (undocumented) +export interface Settings { + // (undocumented) + cacheSizeBytes?: number; + // (undocumented) + host?: string; + // (undocumented) + ignoreUndefinedProperties?: boolean; + // (undocumented) + ssl?: boolean; +} + +// @public (undocumented) +export function snapshotEqual( + left: DocumentSnapshot | QuerySnapshot, + right: DocumentSnapshot | QuerySnapshot +): boolean; + +// @public (undocumented) +export interface SnapshotListenOptions { + // (undocumented) + readonly includeMetadataChanges?: boolean; +} + +// @public (undocumented) +export class SnapshotMetadata { + // (undocumented) + readonly fromCache: boolean; + + // (undocumented) + readonly hasPendingWrites: boolean; + + // (undocumented) + isEqual(other: SnapshotMetadata): boolean; +} + +// @public (undocumented) +export interface SnapshotOptions { + // (undocumented) + readonly serverTimestamps?: 'estimate' | 'previous' | 'none'; +} + +// @public (undocumented) +export function startAfter(snapshot: DocumentSnapshot): QueryConstraint; + +// @public (undocumented) +export function startAfter(...fieldValues: any[]): QueryConstraint; + +// @public (undocumented) +export function startAt(snapshot: DocumentSnapshot): QueryConstraint; + +// @public (undocumented) +export function startAt(...fieldValues: any[]): QueryConstraint; + +// @public (undocumented) +export function terminate(firestore: FirebaseFirestore): Promise; + +// @public (undocumented) +export class Timestamp { + constructor(seconds: number, nanoseconds: number); + + // (undocumented) + static fromDate(date: Date): Timestamp; + + // (undocumented) + static fromMillis(milliseconds: number): Timestamp; + + // (undocumented) + isEqual(other: Timestamp): boolean; + + // (undocumented) + readonly nanoseconds: number; + + // (undocumented) + static now(): Timestamp; + + // (undocumented) + readonly seconds: number; + + // (undocumented) + toDate(): Date; + + // (undocumented) + toMillis(): number; + + // (undocumented) + valueOf(): string; +} + +// @public (undocumented) +export class Transaction { + // (undocumented) + delete(documentRef: DocumentReference): Transaction; + + // (undocumented) + get(documentRef: DocumentReference): Promise>; + + // (undocumented) + set(documentRef: DocumentReference, data: T): Transaction; + + // (undocumented) + set( + documentRef: DocumentReference, + data: Partial, + options: SetOptions + ): Transaction; + + // (undocumented) + update(documentRef: DocumentReference, data: UpdateData): Transaction; + + // (undocumented) + update( + documentRef: DocumentReference, + field: string | FieldPath, + value: any, + ...moreFieldsAndValues: any[] + ): Transaction; +} + +// @public (undocumented) +export interface UpdateData { + // (undocumented) + [fieldPath: string]: any; +} + +// @public (undocumented) +export function updateDoc( + reference: DocumentReference, + data: UpdateData +): Promise; + +// @public (undocumented) +export function updateDoc( + reference: DocumentReference, + field: string | FieldPath, + value: any, + ...moreFieldsAndValues: any[] +): Promise; + +// @public (undocumented) +export function waitForPendingWrites( + firestore: FirebaseFirestore +): Promise; + +// @public (undocumented) +export function where( + fieldPath: string | FieldPath, + opStr: WhereFilterOp, + value: any +): QueryConstraint; + +// @public (undocumented) +export type WhereFilterOp = + | '<' + | '<=' + | '==' + | '!=' + | '>=' + | '>' + | 'array-contains' + | 'in' + | 'array-contains-any' + | 'not-in'; + +// @public (undocumented) +export class WriteBatch { + // (undocumented) + commit(): Promise; + + // (undocumented) + delete(documentRef: DocumentReference): WriteBatch; + + // (undocumented) + set(documentRef: DocumentReference, data: T): WriteBatch; + + // (undocumented) + set( + documentRef: DocumentReference, + data: Partial, + options: SetOptions + ): WriteBatch; + + // (undocumented) + update(documentRef: DocumentReference, data: UpdateData): WriteBatch; + + // (undocumented) + update( + documentRef: DocumentReference, + field: string | FieldPath, + value: any, + ...moreFieldsAndValues: any[] + ): WriteBatch; +} + +// @public (undocumented) +export function writeBatch(firestore: FirebaseFirestore): WriteBatch; + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/common/api-review/firestore.lite.api.md b/common/api-review/firestore.lite.api.md new file mode 100644 index 00000000000..68387426991 --- /dev/null +++ b/common/api-review/firestore.lite.api.md @@ -0,0 +1,553 @@ +## API Report File for "@firebase/firestore/lite" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { FirebaseApp } from '@firebase/app-types-exp'; + +// @public (undocumented) +export function addDoc( + reference: CollectionReference, + data: T +): Promise>; + +// @public (undocumented) +export function arrayRemove(...elements: any[]): FieldValue; + +// @public (undocumented) +export function arrayUnion(...elements: any[]): FieldValue; + +// @public (undocumented) +export class Bytes { + // (undocumented) + static fromBase64String(base64: string): Blob; + + // (undocumented) + static fromUint8Array(array: Uint8Array): Blob; + + // (undocumented) + isEqual(other: Blob): boolean; + + // (undocumented) + toBase64(): string; + + // (undocumented) + toUint8Array(): Uint8Array; +} + +// @public (undocumented) +export function collection( + firestore: FirebaseFirestore, + path: string, + ...pathComponents: string[] +): CollectionReference; + +// @public (undocumented) +export function collection( + reference: CollectionReference, + path: string, + ...pathComponents: string[] +): CollectionReference; + +// @public (undocumented) +export function collection( + reference: DocumentReference, + path: string, + ...pathComponents: string[] +): CollectionReference; + +// @public (undocumented) +export function collectionGroup( + firestore: FirebaseFirestore, + collectionId: string +): Query; + +// @public (undocumented) +export class CollectionReference extends Query { + // (undocumented) + readonly id: string; + // (undocumented) + get parent(): DocumentReference | null; + // (undocumented) + readonly path: string; + // (undocumented) + readonly type: 'collection'; + // (undocumented) + withConverter( + converter: FirestoreDataConverter + ): CollectionReference; +} + +// @public (undocumented) +export function deleteDoc(reference: DocumentReference): Promise; + +// @public (undocumented) +export function deleteField(): FieldValue; + +// @public (undocumented) +export function doc( + firestore: FirebaseFirestore, + path: string, + ...pathComponents: string[] +): DocumentReference; + +// @public (undocumented) +export function doc( + reference: CollectionReference, + path?: string, + ...pathComponents: string[] +): DocumentReference; + +// @public (undocumented) +export function doc( + reference: DocumentReference, + path: string, + ...pathComponents: string[] +): DocumentReference; + +// @public (undocumented) +export interface DocumentData { + // (undocumented) + [field: string]: any; +} + +// @public (undocumented) +export function documentId(): FieldPath; + +// @public (undocumented) +export class DocumentReference { + // (undocumented) + readonly converter: FirestoreDataConverter | null; + // (undocumented) + readonly firestore: FirebaseFirestore; + // (undocumented) + readonly id: string; + // (undocumented) + get parent(): CollectionReference; + // (undocumented) + readonly path: string; + // (undocumented) + readonly type: 'document'; + // (undocumented) + withConverter(converter: FirestoreDataConverter): DocumentReference; +} + +// @public (undocumented) +export class DocumentSnapshot { + // (undocumented) + data(): T | undefined; + // (undocumented) + exists(): this is QueryDocumentSnapshot; + // (undocumented) + get(fieldPath: string | FieldPath): any; + // (undocumented) + readonly id: string; + // (undocumented) + readonly ref: DocumentReference; +} + +// @public (undocumented) +export function endAt(snapshot: DocumentSnapshot): QueryConstraint; + +// @public (undocumented) +export function endAt(...fieldValues: any[]): QueryConstraint; + +// @public (undocumented) +export function endBefore(snapshot: DocumentSnapshot): QueryConstraint; + +// @public (undocumented) +export function endBefore(...fieldValues: any[]): QueryConstraint; + +// @public (undocumented) +export class FieldPath { + constructor(...fieldNames: string[]); + // (undocumented) + isEqual(other: FieldPath): boolean; +} + +// @public (undocumented) +export class FieldValue { + // (undocumented) + isEqual(other: FieldValue): boolean; +} + +// @public (undocumented) +export class FirebaseFirestore { + // (undocumented) + readonly app: FirebaseApp; +} + +// @public (undocumented) +export interface FirestoreDataConverter { + // (undocumented) + fromFirestore(snapshot: QueryDocumentSnapshot): T; + // (undocumented) + toFirestore(modelObject: T): DocumentData; + // (undocumented) + toFirestore(modelObject: Partial, options: SetOptions): DocumentData; +} + +// @public (undocumented) +export interface FirestoreError { + // (undocumented) + code: FirestoreErrorCode; + // (undocumented) + message: string; + // (undocumented) + name: string; + // (undocumented) + stack?: string; +} + +// @public (undocumented) +export type FirestoreErrorCode = + | 'cancelled' + | 'unknown' + | 'invalid-argument' + | 'deadline-exceeded' + | 'not-found' + | 'already-exists' + | 'permission-denied' + | 'resource-exhausted' + | 'failed-precondition' + | 'aborted' + | 'out-of-range' + | 'unimplemented' + | 'internal' + | 'unavailable' + | 'data-loss' + | 'unauthenticated'; + +// @public (undocumented) +export class GeoPoint { + constructor(latitude: number, longitude: number); + + // (undocumented) + isEqual(other: GeoPoint): boolean; + + // (undocumented) + readonly latitude: number; + + // (undocumented) + readonly longitude: number; +} + +// @public (undocumented) +export function getDoc( + reference: DocumentReference +): Promise>; + +// @public (undocumented) +export function getDocs(query: Query): Promise>; + +// @public (undocumented) +export function getFirestore(app: FirebaseApp): FirebaseFirestore; + +// @public (undocumented) +export function increment(n: number): FieldValue; + +// @public (undocumented) +export function initializeFirestore( + app: FirebaseApp, + settings: Settings +): FirebaseFirestore; + +// @public (undocumented) +export function limit(limit: number): QueryConstraint; + +// @public (undocumented) +export function limitToLast(limit: number): QueryConstraint; + +// @public (undocumented) +export type LogLevel = + | 'debug' + | 'error' + | 'silent' + | 'warn' + | 'info' + | 'verbose'; + +// @public (undocumented) +export function orderBy( + fieldPath: string | FieldPath, + directionStr?: OrderByDirection +): QueryConstraint; + +// @public (undocumented) +export type OrderByDirection = 'desc' | 'asc'; + +// @public (undocumented) +export class Query { + protected constructor(); + // (undocumented) + readonly converter: FirestoreDataConverter | null; + // (undocumented) + readonly firestore: FirebaseFirestore; + // (undocumented) + readonly type: 'query' | 'collection'; + // (undocumented) + withConverter(converter: FirestoreDataConverter): Query; +} + +// @public (undocumented) +export function query( + query: CollectionReference | Query, + ...constraints: QueryConstraint[] +): Query; + +// @public (undocumented) +export class QueryConstraint { + // (undocumented) + readonly type: QueryConstraintType; +} + +// @public (undocumented) +export type QueryConstraintType = + | 'where' + | 'orderBy' + | 'limit' + | 'limitToLast' + | 'startAt' + | 'startAfter' + | 'endAt' + | 'endBefore'; + +// @public (undocumented) +export class QueryDocumentSnapshot extends DocumentSnapshot< + T +> { + // (undocumented) + data(): T; +} + +// @public (undocumented) +export function queryEqual(left: Query, right: Query): boolean; + +// @public (undocumented) +export class QuerySnapshot { + // (undocumented) + readonly docs: Array>; + // (undocumented) + readonly empty: boolean; + // (undocumented) + forEach( + callback: (result: QueryDocumentSnapshot) => void, + thisArg?: any + ): void; + // (undocumented) + readonly query: Query; + // (undocumented) + readonly size: number; +} + +// @public (undocumented) +export function refEqual( + left: DocumentReference | CollectionReference, + right: DocumentReference | CollectionReference +): boolean; + +// @public (undocumented) +export function runTransaction( + firestore: FirebaseFirestore, + updateFunction: (transaction: Transaction) => Promise +): Promise; + +// @public (undocumented) +export function serverTimestamp(): FieldValue; + +// @public (undocumented) +export function setDoc( + reference: DocumentReference, + data: T +): Promise; + +// @public (undocumented) +export function setDoc( + reference: DocumentReference, + data: Partial, + options: SetOptions +): Promise; + +// @public (undocumented) +export function setLogLevel(logLevel: LogLevel): void; + +// @public (undocumented) +export type SetOptions = + | { + readonly merge?: boolean; + } + | { + readonly mergeFields?: Array; + }; + +// @public (undocumented) +export interface Settings { + // (undocumented) + host?: string; + // (undocumented) + ignoreUndefinedProperties?: boolean; + // (undocumented) + ssl?: boolean; +} + +// @public (undocumented) +export function snapshotEqual( + left: DocumentSnapshot | QuerySnapshot, + right: DocumentSnapshot | QuerySnapshot +): boolean; + +// @public (undocumented) +export function startAfter(snapshot: DocumentSnapshot): QueryConstraint; + +// @public (undocumented) +export function startAfter(...fieldValues: any[]): QueryConstraint; + +// @public (undocumented) +export function startAt(snapshot: DocumentSnapshot): QueryConstraint; + +// @public (undocumented) +export function startAt(...fieldValues: any[]): QueryConstraint; + +// @public (undocumented) +export function terminate(firestore: FirebaseFirestore): Promise; + +// @public (undocumented) +export class Timestamp { + constructor(seconds: number, nanoseconds: number); + + // (undocumented) + static fromDate(date: Date): Timestamp; + + // (undocumented) + static fromMillis(milliseconds: number): Timestamp; + + // (undocumented) + isEqual(other: Timestamp): boolean; + + // (undocumented) + readonly nanoseconds: number; + + // (undocumented) + static now(): Timestamp; + + // (undocumented) + readonly seconds: number; + + // (undocumented) + toDate(): Date; + + // (undocumented) + toMillis(): number; + + // (undocumented) + valueOf(): string; +} + +// @public (undocumented) +export class Transaction { + // (undocumented) + delete(documentRef: DocumentReference): Transaction; + + // (undocumented) + get(documentRef: DocumentReference): Promise>; + + // (undocumented) + set(documentRef: DocumentReference, data: T): Transaction; + + // (undocumented) + set( + documentRef: DocumentReference, + data: Partial, + options: SetOptions + ): Transaction; + + // (undocumented) + update(documentRef: DocumentReference, data: UpdateData): Transaction; + + // (undocumented) + update( + documentRef: DocumentReference, + field: string | FieldPath, + value: any, + ...moreFieldsAndValues: any[] + ): Transaction; +} + +// @public (undocumented) +export interface UpdateData { + // (undocumented) + [fieldPath: string]: any; +} + +// @public (undocumented) +export function updateDoc( + reference: DocumentReference, + data: UpdateData +): Promise; + +// @public (undocumented) +export function updateDoc( + reference: DocumentReference, + field: string | FieldPath, + value: any, + ...moreFieldsAndValues: any[] +): Promise; + +// @public (undocumented) +export function where( + fieldPath: string | FieldPath, + opStr: WhereFilterOp, + value: any +): QueryConstraint; + +// @public (undocumented) +export type WhereFilterOp = + | '<' + | '<=' + | '==' + | '!=' + | '>=' + | '>' + | 'array-contains' + | 'in' + | 'array-contains-any' + | 'not-in'; + +// @public (undocumented) +export class WriteBatch { + // (undocumented) + commit(): Promise; + + // (undocumented) + delete(documentRef: DocumentReference): WriteBatch; + + // (undocumented) + set(documentRef: DocumentReference, data: T): WriteBatch; + + // (undocumented) + set( + documentRef: DocumentReference, + data: Partial, + options: SetOptions + ): WriteBatch; + + // (undocumented) + update(documentRef: DocumentReference, data: UpdateData): WriteBatch; + + // (undocumented) + update( + documentRef: DocumentReference, + field: string | FieldPath, + value: any, + ...moreFieldsAndValues: any[] + ): WriteBatch; +} + +// @public (undocumented) +export function writeBatch(firestore: FirebaseFirestore): WriteBatch; + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/packages/firestore/api-extractor.json b/packages/firestore/api-extractor.json new file mode 100644 index 00000000000..11e387714ca --- /dev/null +++ b/packages/firestore/api-extractor.json @@ -0,0 +1,11 @@ +{ + "extends": "../../config/api-extractor.json", + // Point it to your entry point d.ts file. + "mainEntryPointFilePath": "/exp-types/index.d.ts", + "additionalEntryPoints": [ + { + "modulePath": "lite", + "filePath": "lite-types/index.d.ts" + } + ] +} \ No newline at end of file diff --git a/packages/firestore/package.json b/packages/firestore/package.json index 90ee054b940..6e52433d763 100644 --- a/packages/firestore/package.json +++ b/packages/firestore/package.json @@ -46,7 +46,10 @@ "test:node:persistence:prod": "node ./scripts/run-tests.js --main=index.node.ts --persistence 'test/{,!(browser)/**/}*.test.ts'", "test:travis": "ts-node --compiler-options='{\"module\":\"commonjs\"}' ../../scripts/emulator-testing/firestore-test-runner.ts", "test:minified": "(cd ../../integration/firestore ; yarn test)", - "prepare": "yarn build:release" + "prepare": "yarn build:release", + "api-report": "api-extractor run --local --verbose", + "predoc": "node ../../scripts/exp/remove-exp.js temp", + "doc": "api-documenter markdown --input temp --output docs" }, "main": "dist/index.node.cjs.js", "main-esm2017": "dist/index.node.esm2017.js", From c147129e0ce8446f78de21456a38f62a0b993859 Mon Sep 17 00:00:00 2001 From: Feiyang1 Date: Tue, 20 Oct 2020 10:11:50 -0700 Subject: [PATCH 2/2] update ref docs --- common/api-review/functions-exp.api.md | 2 +- docs-exp/firestore_.collection.md | 6 +++-- docs-exp/firestore_.collection_1.md | 6 +++-- docs-exp/firestore_.collection_2.md | 6 +++-- .../firestore_.collectionreference.doc.md | 22 ------------------- docs-exp/firestore_.collectionreference.md | 1 - docs-exp/firestore_.doc.md | 6 +++-- docs-exp/firestore_.doc_1.md | 6 +++-- docs-exp/firestore_.doc_2.md | 6 +++-- ...firestore_.documentreference.collection.md | 22 ------------------- docs-exp/firestore_.documentreference.md | 1 - ...restore_.documentsnapshot._constructor_.md | 2 ++ docs-exp/firestore_.documentsnapshot.md | 2 +- .../firestore_.enableindexeddbpersistence.md | 4 +++- .../firestore_.fieldpath._constructor_.md | 2 ++ docs-exp/firestore_.fieldpath.md | 2 +- docs-exp/firestore_.geopoint._constructor_.md | 2 ++ docs-exp/firestore_.geopoint.md | 2 +- docs-exp/firestore_.md | 15 +++++++------ ...ore_.persistencesettings.forceownership.md | 11 ++++++++++ docs-exp/firestore_.persistencesettings.md | 18 +++++++++++++++ docs-exp/firestore_.query._constructor_.md | 2 ++ .../firestore_.timestamp._constructor_.md | 2 ++ docs-exp/firestore_.timestamp.md | 2 +- docs-exp/firestore_.wherefilterop.md | 4 +++- docs-exp/firestore_lite.collection.md | 6 +++-- docs-exp/firestore_lite.collection_1.md | 6 +++-- docs-exp/firestore_lite.collection_2.md | 6 +++-- .../firestore_lite.collectionreference.doc.md | 22 ------------------- .../firestore_lite.collectionreference.md | 1 - docs-exp/firestore_lite.doc.md | 6 +++-- docs-exp/firestore_lite.doc_1.md | 6 +++-- docs-exp/firestore_lite.doc_2.md | 6 +++-- ...store_lite.documentreference.collection.md | 22 ------------------- docs-exp/firestore_lite.documentreference.md | 1 - .../firestore_lite.fieldpath._constructor_.md | 2 ++ docs-exp/firestore_lite.fieldpath.md | 2 +- .../firestore_lite.geopoint._constructor_.md | 2 ++ docs-exp/firestore_lite.geopoint.md | 2 +- docs-exp/firestore_lite.md | 12 +++++----- .../firestore_lite.query._constructor_.md | 2 ++ .../firestore_lite.timestamp._constructor_.md | 2 ++ docs-exp/firestore_lite.timestamp.md | 2 +- docs-exp/firestore_lite.wherefilterop.md | 4 +++- docs-exp/functions.md | 2 +- docs-exp/functions.usefunctionsemulator.md | 9 +++++--- docs-exp/index.md | 1 + package.json | 2 +- 48 files changed, 135 insertions(+), 145 deletions(-) delete mode 100644 docs-exp/firestore_.collectionreference.doc.md delete mode 100644 docs-exp/firestore_.documentreference.collection.md create mode 100644 docs-exp/firestore_.persistencesettings.forceownership.md create mode 100644 docs-exp/firestore_.persistencesettings.md delete mode 100644 docs-exp/firestore_lite.collectionreference.doc.md delete mode 100644 docs-exp/firestore_lite.documentreference.collection.md diff --git a/common/api-review/functions-exp.api.md b/common/api-review/functions-exp.api.md index 947534f6548..4f719b67983 100644 --- a/common/api-review/functions-exp.api.md +++ b/common/api-review/functions-exp.api.md @@ -16,7 +16,7 @@ export function getFunctions(app: FirebaseApp, regionOrCustomDomain?: string): F export function httpsCallable(functionsInstance: Functions, name: string, options?: HttpsCallableOptions): HttpsCallable; // @public -export function useFunctionsEmulator(functionsInstance: Functions, origin: string): void; +export function useFunctionsEmulator(functionsInstance: Functions, host: string, port: number): void; // (No @packageDocumentation comment for this package) diff --git a/docs-exp/firestore_.collection.md b/docs-exp/firestore_.collection.md index bff81779aa8..ccf6b58ca26 100644 --- a/docs-exp/firestore_.collection.md +++ b/docs-exp/firestore_.collection.md @@ -9,7 +9,8 @@ ```typescript export function collection( firestore: FirebaseFirestore, - collectionPath: string + path: string, + ...pathComponents: string[] ): CollectionReference; ``` @@ -18,7 +19,8 @@ export function collection( | Parameter | Type | Description | | --- | --- | --- | | firestore | [FirebaseFirestore](./firestore_.firebasefirestore.md) | | -| collectionPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_.collection_1.md b/docs-exp/firestore_.collection_1.md index dc4f299ad12..7a3cb4d1254 100644 --- a/docs-exp/firestore_.collection_1.md +++ b/docs-exp/firestore_.collection_1.md @@ -9,7 +9,8 @@ ```typescript export function collection( reference: CollectionReference, - collectionPath: string + path: string, + ...pathComponents: string[] ): CollectionReference; ``` @@ -18,7 +19,8 @@ export function collection( | Parameter | Type | Description | | --- | --- | --- | | reference | [CollectionReference](./firestore_.collectionreference.md)<unknown> | | -| collectionPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_.collection_2.md b/docs-exp/firestore_.collection_2.md index 880268da15f..b3fb60d7510 100644 --- a/docs-exp/firestore_.collection_2.md +++ b/docs-exp/firestore_.collection_2.md @@ -9,7 +9,8 @@ ```typescript export function collection( reference: DocumentReference, - collectionPath: string + path: string, + ...pathComponents: string[] ): CollectionReference; ``` @@ -18,7 +19,8 @@ export function collection( | Parameter | Type | Description | | --- | --- | --- | | reference | [DocumentReference](./firestore_.documentreference.md) | | -| collectionPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_.collectionreference.doc.md b/docs-exp/firestore_.collectionreference.doc.md deleted file mode 100644 index d8d47a73f7e..00000000000 --- a/docs-exp/firestore_.collectionreference.doc.md +++ /dev/null @@ -1,22 +0,0 @@ - - -[Home](./index.md) > [@firebase/firestore](./firestore.md) > [/](./firestore_.md) > [CollectionReference](./firestore_.collectionreference.md) > [doc](./firestore_.collectionreference.doc.md) - -## CollectionReference.doc() method - -Signature: - -```typescript -doc(documentPath?: string): DocumentReference; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| documentPath | string | | - -Returns: - -[DocumentReference](./firestore_.documentreference.md)<T> - diff --git a/docs-exp/firestore_.collectionreference.md b/docs-exp/firestore_.collectionreference.md index 787f5cf4fbc..faf4205c806 100644 --- a/docs-exp/firestore_.collectionreference.md +++ b/docs-exp/firestore_.collectionreference.md @@ -24,6 +24,5 @@ export class CollectionReference extends Query | Method | Modifiers | Description | | --- | --- | --- | -| [doc(documentPath)](./firestore_.collectionreference.doc.md) | | | | [withConverter(converter)](./firestore_.collectionreference.withconverter.md) | | | diff --git a/docs-exp/firestore_.doc.md b/docs-exp/firestore_.doc.md index e0b9e126225..4d4bd52cdf3 100644 --- a/docs-exp/firestore_.doc.md +++ b/docs-exp/firestore_.doc.md @@ -9,7 +9,8 @@ ```typescript export function doc( firestore: FirebaseFirestore, - documentPath: string + path: string, + ...pathComponents: string[] ): DocumentReference; ``` @@ -18,7 +19,8 @@ export function doc( | Parameter | Type | Description | | --- | --- | --- | | firestore | [FirebaseFirestore](./firestore_.firebasefirestore.md) | | -| documentPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_.doc_1.md b/docs-exp/firestore_.doc_1.md index cb4022ad93c..3875983d974 100644 --- a/docs-exp/firestore_.doc_1.md +++ b/docs-exp/firestore_.doc_1.md @@ -9,7 +9,8 @@ ```typescript export function doc( reference: CollectionReference, - documentPath?: string + path?: string, + ...pathComponents: string[] ): DocumentReference; ``` @@ -18,7 +19,8 @@ export function doc( | Parameter | Type | Description | | --- | --- | --- | | reference | [CollectionReference](./firestore_.collectionreference.md)<T> | | -| documentPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_.doc_2.md b/docs-exp/firestore_.doc_2.md index 9c6ebe61f13..ad13abf9d4a 100644 --- a/docs-exp/firestore_.doc_2.md +++ b/docs-exp/firestore_.doc_2.md @@ -9,7 +9,8 @@ ```typescript export function doc( reference: DocumentReference, - documentPath: string + path: string, + ...pathComponents: string[] ): DocumentReference; ``` @@ -18,7 +19,8 @@ export function doc( | Parameter | Type | Description | | --- | --- | --- | | reference | [DocumentReference](./firestore_.documentreference.md)<unknown> | | -| documentPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_.documentreference.collection.md b/docs-exp/firestore_.documentreference.collection.md deleted file mode 100644 index 9d45e120984..00000000000 --- a/docs-exp/firestore_.documentreference.collection.md +++ /dev/null @@ -1,22 +0,0 @@ - - -[Home](./index.md) > [@firebase/firestore](./firestore.md) > [/](./firestore_.md) > [DocumentReference](./firestore_.documentreference.md) > [collection](./firestore_.documentreference.collection.md) - -## DocumentReference.collection() method - -Signature: - -```typescript -collection(collectionPath: string): CollectionReference; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| collectionPath | string | | - -Returns: - -[CollectionReference](./firestore_.collectionreference.md)<[DocumentData](./firestore_.documentdata.md)> - diff --git a/docs-exp/firestore_.documentreference.md b/docs-exp/firestore_.documentreference.md index 8207f1b73f8..14cb0677b12 100644 --- a/docs-exp/firestore_.documentreference.md +++ b/docs-exp/firestore_.documentreference.md @@ -25,6 +25,5 @@ export class DocumentReference | Method | Modifiers | Description | | --- | --- | --- | -| [collection(collectionPath)](./firestore_.documentreference.collection.md) | | | | [withConverter(converter)](./firestore_.documentreference.withconverter.md) | | | diff --git a/docs-exp/firestore_.documentsnapshot._constructor_.md b/docs-exp/firestore_.documentsnapshot._constructor_.md index e5b5168baa5..25f16edafa5 100644 --- a/docs-exp/firestore_.documentsnapshot._constructor_.md +++ b/docs-exp/firestore_.documentsnapshot._constructor_.md @@ -4,6 +4,8 @@ ## DocumentSnapshot.(constructor) +Constructs a new instance of the `DocumentSnapshot` class + Signature: ```typescript diff --git a/docs-exp/firestore_.documentsnapshot.md b/docs-exp/firestore_.documentsnapshot.md index 3a105cb4552..4a34cbaf591 100644 --- a/docs-exp/firestore_.documentsnapshot.md +++ b/docs-exp/firestore_.documentsnapshot.md @@ -14,7 +14,7 @@ export class DocumentSnapshot | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)()](./firestore_.documentsnapshot._constructor_.md) | | | +| [(constructor)()](./firestore_.documentsnapshot._constructor_.md) | | Constructs a new instance of the DocumentSnapshot class | ## Properties diff --git a/docs-exp/firestore_.enableindexeddbpersistence.md b/docs-exp/firestore_.enableindexeddbpersistence.md index 48d37be6622..0e9f235f430 100644 --- a/docs-exp/firestore_.enableindexeddbpersistence.md +++ b/docs-exp/firestore_.enableindexeddbpersistence.md @@ -8,7 +8,8 @@ ```typescript export function enableIndexedDbPersistence( - firestore: FirebaseFirestore + firestore: FirebaseFirestore, + persistenceSettings?: PersistenceSettings ): Promise; ``` @@ -17,6 +18,7 @@ export function enableIndexedDbPersistence( | Parameter | Type | Description | | --- | --- | --- | | firestore | [FirebaseFirestore](./firestore_.firebasefirestore.md) | | +| persistenceSettings | [PersistenceSettings](./firestore_.persistencesettings.md) | | Returns: diff --git a/docs-exp/firestore_.fieldpath._constructor_.md b/docs-exp/firestore_.fieldpath._constructor_.md index 7a344de5c88..cdf3e8fbcd9 100644 --- a/docs-exp/firestore_.fieldpath._constructor_.md +++ b/docs-exp/firestore_.fieldpath._constructor_.md @@ -4,6 +4,8 @@ ## FieldPath.(constructor) +Constructs a new instance of the `FieldPath` class + Signature: ```typescript diff --git a/docs-exp/firestore_.fieldpath.md b/docs-exp/firestore_.fieldpath.md index e911069af11..2f3bc81e06d 100644 --- a/docs-exp/firestore_.fieldpath.md +++ b/docs-exp/firestore_.fieldpath.md @@ -14,7 +14,7 @@ export class FieldPath | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(fieldNames)](./firestore_.fieldpath._constructor_.md) | | | +| [(constructor)(fieldNames)](./firestore_.fieldpath._constructor_.md) | | Constructs a new instance of the FieldPath class | ## Methods diff --git a/docs-exp/firestore_.geopoint._constructor_.md b/docs-exp/firestore_.geopoint._constructor_.md index 4676f52a3c9..82dc9dcca9e 100644 --- a/docs-exp/firestore_.geopoint._constructor_.md +++ b/docs-exp/firestore_.geopoint._constructor_.md @@ -4,6 +4,8 @@ ## GeoPoint.(constructor) +Constructs a new instance of the `GeoPoint` class + Signature: ```typescript diff --git a/docs-exp/firestore_.geopoint.md b/docs-exp/firestore_.geopoint.md index bc24a5cbe54..8c4f8d0f02a 100644 --- a/docs-exp/firestore_.geopoint.md +++ b/docs-exp/firestore_.geopoint.md @@ -14,7 +14,7 @@ export class GeoPoint | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(latitude, longitude)](./firestore_.geopoint._constructor_.md) | | | +| [(constructor)(latitude, longitude)](./firestore_.geopoint._constructor_.md) | | Constructs a new instance of the GeoPoint class | ## Properties diff --git a/docs-exp/firestore_.md b/docs-exp/firestore_.md index 6934c8a9a97..49ee4723d29 100644 --- a/docs-exp/firestore_.md +++ b/docs-exp/firestore_.md @@ -33,18 +33,18 @@ | [arrayRemove(elements)](./firestore_.arrayremove.md) | | | [arrayUnion(elements)](./firestore_.arrayunion.md) | | | [clearIndexedDbPersistence(firestore)](./firestore_.clearindexeddbpersistence.md) | | -| [collection(firestore, collectionPath)](./firestore_.collection.md) | | -| [collection(reference, collectionPath)](./firestore_.collection_1.md) | | -| [collection(reference, collectionPath)](./firestore_.collection_2.md) | | +| [collection(firestore, path, pathComponents)](./firestore_.collection.md) | | +| [collection(reference, path, pathComponents)](./firestore_.collection_1.md) | | +| [collection(reference, path, pathComponents)](./firestore_.collection_2.md) | | | [collectionGroup(firestore, collectionId)](./firestore_.collectiongroup.md) | | | [deleteDoc(reference)](./firestore_.deletedoc.md) | | | [deleteField()](./firestore_.deletefield.md) | | | [disableNetwork(firestore)](./firestore_.disablenetwork.md) | | -| [doc(firestore, documentPath)](./firestore_.doc.md) | | -| [doc(reference, documentPath)](./firestore_.doc_1.md) | | -| [doc(reference, documentPath)](./firestore_.doc_2.md) | | +| [doc(firestore, path, pathComponents)](./firestore_.doc.md) | | +| [doc(reference, path, pathComponents)](./firestore_.doc_1.md) | | +| [doc(reference, path, pathComponents)](./firestore_.doc_2.md) | | | [documentId()](./firestore_.documentid.md) | | -| [enableIndexedDbPersistence(firestore)](./firestore_.enableindexeddbpersistence.md) | | +| [enableIndexedDbPersistence(firestore, persistenceSettings)](./firestore_.enableindexeddbpersistence.md) | | | [enableMultiTabIndexedDbPersistence(firestore)](./firestore_.enablemultitabindexeddbpersistence.md) | | | [enableNetwork(firestore)](./firestore_.enablenetwork.md) | | | [endAt(snapshot)](./firestore_.endat.md) | | @@ -101,6 +101,7 @@ | [DocumentData](./firestore_.documentdata.md) | | | [FirestoreDataConverter](./firestore_.firestoredataconverter.md) | | | [FirestoreError](./firestore_.firestoreerror.md) | | +| [PersistenceSettings](./firestore_.persistencesettings.md) | | | [Settings](./firestore_.settings.md) | | | [SnapshotListenOptions](./firestore_.snapshotlistenoptions.md) | | | [SnapshotOptions](./firestore_.snapshotoptions.md) | | diff --git a/docs-exp/firestore_.persistencesettings.forceownership.md b/docs-exp/firestore_.persistencesettings.forceownership.md new file mode 100644 index 00000000000..ce5e770094a --- /dev/null +++ b/docs-exp/firestore_.persistencesettings.forceownership.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [@firebase/firestore](./firestore.md) > [/](./firestore_.md) > [PersistenceSettings](./firestore_.persistencesettings.md) > [forceOwnership](./firestore_.persistencesettings.forceownership.md) + +## PersistenceSettings.forceOwnership property + +Signature: + +```typescript +forceOwnership?: boolean; +``` diff --git a/docs-exp/firestore_.persistencesettings.md b/docs-exp/firestore_.persistencesettings.md new file mode 100644 index 00000000000..3c08951ad78 --- /dev/null +++ b/docs-exp/firestore_.persistencesettings.md @@ -0,0 +1,18 @@ + + +[Home](./index.md) > [@firebase/firestore](./firestore.md) > [/](./firestore_.md) > [PersistenceSettings](./firestore_.persistencesettings.md) + +## PersistenceSettings interface + +Signature: + +```typescript +export interface PersistenceSettings +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [forceOwnership](./firestore_.persistencesettings.forceownership.md) | boolean | | + diff --git a/docs-exp/firestore_.query._constructor_.md b/docs-exp/firestore_.query._constructor_.md index ba6d9c296bf..ed6cd9a6546 100644 --- a/docs-exp/firestore_.query._constructor_.md +++ b/docs-exp/firestore_.query._constructor_.md @@ -4,6 +4,8 @@ ## Query.(constructor) +Constructs a new instance of the `Query` class + Signature: ```typescript diff --git a/docs-exp/firestore_.timestamp._constructor_.md b/docs-exp/firestore_.timestamp._constructor_.md index 876789f8215..48dedce89b0 100644 --- a/docs-exp/firestore_.timestamp._constructor_.md +++ b/docs-exp/firestore_.timestamp._constructor_.md @@ -4,6 +4,8 @@ ## Timestamp.(constructor) +Constructs a new instance of the `Timestamp` class + Signature: ```typescript diff --git a/docs-exp/firestore_.timestamp.md b/docs-exp/firestore_.timestamp.md index 96e0de5ffa0..a8ae331d985 100644 --- a/docs-exp/firestore_.timestamp.md +++ b/docs-exp/firestore_.timestamp.md @@ -14,7 +14,7 @@ export class Timestamp | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(seconds, nanoseconds)](./firestore_.timestamp._constructor_.md) | | | +| [(constructor)(seconds, nanoseconds)](./firestore_.timestamp._constructor_.md) | | Constructs a new instance of the Timestamp class | ## Properties diff --git a/docs-exp/firestore_.wherefilterop.md b/docs-exp/firestore_.wherefilterop.md index bd8696cd955..135a2826179 100644 --- a/docs-exp/firestore_.wherefilterop.md +++ b/docs-exp/firestore_.wherefilterop.md @@ -11,9 +11,11 @@ export type WhereFilterOp = | '<' | '<=' | '==' + | '!=' | '>=' | '>' | 'array-contains' | 'in' - | 'array-contains-any'; + | 'array-contains-any' + | 'not-in'; ``` diff --git a/docs-exp/firestore_lite.collection.md b/docs-exp/firestore_lite.collection.md index d482c080904..e10a26ea76f 100644 --- a/docs-exp/firestore_lite.collection.md +++ b/docs-exp/firestore_lite.collection.md @@ -9,7 +9,8 @@ ```typescript export function collection( firestore: FirebaseFirestore, - collectionPath: string + path: string, + ...pathComponents: string[] ): CollectionReference; ``` @@ -18,7 +19,8 @@ export function collection( | Parameter | Type | Description | | --- | --- | --- | | firestore | [FirebaseFirestore](./firestore_lite.firebasefirestore.md) | | -| collectionPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_lite.collection_1.md b/docs-exp/firestore_lite.collection_1.md index 29911512f75..ad7d6f89c1c 100644 --- a/docs-exp/firestore_lite.collection_1.md +++ b/docs-exp/firestore_lite.collection_1.md @@ -9,7 +9,8 @@ ```typescript export function collection( reference: CollectionReference, - collectionPath: string + path: string, + ...pathComponents: string[] ): CollectionReference; ``` @@ -18,7 +19,8 @@ export function collection( | Parameter | Type | Description | | --- | --- | --- | | reference | [CollectionReference](./firestore_lite.collectionreference.md)<unknown> | | -| collectionPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_lite.collection_2.md b/docs-exp/firestore_lite.collection_2.md index fd5a2cee1e3..5fe13e26d7c 100644 --- a/docs-exp/firestore_lite.collection_2.md +++ b/docs-exp/firestore_lite.collection_2.md @@ -9,7 +9,8 @@ ```typescript export function collection( reference: DocumentReference, - collectionPath: string + path: string, + ...pathComponents: string[] ): CollectionReference; ``` @@ -18,7 +19,8 @@ export function collection( | Parameter | Type | Description | | --- | --- | --- | | reference | [DocumentReference](./firestore_lite.documentreference.md) | | -| collectionPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_lite.collectionreference.doc.md b/docs-exp/firestore_lite.collectionreference.doc.md deleted file mode 100644 index 277c4ba35fd..00000000000 --- a/docs-exp/firestore_lite.collectionreference.doc.md +++ /dev/null @@ -1,22 +0,0 @@ - - -[Home](./index.md) > [@firebase/firestore](./firestore.md) > [lite](./firestore_lite.md) > [CollectionReference](./firestore_lite.collectionreference.md) > [doc](./firestore_lite.collectionreference.doc.md) - -## CollectionReference.doc() method - -Signature: - -```typescript -doc(documentPath?: string): DocumentReference; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| documentPath | string | | - -Returns: - -[DocumentReference](./firestore_lite.documentreference.md)<T> - diff --git a/docs-exp/firestore_lite.collectionreference.md b/docs-exp/firestore_lite.collectionreference.md index 77c5bf1c68f..60c59acd2b8 100644 --- a/docs-exp/firestore_lite.collectionreference.md +++ b/docs-exp/firestore_lite.collectionreference.md @@ -24,6 +24,5 @@ export class CollectionReference extends Query | Method | Modifiers | Description | | --- | --- | --- | -| [doc(documentPath)](./firestore_lite.collectionreference.doc.md) | | | | [withConverter(converter)](./firestore_lite.collectionreference.withconverter.md) | | | diff --git a/docs-exp/firestore_lite.doc.md b/docs-exp/firestore_lite.doc.md index a53b7377a7b..bdcc7890751 100644 --- a/docs-exp/firestore_lite.doc.md +++ b/docs-exp/firestore_lite.doc.md @@ -9,7 +9,8 @@ ```typescript export function doc( firestore: FirebaseFirestore, - documentPath: string + path: string, + ...pathComponents: string[] ): DocumentReference; ``` @@ -18,7 +19,8 @@ export function doc( | Parameter | Type | Description | | --- | --- | --- | | firestore | [FirebaseFirestore](./firestore_lite.firebasefirestore.md) | | -| documentPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_lite.doc_1.md b/docs-exp/firestore_lite.doc_1.md index 2dc484f0aee..54d5d8c50d5 100644 --- a/docs-exp/firestore_lite.doc_1.md +++ b/docs-exp/firestore_lite.doc_1.md @@ -9,7 +9,8 @@ ```typescript export function doc( reference: CollectionReference, - documentPath?: string + path?: string, + ...pathComponents: string[] ): DocumentReference; ``` @@ -18,7 +19,8 @@ export function doc( | Parameter | Type | Description | | --- | --- | --- | | reference | [CollectionReference](./firestore_lite.collectionreference.md)<T> | | -| documentPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_lite.doc_2.md b/docs-exp/firestore_lite.doc_2.md index 8da69a9c466..7f911ca7fac 100644 --- a/docs-exp/firestore_lite.doc_2.md +++ b/docs-exp/firestore_lite.doc_2.md @@ -9,7 +9,8 @@ ```typescript export function doc( reference: DocumentReference, - documentPath: string + path: string, + ...pathComponents: string[] ): DocumentReference; ``` @@ -18,7 +19,8 @@ export function doc( | Parameter | Type | Description | | --- | --- | --- | | reference | [DocumentReference](./firestore_lite.documentreference.md)<unknown> | | -| documentPath | string | | +| path | string | | +| pathComponents | string\[\] | | Returns: diff --git a/docs-exp/firestore_lite.documentreference.collection.md b/docs-exp/firestore_lite.documentreference.collection.md deleted file mode 100644 index 9bbc06863e5..00000000000 --- a/docs-exp/firestore_lite.documentreference.collection.md +++ /dev/null @@ -1,22 +0,0 @@ - - -[Home](./index.md) > [@firebase/firestore](./firestore.md) > [lite](./firestore_lite.md) > [DocumentReference](./firestore_lite.documentreference.md) > [collection](./firestore_lite.documentreference.collection.md) - -## DocumentReference.collection() method - -Signature: - -```typescript -collection(collectionPath: string): CollectionReference; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| collectionPath | string | | - -Returns: - -[CollectionReference](./firestore_lite.collectionreference.md)<[DocumentData](./firestore_lite.documentdata.md)> - diff --git a/docs-exp/firestore_lite.documentreference.md b/docs-exp/firestore_lite.documentreference.md index 41a407e5c8a..b58f0acedbe 100644 --- a/docs-exp/firestore_lite.documentreference.md +++ b/docs-exp/firestore_lite.documentreference.md @@ -25,6 +25,5 @@ export class DocumentReference | Method | Modifiers | Description | | --- | --- | --- | -| [collection(collectionPath)](./firestore_lite.documentreference.collection.md) | | | | [withConverter(converter)](./firestore_lite.documentreference.withconverter.md) | | | diff --git a/docs-exp/firestore_lite.fieldpath._constructor_.md b/docs-exp/firestore_lite.fieldpath._constructor_.md index aee1913d910..bc81513df35 100644 --- a/docs-exp/firestore_lite.fieldpath._constructor_.md +++ b/docs-exp/firestore_lite.fieldpath._constructor_.md @@ -4,6 +4,8 @@ ## FieldPath.(constructor) +Constructs a new instance of the `FieldPath` class + Signature: ```typescript diff --git a/docs-exp/firestore_lite.fieldpath.md b/docs-exp/firestore_lite.fieldpath.md index 91c6ec29fa2..57dae3dcd31 100644 --- a/docs-exp/firestore_lite.fieldpath.md +++ b/docs-exp/firestore_lite.fieldpath.md @@ -14,7 +14,7 @@ export class FieldPath | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(fieldNames)](./firestore_lite.fieldpath._constructor_.md) | | | +| [(constructor)(fieldNames)](./firestore_lite.fieldpath._constructor_.md) | | Constructs a new instance of the FieldPath class | ## Methods diff --git a/docs-exp/firestore_lite.geopoint._constructor_.md b/docs-exp/firestore_lite.geopoint._constructor_.md index 28d61d1288c..993c771707a 100644 --- a/docs-exp/firestore_lite.geopoint._constructor_.md +++ b/docs-exp/firestore_lite.geopoint._constructor_.md @@ -4,6 +4,8 @@ ## GeoPoint.(constructor) +Constructs a new instance of the `GeoPoint` class + Signature: ```typescript diff --git a/docs-exp/firestore_lite.geopoint.md b/docs-exp/firestore_lite.geopoint.md index c8f82dfac92..acda0dc9d97 100644 --- a/docs-exp/firestore_lite.geopoint.md +++ b/docs-exp/firestore_lite.geopoint.md @@ -14,7 +14,7 @@ export class GeoPoint | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(latitude, longitude)](./firestore_lite.geopoint._constructor_.md) | | | +| [(constructor)(latitude, longitude)](./firestore_lite.geopoint._constructor_.md) | | Constructs a new instance of the GeoPoint class | ## Properties diff --git a/docs-exp/firestore_lite.md b/docs-exp/firestore_lite.md index 5e683a5d9a8..e4342f01114 100644 --- a/docs-exp/firestore_lite.md +++ b/docs-exp/firestore_lite.md @@ -31,15 +31,15 @@ | [addDoc(reference, data)](./firestore_lite.adddoc.md) | | | [arrayRemove(elements)](./firestore_lite.arrayremove.md) | | | [arrayUnion(elements)](./firestore_lite.arrayunion.md) | | -| [collection(firestore, collectionPath)](./firestore_lite.collection.md) | | -| [collection(reference, collectionPath)](./firestore_lite.collection_1.md) | | -| [collection(reference, collectionPath)](./firestore_lite.collection_2.md) | | +| [collection(firestore, path, pathComponents)](./firestore_lite.collection.md) | | +| [collection(reference, path, pathComponents)](./firestore_lite.collection_1.md) | | +| [collection(reference, path, pathComponents)](./firestore_lite.collection_2.md) | | | [collectionGroup(firestore, collectionId)](./firestore_lite.collectiongroup.md) | | | [deleteDoc(reference)](./firestore_lite.deletedoc.md) | | | [deleteField()](./firestore_lite.deletefield.md) | | -| [doc(firestore, documentPath)](./firestore_lite.doc.md) | | -| [doc(reference, documentPath)](./firestore_lite.doc_1.md) | | -| [doc(reference, documentPath)](./firestore_lite.doc_2.md) | | +| [doc(firestore, path, pathComponents)](./firestore_lite.doc.md) | | +| [doc(reference, path, pathComponents)](./firestore_lite.doc_1.md) | | +| [doc(reference, path, pathComponents)](./firestore_lite.doc_2.md) | | | [documentId()](./firestore_lite.documentid.md) | | | [endAt(snapshot)](./firestore_lite.endat.md) | | | [endAt(fieldValues)](./firestore_lite.endat_1.md) | | diff --git a/docs-exp/firestore_lite.query._constructor_.md b/docs-exp/firestore_lite.query._constructor_.md index 2e9b0b75b75..14db3945115 100644 --- a/docs-exp/firestore_lite.query._constructor_.md +++ b/docs-exp/firestore_lite.query._constructor_.md @@ -4,6 +4,8 @@ ## Query.(constructor) +Constructs a new instance of the `Query` class + Signature: ```typescript diff --git a/docs-exp/firestore_lite.timestamp._constructor_.md b/docs-exp/firestore_lite.timestamp._constructor_.md index 38a9074a800..e7e93937789 100644 --- a/docs-exp/firestore_lite.timestamp._constructor_.md +++ b/docs-exp/firestore_lite.timestamp._constructor_.md @@ -4,6 +4,8 @@ ## Timestamp.(constructor) +Constructs a new instance of the `Timestamp` class + Signature: ```typescript diff --git a/docs-exp/firestore_lite.timestamp.md b/docs-exp/firestore_lite.timestamp.md index 5ff29ab6959..6812715b5ff 100644 --- a/docs-exp/firestore_lite.timestamp.md +++ b/docs-exp/firestore_lite.timestamp.md @@ -14,7 +14,7 @@ export class Timestamp | Constructor | Modifiers | Description | | --- | --- | --- | -| [(constructor)(seconds, nanoseconds)](./firestore_lite.timestamp._constructor_.md) | | | +| [(constructor)(seconds, nanoseconds)](./firestore_lite.timestamp._constructor_.md) | | Constructs a new instance of the Timestamp class | ## Properties diff --git a/docs-exp/firestore_lite.wherefilterop.md b/docs-exp/firestore_lite.wherefilterop.md index 907dca9e45d..4adf2be9398 100644 --- a/docs-exp/firestore_lite.wherefilterop.md +++ b/docs-exp/firestore_lite.wherefilterop.md @@ -11,9 +11,11 @@ export type WhereFilterOp = | '<' | '<=' | '==' + | '!=' | '>=' | '>' | 'array-contains' | 'in' - | 'array-contains-any'; + | 'array-contains-any' + | 'not-in'; ``` diff --git a/docs-exp/functions.md b/docs-exp/functions.md index 83f644746ad..42c444d2c5c 100644 --- a/docs-exp/functions.md +++ b/docs-exp/functions.md @@ -10,5 +10,5 @@ | --- | --- | | [getFunctions(app, regionOrCustomDomain)](./functions.getfunctions.md) | Returns a Functions instance for the given app. | | [httpsCallable(functionsInstance, name, options)](./functions.httpscallable.md) | Returns a reference to the callable https trigger with the given name. | -| [useFunctionsEmulator(functionsInstance, origin)](./functions.usefunctionsemulator.md) | Changes this instance to point to a Cloud Functions emulator running locally. See https://firebase.google.com/docs/functions/local-emulator | +| [useFunctionsEmulator(functionsInstance, host, port)](./functions.usefunctionsemulator.md) | Modify this instance to communicate with the Cloud Functions emulator.Note: this must be called before this instance has been used to do any operations. | diff --git a/docs-exp/functions.usefunctionsemulator.md b/docs-exp/functions.usefunctionsemulator.md index b7798ce9a13..c2d6780f97f 100644 --- a/docs-exp/functions.usefunctionsemulator.md +++ b/docs-exp/functions.usefunctionsemulator.md @@ -4,12 +4,14 @@ ## useFunctionsEmulator() function -Changes this instance to point to a Cloud Functions emulator running locally. See https://firebase.google.com/docs/functions/local-emulator +Modify this instance to communicate with the Cloud Functions emulator. + +Note: this must be called before this instance has been used to do any operations. Signature: ```typescript -export declare function useFunctionsEmulator(functionsInstance: Functions, origin: string): void; +export declare function useFunctionsEmulator(functionsInstance: Functions, host: string, port: number): void; ``` ## Parameters @@ -17,7 +19,8 @@ export declare function useFunctionsEmulator(functionsInstance: Functions, origi | Parameter | Type | Description | | --- | --- | --- | | functionsInstance | [Functions](./functions-types.functions.md) | | -| origin | string | The origin of the local emulator, such as "http://localhost:5005". | +| host | string | The emulator host (ex: localhost) | +| port | number | The emulator port (ex: 5001) | Returns: diff --git a/docs-exp/index.md b/docs-exp/index.md index 528eb181002..10679e82cf2 100644 --- a/docs-exp/index.md +++ b/docs-exp/index.md @@ -12,6 +12,7 @@ | [@firebase/app-types](./app-types.md) | | | [@firebase/auth](./auth.md) | | | [@firebase/auth-types](./auth-types.md) | | +| [@firebase/firestore](./firestore.md) | | | [@firebase/functions](./functions.md) | | | [@firebase/functions-types](./functions-types.md) | | | [@firebase/installations](./installations.md) | | diff --git a/package.json b/package.json index d8b33834a3b..9966deb6fc4 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "lint": "lerna run --scope @firebase/* --scope rxfire lint", "size-report": "ts-node-script scripts/size_report/report_binary_size.ts", "modular-export-size-report": "ts-node-script scripts/size_report/report_modular_export_binary_size.ts", - "api-report": "lerna run --scope @firebase/*-exp api-report", + "api-report": "lerna run --scope @firebase/*-exp --scope @firebase/firestore api-report", "docgen:exp": "ts-node-script scripts/exp/docgen.ts", "postinstall": "yarn --cwd repo-scripts/changelog-generator build", "sa": "ts-node-script repo-scripts/size-analysis/cli.ts"