push all website files

This commit is contained in:
Jacob Levine
2019-01-06 13:14:45 -06:00
parent d7301e26c3
commit d2d5d4c04e
15662 changed files with 2166516 additions and 0 deletions

View File

@@ -0,0 +1,83 @@
import { Node } from '../core/snap/Node';
import { Reference } from './Reference';
import { Index } from '../core/snap/indexes/Index';
/**
* Class representing a firebase data snapshot. It wraps a SnapshotNode and
* surfaces the public methods (val, forEach, etc.) we want to expose.
*/
export declare class DataSnapshot {
private readonly node_;
private readonly ref_;
private readonly index_;
/**
* @param {!Node} node_ A SnapshotNode to wrap.
* @param {!Reference} ref_ The ref of the location this snapshot came from.
* @param {!Index} index_ The iteration order for this snapshot
*/
constructor(node_: Node, ref_: Reference, index_: Index);
/**
* Retrieves the snapshot contents as JSON. Returns null if the snapshot is
* empty.
*
* @return {*} JSON representation of the DataSnapshot contents, or null if empty.
*/
val(): any;
/**
* Returns the snapshot contents as JSON, including priorities of node. Suitable for exporting
* the entire node contents.
* @return {*} JSON representation of the DataSnapshot contents, or null if empty.
*/
exportVal(): any;
toJSON(): any;
/**
* Returns whether the snapshot contains a non-null value.
*
* @return {boolean} Whether the snapshot contains a non-null value, or is empty.
*/
exists(): boolean;
/**
* Returns a DataSnapshot of the specified child node's contents.
*
* @param {!string} childPathString Path to a child.
* @return {!DataSnapshot} DataSnapshot for child node.
*/
child(childPathString: string): DataSnapshot;
/**
* Returns whether the snapshot contains a child at the specified path.
*
* @param {!string} childPathString Path to a child.
* @return {boolean} Whether the child exists.
*/
hasChild(childPathString: string): boolean;
/**
* Returns the priority of the object, or null if no priority was set.
*
* @return {string|number|null} The priority.
*/
getPriority(): string | number | null;
/**
* Iterates through child nodes and calls the specified action for each one.
*
* @param {function(!DataSnapshot)} action Callback function to be called
* for each child.
* @return {boolean} True if forEach was canceled by action returning true for
* one of the child nodes.
*/
forEach(action: (d: DataSnapshot) => boolean | void): boolean;
/**
* Returns whether this DataSnapshot has children.
* @return {boolean} True if the DataSnapshot contains 1 or more child nodes.
*/
hasChildren(): boolean;
readonly key: string;
/**
* Returns the number of children for this DataSnapshot.
* @return {number} The number of children that this DataSnapshot contains.
*/
numChildren(): number;
/**
* @return {Reference} The Firebase reference for the location this snapshot's data came from.
*/
getRef(): Reference;
readonly ref: Reference;
}

View File

@@ -0,0 +1,57 @@
import { Reference } from './Reference';
import { Repo } from '../core/Repo';
import { FirebaseApp } from '@firebase/app-types';
import { FirebaseService } from '@firebase/app-types/private';
/**
* Class representing a firebase database.
* @implements {FirebaseService}
*/
export declare class Database implements FirebaseService {
private repo_;
INTERNAL: DatabaseInternals;
private root_;
static readonly ServerValue: {
TIMESTAMP: {
'.sv': string;
};
};
/**
* The constructor should not be called by users of our public API.
* @param {!Repo} repo_
*/
constructor(repo_: Repo);
readonly app: FirebaseApp;
/**
* Returns a reference to the root or to the path specified in the provided
* argument.
* @param {string|Reference=} path The relative string path or an existing
* Reference to a database location.
* @throws If a Reference is provided, throws if it does not belong to the
* same project.
* @return {!Reference} Firebase reference.
**/
ref(path?: string): Reference;
ref(path?: Reference): Reference;
/**
* Returns a reference to the root or the path specified in url.
* We throw a exception if the url is not in the same domain as the
* current repo.
* @param {string} url
* @return {!Reference} Firebase reference.
*/
refFromURL(url: string): Reference;
/**
* @param {string} apiName
*/
private checkDeleted_(apiName);
goOffline(): void;
goOnline(): void;
}
export declare class DatabaseInternals {
database: Database;
/** @param {!Database} database */
constructor(database: Database);
/** @return {Promise<void>} */
delete(): Promise<void>;
}

