firebase-api-surface
Advanced tools
Comparing version 0.5.1 to 0.6.0
@@ -1,1 +0,5 @@ | ||
export { RTDBEventType, IRTDBDatabase, IRTDBDataSnapshot, IRTDBOnDisconnect, IRTDBQuery, IRTDBReference, IRTDBTransactionResult } from "./rtdb"; | ||
export { RTDBEventType, IRTDBDatabase, IRTDBDataSnapshot, IRTDBOnDisconnect, IRTDBQuery, IRTDBReference, IRTDBTransactionResult } from "./rtdb2"; | ||
import * as storage from "./storage"; | ||
export { storage }; | ||
import * as firestore from "./firestore"; | ||
export { firestore }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const storage = require("./storage"); | ||
exports.storage = storage; | ||
const firestore = require("./firestore"); | ||
exports.firestore = firestore; |
import { FirebaseApp } from "@firebase/app-types"; | ||
export declare type RTDBEventType = "value" | "child_moved" | "child_removed" | "child_added" | "child_changed"; | ||
export interface IRTDBDatabase { | ||
export declare type EventType = "value" | "child_moved" | "child_removed" | "child_added" | "child_changed"; | ||
export interface IFirebaseDatabase { | ||
readonly app: FirebaseApp; | ||
ref(pathString?: string): IRTDBReference; | ||
refFromURL(url: string): IRTDBReference; | ||
ref(pathString?: string): Reference; | ||
refFromURL(url: string): Reference; | ||
goOffline(): void; | ||
goOnline(): void; | ||
} | ||
export interface IRTDBQuery<T = any> { | ||
off(eventType?: string, callback?: ISnapshotCallback, context?: Object): void; | ||
once(eventType: string, userCallback?: ISnapshotCallback, cancelOrContext?: ((a: Error) => void) | Object, context?: Object): Promise<IRTDBDataSnapshot<T>>; | ||
limitToFirst(limit: number): IRTDBQuery<T>; | ||
limitToLast(limit: number): IRTDBQuery<T>; | ||
orderByChild(path: string): IRTDBQuery<T>; | ||
orderByKey(): IRTDBQuery<T>; | ||
orderByPriority(): IRTDBQuery<T>; | ||
orderByValue(): IRTDBQuery<T>; | ||
startAt(value?: number | string | boolean | null, name?: string | null): IRTDBQuery<T>; | ||
endAt(value?: number | string | boolean | null, name?: string | null): IRTDBQuery<T>; | ||
equalTo(value: number | string | boolean | null, name?: string): IRTDBQuery; | ||
export interface Query<T = any> { | ||
off(eventType?: EventType, callback?: ISnapshotCallback, context?: Object): void; | ||
once(eventType: EventType, userCallback?: ISnapshotCallback, cancelOrContext?: ((a: Error) => void) | Object, context?: Object): Promise<DataSnapshot<T>>; | ||
limitToFirst(limit: number): Query<T>; | ||
limitToLast(limit: number): Query<T>; | ||
orderByChild(path: string): Query<T>; | ||
orderByKey(): Query<T>; | ||
orderByPriority(): Query<T>; | ||
orderByValue(): Query<T>; | ||
startAt(value?: number | string | boolean | null, name?: string | null): Query<T>; | ||
endAt(value?: number | string | boolean | null, name?: string | null): Query<T>; | ||
equalTo(value: number | string | boolean | null, name?: string): Query; | ||
toString(): string; | ||
toJSON(): string; | ||
isEqual(other: IRTDBQuery): boolean; | ||
isEqual(other: Query): boolean; | ||
} | ||
export interface IRTDBReference<T = any> extends IRTDBQuery { | ||
export interface Reference<T = any> extends Query { | ||
set(newVal: T, onComplete?: (a: Error | null) => void): Promise<void>; | ||
@@ -31,21 +31,21 @@ update(objectToMerge: Partial<T>, onComplete?: (a: Error | null) => void): Promise<void>; | ||
remove(onComplete?: (a: Error | null) => void): Promise<void>; | ||
transaction(transactionUpdate: (a: Partial<T>) => Partial<T>, onComplete?: (a: Error | null, b: boolean, c: IRTDBDataSnapshot<T> | null) => void, applyLocally?: boolean): Promise<IRTDBTransactionResult<T>>; | ||
transaction(transactionUpdate: (a: Partial<T>) => Partial<T>, onComplete?: (a: Error | null, b: boolean, c: DataSnapshot<T> | null) => void, applyLocally?: boolean): Promise<TransactionResult<T>>; | ||
setPriority(priority: string | number | null, onComplete?: (a: Error | null) => void): Promise<void>; | ||
push(value?: any, onComplete?: (a: Error | null) => void): IRTDBReference<T>; | ||
onDisconnect(): IRTDBOnDisconnect<T>; | ||
push(value?: any, onComplete?: (a: Error | null) => void): Reference<T>; | ||
onDisconnect(): OnDisconnect<T>; | ||
readonly key: string | null; | ||
readonly parent: IRTDBReference | null; | ||
readonly root: IRTDBReference; | ||
readonly parent: Reference | null; | ||
readonly root: Reference; | ||
} | ||
export interface IRTDBTransactionResult<T = any> { | ||
export interface TransactionResult<T = any> { | ||
committed: boolean; | ||
snapshot: IRTDBDataSnapshot<T>; | ||
snapshot: DataSnapshot<T>; | ||
toJSON(): object; | ||
} | ||
export interface IRTDBDataSnapshot<T = any> { | ||
readonly ref: IRTDBReference<T>; | ||
export interface DataSnapshot<T = any> { | ||
readonly ref: Reference<T>; | ||
readonly key: string; | ||
child<T = any>(childPathString: string): IRTDBDataSnapshot<T>; | ||
child<T = any>(childPathString: string): DataSnapshot<T>; | ||
exists(): boolean; | ||
forEach(action: (d: IRTDBDataSnapshot) => void): boolean; | ||
forEach(action: (d: DataSnapshot) => void): boolean; | ||
getPriority(): string | number | null; | ||
@@ -58,3 +58,3 @@ hasChild(childPathString: string): boolean; | ||
} | ||
export interface IRTDBOnDisconnect<T = any> { | ||
export interface OnDisconnect<T = any> { | ||
cancel(onComplete?: (a: Error | null) => void): Promise<void>; | ||
@@ -67,3 +67,3 @@ remove(onComplete?: (a: Error | null) => void): Promise<void>; | ||
export interface ISnapshotCallback<T = any> { | ||
(a: IRTDBDataSnapshot<T>, b?: string): any; | ||
(a: DataSnapshot<T>, b?: string): any; | ||
} |
{ | ||
"name": "firebase-api-surface", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "the publically exposed firebase API", | ||
@@ -24,3 +24,8 @@ "license": "MIT", | ||
"dependencies": { | ||
"@firebase/app-types": "^0.1.1" | ||
"@firebase/app-types": "^0.1.1", | ||
"@firebase/database-types": "^0.1.1", | ||
"@firebase/firestore-types": "^0.2.1", | ||
"@firebase/messaging-types": "^0.1.1", | ||
"@firebase/storage-types": "^0.1.1", | ||
"@firebase/util": "^0.1.7" | ||
}, | ||
@@ -27,0 +32,0 @@ "devDependencies": { |
@@ -9,2 +9,8 @@ export { | ||
IRTDBTransactionResult | ||
} from "./rtdb"; | ||
} from "./rtdb2"; | ||
import * as storage from "./storage"; | ||
export { storage }; | ||
import * as firestore from "./firestore"; | ||
export { firestore }; |
import { FirebaseApp } from "@firebase/app-types"; | ||
export type RTDBEventType = | ||
export type EventType = | ||
| "value" | ||
@@ -10,7 +9,7 @@ | "child_moved" | ||
export interface IRTDBDatabase { | ||
export interface IFirebaseDatabase { | ||
/** */ | ||
readonly app: FirebaseApp; | ||
/** Returns a reference to the root or the path specified in opt_pathString. */ | ||
ref(pathString?: string): IRTDBReference; | ||
ref(pathString?: string): Reference; | ||
/** | ||
@@ -21,3 +20,3 @@ * Returns a reference to the root or the path specified in url. | ||
*/ | ||
refFromURL(url: string): IRTDBReference; | ||
refFromURL(url: string): Reference; | ||
/** Disconnects from the server (all Database operations will be completed offline). */ | ||
@@ -29,31 +28,35 @@ goOffline(): void; | ||
export interface IRTDBQuery<T = any> { | ||
off(eventType?: string, callback?: ISnapshotCallback, context?: Object): void; | ||
export interface Query<T = any> { | ||
off( | ||
eventType?: EventType, | ||
callback?: ISnapshotCallback, | ||
context?: Object | ||
): void; | ||
/** Attaches a listener, waits for the first event, and then removes the listener */ | ||
once( | ||
eventType: string, | ||
eventType: EventType, | ||
userCallback?: ISnapshotCallback, | ||
cancelOrContext?: ((a: Error) => void) | Object, | ||
context?: Object | ||
): Promise<IRTDBDataSnapshot<T>>; | ||
): Promise<DataSnapshot<T>>; | ||
/** Set a limit and anchor it to the start of the window. */ | ||
limitToFirst(limit: number): IRTDBQuery<T>; | ||
limitToFirst(limit: number): Query<T>; | ||
/** Set a limit and anchor it to the end of the window. */ | ||
limitToLast(limit: number): IRTDBQuery<T>; | ||
limitToLast(limit: number): Query<T>; | ||
/** Given a child path, return a new query ordered by the specified grandchild path. */ | ||
orderByChild(path: string): IRTDBQuery<T>; | ||
orderByChild(path: string): Query<T>; | ||
/** Return a new query ordered by the KeyIndex */ | ||
orderByKey(): IRTDBQuery<T>; | ||
orderByKey(): Query<T>; | ||
/** Return a new query ordered by the PriorityIndex */ | ||
orderByPriority(): IRTDBQuery<T>; | ||
orderByPriority(): Query<T>; | ||
/** Return a new query ordered by the ValueIndex */ | ||
orderByValue(): IRTDBQuery<T>; | ||
orderByValue(): Query<T>; | ||
startAt( | ||
value?: number | string | boolean | null, | ||
name?: string | null | ||
): IRTDBQuery<T>; | ||
): Query<T>; | ||
endAt( | ||
value?: number | string | boolean | null, | ||
name?: string | null | ||
): IRTDBQuery<T>; | ||
): Query<T>; | ||
/** | ||
@@ -63,3 +66,3 @@ * Load the selection of children with exactly the specified value, and, optionally, | ||
*/ | ||
equalTo(value: number | string | boolean | null, name?: string): IRTDBQuery; | ||
equalTo(value: number | string | boolean | null, name?: string): Query; | ||
/** URL for this location. */ | ||
@@ -69,6 +72,6 @@ toString(): string; | ||
/** Return true if this query and the provided query are equivalent; otherwise, return false. */ | ||
isEqual(other: IRTDBQuery): boolean; | ||
isEqual(other: Query): boolean; | ||
} | ||
export interface IRTDBReference<T = any> extends IRTDBQuery { | ||
export interface Reference<T = any> extends Query { | ||
/** Writes data to a Database location */ | ||
@@ -95,6 +98,6 @@ set(newVal: T, onComplete?: (a: Error | null) => void): Promise<void>; | ||
b: boolean, | ||
c: IRTDBDataSnapshot<T> | null | ||
c: DataSnapshot<T> | null | ||
) => void, | ||
applyLocally?: boolean | ||
): Promise<IRTDBTransactionResult<T>>; | ||
): Promise<TransactionResult<T>>; | ||
/** Sets a priority for the data at this Database location. */ | ||
@@ -106,19 +109,19 @@ setPriority( | ||
/** Generates a new child location using a unique key and returns its Reference. */ | ||
push(value?: any, onComplete?: (a: Error | null) => void): IRTDBReference<T>; | ||
push(value?: any, onComplete?: (a: Error | null) => void): Reference<T>; | ||
/** Returns an OnDisconnect object - see Enabling Offline Capabilities in JavaScript for more information on how to use it. */ | ||
onDisconnect(): IRTDBOnDisconnect<T>; | ||
onDisconnect(): OnDisconnect<T>; | ||
readonly key: string | null; | ||
readonly parent: IRTDBReference | null; | ||
readonly root: IRTDBReference; | ||
readonly parent: Reference | null; | ||
readonly root: Reference; | ||
} | ||
export interface IRTDBTransactionResult<T = any> { | ||
export interface TransactionResult<T = any> { | ||
committed: boolean; | ||
snapshot: IRTDBDataSnapshot<T>; | ||
snapshot: DataSnapshot<T>; | ||
toJSON(): object; | ||
} | ||
export interface IRTDBDataSnapshot<T = any> { | ||
export interface DataSnapshot<T = any> { | ||
/** The Reference for the location that generated this DataSnapshot. */ | ||
readonly ref: IRTDBReference<T>; | ||
readonly ref: Reference<T>; | ||
/** The key (last part of the path) of the location of this DataSnapshot. */ | ||
@@ -128,7 +131,7 @@ readonly key: string; | ||
/** Gets another DataSnapshot for the location at the specified relative path. */ | ||
child<T = any>(childPathString: string): IRTDBDataSnapshot<T>; | ||
child<T = any>(childPathString: string): DataSnapshot<T>; | ||
/** Returns true if this DataSnapshot contains any data. It is slightly more efficient than using snapshot.val() !== null. */ | ||
exists(): boolean; | ||
/** Enumerates the top-level children in the DataSnapshot. */ | ||
forEach(action: (d: IRTDBDataSnapshot) => void): boolean; | ||
forEach(action: (d: DataSnapshot) => void): boolean; | ||
/** Gets the priority value of the data in this DataSnapshot. */ | ||
@@ -148,3 +151,3 @@ getPriority(): string | number | null; | ||
export interface IRTDBOnDisconnect<T = any> { | ||
export interface OnDisconnect<T = any> { | ||
cancel(onComplete?: (a: Error | null) => void): Promise<void>; | ||
@@ -165,3 +168,3 @@ remove(onComplete?: (a: Error | null) => void): Promise<void>; | ||
export interface ISnapshotCallback<T = any> { | ||
(a: IRTDBDataSnapshot<T>, b?: string): any; | ||
(a: DataSnapshot<T>, b?: string): any; | ||
} |
Sorry, the diff of this file is not supported yet
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
55584
32
886
1
73
6
+ Added@firebase/util@^0.1.7
+ Added@firebase/database-types@0.1.2(transitive)
+ Added@firebase/firestore-types@0.2.2(transitive)
+ Added@firebase/messaging-types@0.1.3(transitive)
+ Added@firebase/storage-types@0.1.3(transitive)
+ Added@firebase/util@0.1.11(transitive)
+ Addedtslib@1.9.0(transitive)