View File

@@ -0,0 +1,170 @@
import { Path } from '../core/util/Path';
import { Repo } from '../core/Repo';
import { QueryParams } from '../core/view/QueryParams';
import { Reference } from './Reference';
import { DataSnapshot } from './DataSnapshot';
export interface SnapshotCallback {
(a: DataSnapshot, b?: string): any;
}
/**
* A Query represents a filter to be applied to a firebase location. This object purely represents the
* query expression (and exposes our public API to build the query). The actual query logic is in ViewBase.js.
*
* Since every Firebase reference is a query, Firebase inherits from this object.
*/
export declare class Query {
repo: Repo;
path: Path;
private queryParams_;
private orderByCalled_;
static __referenceConstructor: new (repo: Repo, path: Path) => Query;
constructor(repo: Repo, path: Path, queryParams_: QueryParams, orderByCalled_: boolean);
/**
* Validates start/end values for queries.
* @param {!QueryParams} params
* @private
*/
private static validateQueryEndpoints_(params);
/**
* Validates that limit* has been called with the correct combination of parameters
* @param {!QueryParams} params
* @private
*/
private static validateLimit_(params);
/**
* Validates that no other order by call has been made
* @param {!string} fnName
* @private
*/
private validateNoPreviousOrderByCall_(fnName);
/**
* @return {!QueryParams}
*/
getQueryParams(): QueryParams;
/**
* @return {!Reference}
*/
getRef(): Reference;
/**
* @param {!string} eventType
* @param {!function(DataSnapshot, string=)} callback
* @param {(function(Error)|Object)=} cancelCallbackOrContext
* @param {Object=} context
* @return {!function(DataSnapshot, string=)}
*/
on(eventType: string, callback: SnapshotCallback, cancelCallbackOrContext?: ((a: Error) => any) | Object, context?: Object): SnapshotCallback;
/**
* @param {!function(!DataSnapshot)} callback
* @param {?function(Error)} cancelCallback
* @param {?Object} context
* @protected
*/
protected onValueEvent(callback: (a: DataSnapshot) => void, cancelCallback: ((a: Error) => void) | null, context: Object | null): void;
/**
* @param {!Object.<string, !function(!DataSnapshot, ?string)>} callbacks
* @param {?function(Error)} cancelCallback
* @param {?Object} context
* @protected
*/
onChildEvent(callbacks: {
[k: string]: SnapshotCallback;
}, cancelCallback: ((a: Error) => any) | null, context: Object | null): void;
/**
* @param {string=} eventType
* @param {(function(!DataSnapshot, ?string=))=} callback
* @param {Object=} context
*/
off(eventType?: string, callback?: SnapshotCallback, context?: Object): void;
/**
* Attaches a listener, waits for the first event, and then removes the listener
* @param {!string} eventType
* @param {!function(!DataSnapshot, string=)} userCallback
* @param cancelOrContext
* @param context
* @return {!firebase.Promise}
*/
once(eventType: string, userCallback?: SnapshotCallback, cancelOrContext?: ((a: Error) => void) | Object, context?: Object): Promise<DataSnapshot>;
/**
* Set a limit and anchor it to the start of the window.
* @param {!number} limit
* @return {!Query}
*/
limitToFirst(limit: number): Query;
/**
* Set a limit and anchor it to the end of the window.
* @param {!number} limit
* @return {!Query}
*/
limitToLast(limit: number): Query;
/**
* Given a child path, return a new query ordered by the specified grandchild path.
* @param {!string} path
* @return {!Query}
*/
orderByChild(path: string): Query;
/**
* Return a new query ordered by the KeyIndex
* @return {!Query}
*/
orderByKey(): Query;
/**
* Return a new query ordered by the PriorityIndex
* @return {!Query}
*/
orderByPriority(): Query;
/**
* Return a new query ordered by the ValueIndex
* @return {!Query}
*/
orderByValue(): Query;
/**
* @param {number|string|boolean|null} value
* @param {?string=} name
* @return {!Query}
*/
startAt(value?: number | string | boolean | null, name?: string | null): Query;
/**
* @param {number|string|boolean|null} value
* @param {?string=} name
* @return {!Query}
*/
endAt(value?: number | string | boolean | null, name?: string | null): Query;
/**
* Load the selection of children with exactly the specified value, and, optionally,
* the specified name.
* @param {number|string|boolean|null} value
* @param {string=} name
* @return {!Query}
*/
equalTo(value: number | string | boolean | null, name?: string): Query;
/**
* @return {!string} URL for this location.
*/
toString(): string;
toJSON(): string;
/**
* An object representation of the query parameters used by this Query.
* @return {!Object}
*/
queryObject(): Object;
/**
* @return {!string}
*/
queryIdentifier(): string;
/**
* Return true if this query and the provided query are equivalent; otherwise, return false.
* @param {Query} other
* @return {boolean}
*/
isEqual(other: Query): boolean;
/**
* Helper used by .on and .once to extract the context and or cancel arguments.
* @param {!string} fnName The function name (on or once)
* @param {(function(Error)|Object)=} cancelOrContext
* @param {Object=} context
* @return {{cancel: ?function(Error), context: ?Object}}
* @private
*/
private static getCancelAndContextArgs_(fnName, cancelOrContext?, context?);
readonly ref: Reference;
}

View File

@@ -0,0 +1,105 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { OnDisconnect } from './onDisconnect';
import { TransactionResult } from './TransactionResult';
import { Query } from './Query';
import { Repo } from '../core/Repo';
import { Path } from '../core/util/Path';
import { Database } from './Database';
import { DataSnapshot } from './DataSnapshot';
export interface ReferenceConstructor {
new (repo: Repo, path: Path): Reference;
}
export declare class Reference extends Query {
then: (a?: any) => Promise<any>;
catch: (a?: Error) => Promise<any>;
/**
* Call options:
* new Reference(Repo, Path) or
* new Reference(url: string, string|RepoManager)
*
* Externally - this is the firebase.database.Reference type.
*
* @param {!Repo} repo
* @param {(!Path)} path
* @extends {Query}
*/
constructor(repo: Repo, path: Path);
/** @return {?string} */
getKey(): string | null;
/**
* @param {!(string|Path)} pathString
* @return {!Reference}
*/
child(pathString: string | Path): Reference;
/** @return {?Reference} */
getParent(): Reference | null;
/** @return {!Reference} */
getRoot(): Reference;
/** @return {!Database} */
databaseProp(): Database;
/**
* @param {*} newVal
* @param {function(?Error)=} onComplete
* @return {!Promise}
*/
set(newVal: any, onComplete?: (a: Error | null) => void): Promise<any>;
/**
* @param {!Object} objectToMerge
* @param {function(?Error)=} onComplete
* @return {!Promise}
*/
update(objectToMerge: Object, onComplete?: (a: Error | null) => void): Promise<any>;
/**
* @param {*} newVal
* @param {string|number|null} newPriority
* @param {function(?Error)=} onComplete
* @return {!Promise}
*/
setWithPriority(newVal: any, newPriority: string | number | null, onComplete?: (a: Error | null) => void): Promise<any>;
/**
* @param {function(?Error)=} onComplete
* @return {!Promise}
*/
remove(onComplete?: (a: Error | null) => void): Promise<any>;
/**
* @param {function(*):*} transactionUpdate
* @param {(function(?Error, boolean, ?DataSnapshot))=} onComplete
* @param {boolean=} applyLocally
* @return {!Promise}
*/
transaction(transactionUpdate: (a: any) => any, onComplete?: (a: Error | null, b: boolean, c: DataSnapshot | null) => void, applyLocally?: boolean): Promise<TransactionResult>;
/**
* @param {string|number|null} priority
* @param {function(?Error)=} onComplete
* @return {!Promise}
*/
setPriority(priority: string | number | null, onComplete?: (a: Error | null) => void): Promise<any>;
/**
* @param {*=} value
* @param {function(?Error)=} onComplete
* @return {!Reference}
*/
push(value?: any, onComplete?: (a: Error | null) => void): Reference;
/**
* @return {!OnDisconnect}
*/
onDisconnect(): OnDisconnect;
readonly database: Database;
readonly key: string | null;
readonly parent: Reference | null;
readonly root: Reference;
}

View File

@@ -0,0 +1,29 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { DataSnapshot } from './DataSnapshot';
export declare class TransactionResult {
committed: boolean;
snapshot: DataSnapshot;
/**
* A type for the resolve value of Firebase.transaction.
* @constructor
* @dict
* @param {boolean} committed
* @param {DataSnapshot} snapshot
*/
constructor(committed: boolean, snapshot: DataSnapshot);
toJSON(): object;
}

View File

@@ -0,0 +1,16 @@
import { Reference } from './Reference';
/**
* INTERNAL methods for internal-use only (tests, etc.).
*
* Customers shouldn't use these or else should be aware that they could break at any time.
*
* @const
*/
export declare const forceLongPolling: () => void;
export declare const forceWebSockets: () => void;
export declare const isWebSocketsAvailable: () => boolean;
export declare const setSecurityDebugCallback: (ref: Reference, callback: (a: Object) => void) => void;
export declare const stats: (ref: Reference, showDelta?: boolean) => void;
export declare const statsIncrementCounter: (ref: Reference, metric: string) => void;
export declare const dataUpdateCount: (ref: Reference) => number;
export declare const interceptServerData: (ref: Reference, callback: (a: string, b: any) => void) => void;

View File

@@ -0,0 +1,43 @@
import { Repo } from '../core/Repo';
import { Path } from '../core/util/Path';
/**
* @constructor
*/
export declare class OnDisconnect {
private repo_;
private path_;
/**
* @param {!Repo} repo_
* @param {!Path} path_
*/
constructor(repo_: Repo, path_: Path);
/**
* @param {function(?Error)=} onComplete
* @return {!firebase.Promise}
*/
cancel(onComplete?: (a: Error | null) => void): Promise<void>;
/**
* @param {function(?Error)=} onComplete
* @return {!firebase.Promise}
*/
remove(onComplete?: (a: Error | null) => void): Promise<void>;
/**
* @param {*} value
* @param {function(?Error)=} onComplete
* @return {!firebase.Promise}
*/
set(value: any, onComplete?: (a: Error | null) => void): Promise<void>;
/**
* @param {*} value
* @param {number|string|null} priority
* @param {function(?Error)=} onComplete
* @return {!firebase.Promise}
*/
setWithPriority(value: any, priority: number | string | null, onComplete?: (a: Error | null) => void): Promise<void>;
/**
* @param {!Object} objectToMerge
* @param {function(?Error)=} onComplete
* @return {!firebase.Promise}
*/
update(objectToMerge: object, onComplete?: (a: Error | null) => void): Promise<void>;
}

View File

@@ -0,0 +1,46 @@
/**
* Copyright 2017 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { RepoInfo } from '../core/RepoInfo';
import { PersistentConnection } from '../core/PersistentConnection';
import { Connection } from '../realtime/Connection';
import { Query } from './Query';
export declare const DataConnection: typeof PersistentConnection;
export declare const RealTimeConnection: typeof Connection;
/**
* @param {function(): string} newHash
* @return {function()}
*/
export declare const hijackHash: (newHash: () => string) => () => void;
/**
* @type {function(new:RepoInfo, !string, boolean, !string, boolean): undefined}
*/
export declare const ConnectionTarget: typeof RepoInfo;
/**
* @param {!Query} query
* @return {!string}
*/
export declare const queryIdentifier: (query: Query) => string;
/**
* @param {!Query} firebaseRef
* @return {!Object}
*/
export declare const listens: (firebaseRef: Query) => any;
/**
* Forces the RepoManager to create Repos that use ReadonlyRestClient instead of PersistentConnection.
*
* @param {boolean} forceRestClient
*/
export declare const forceRestClient: (forceRestClient: boolean) => void;