mirror of
https://github.com/musix-org/musix-oss
synced 2025-06-17 04:26:00 +00:00
Modules
This commit is contained in:
293
node_modules/firebase/externs/firebase-app-externs.js
generated
vendored
Normal file
293
node_modules/firebase/externs/firebase-app-externs.js
generated
vendored
Normal file
@ -0,0 +1,293 @@
|
||||
/**
|
||||
* @license 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Firebase namespace and Firebase App API.
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/**
|
||||
* <code>firebase</code> is a global namespace from which all the Firebase
|
||||
* services are accessed.
|
||||
*
|
||||
* @namespace
|
||||
*/
|
||||
var firebase = {};
|
||||
|
||||
/**
|
||||
* Creates and initializes a Firebase {@link firebase.app.App app} instance.
|
||||
*
|
||||
* See
|
||||
* {@link
|
||||
* https://firebase.google.com/docs/web/setup#add_firebase_to_your_app
|
||||
* Add Firebase to your app} and
|
||||
* {@link
|
||||
* https://firebase.google.com/docs/web/setup#initialize_multiple_apps
|
||||
* Initialize multiple apps} for detailed documentation.
|
||||
*
|
||||
* @example
|
||||
* // Initialize default app
|
||||
* // Retrieve your own options values by adding a web app on
|
||||
* // https://console.firebase.google.com
|
||||
* firebase.initializeApp({
|
||||
* apiKey: "AIza....", // Auth / General Use
|
||||
* authDomain: "YOUR_APP.firebaseapp.com", // Auth with popup/redirect
|
||||
* databaseURL: "https://YOUR_APP.firebaseio.com", // Realtime Database
|
||||
* storageBucket: "YOUR_APP.appspot.com", // Storage
|
||||
* messagingSenderId: "123456789" // Cloud Messaging
|
||||
* });
|
||||
*
|
||||
* @example
|
||||
* // Initialize another app
|
||||
* var otherApp = firebase.initializeApp({
|
||||
* databaseURL: "https://<OTHER_DATABASE_NAME>.firebaseio.com",
|
||||
* storageBucket: "<OTHER_STORAGE_BUCKET>.appspot.com"
|
||||
* }, "otherApp");
|
||||
*
|
||||
* @param {!Object} options Options to configure the app's services.
|
||||
* @param {string=} name Optional name of the app to initialize. If no name
|
||||
* is provided, the default is `"[DEFAULT]"`.
|
||||
*
|
||||
* @return {!firebase.app.App} The initialized app.
|
||||
*/
|
||||
firebase.initializeApp = function(options, name) {};
|
||||
|
||||
/**
|
||||
* Retrieves a Firebase {@link firebase.app.App app} instance.
|
||||
*
|
||||
* When called with no arguments, the default app is returned. When an app name
|
||||
* is provided, the app corresponding to that name is returned.
|
||||
*
|
||||
* An exception is thrown if the app being retrieved has not yet been
|
||||
* initialized.
|
||||
*
|
||||
* @example
|
||||
* // Return the default app
|
||||
* var app = firebase.app();
|
||||
*
|
||||
* @example
|
||||
* // Return a named app
|
||||
* var otherApp = firebase.app("otherApp");
|
||||
*
|
||||
* @namespace
|
||||
* @param {string=} name Optional name of the app to return. If no name is
|
||||
* provided, the default is `"[DEFAULT]"`.
|
||||
*
|
||||
* @return {!firebase.app.App} The app corresponding to the provided app name.
|
||||
* If no app name is provided, the default app is returned.
|
||||
*/
|
||||
firebase.app = function(name) {};
|
||||
|
||||
/**
|
||||
* A (read-only) array of all initialized apps.
|
||||
* @type {!Array<firebase.app.App>}
|
||||
*/
|
||||
firebase.apps;
|
||||
|
||||
/**
|
||||
* The current SDK version.
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.SDK_VERSION;
|
||||
|
||||
/**
|
||||
* A Firebase App holds the initialization information for a collection of
|
||||
* services.
|
||||
*
|
||||
* Do not call this constructor directly. Instead, use
|
||||
* {@link firebase#.initializeApp `firebase.initializeApp()`} to create an app.
|
||||
*
|
||||
* @interface
|
||||
*/
|
||||
firebase.app.App = function() {};
|
||||
|
||||
/**
|
||||
* The (read-only) name for this app.
|
||||
*
|
||||
* The default app's name is `"[DEFAULT]"`.
|
||||
*
|
||||
* @example
|
||||
* // The default app's name is "[DEFAULT]"
|
||||
* firebase.initializeApp(defaultAppConfig);
|
||||
* console.log(firebase.app().name); // "[DEFAULT]"
|
||||
*
|
||||
* @example
|
||||
* // A named app's name is what you provide to initializeApp()
|
||||
* var otherApp = firebase.initializeApp(otherAppConfig, "other");
|
||||
* console.log(otherApp.name); // "other"
|
||||
*
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.app.App.prototype.name;
|
||||
|
||||
/**
|
||||
* The (read-only) configuration options for this app. These are the original
|
||||
* parameters given in
|
||||
* {@link firebase#.initializeApp `firebase.initializeApp()`}.
|
||||
*
|
||||
* @example
|
||||
* var app = firebase.initializeApp(config);
|
||||
* console.log(app.options.databaseURL === config.databaseURL); // true
|
||||
*
|
||||
* @type {!Object}
|
||||
*/
|
||||
firebase.app.App.prototype.options;
|
||||
|
||||
/**
|
||||
* Renders this app unusable and frees the resources of all associated
|
||||
* services.
|
||||
*
|
||||
* @example
|
||||
* app.delete()
|
||||
* .then(function() {
|
||||
* console.log("App deleted successfully");
|
||||
* })
|
||||
* .catch(function(error) {
|
||||
* console.log("Error deleting app:", error);
|
||||
* });
|
||||
*
|
||||
* @return {!firebase.Promise<void>} An empty promise fulfilled when the app has
|
||||
* been deleted.
|
||||
*/
|
||||
firebase.app.App.prototype.delete = function() {};
|
||||
|
||||
/**
|
||||
* A Thenable is the standard interface returned by a Promise.
|
||||
*
|
||||
* @template T
|
||||
* @interface
|
||||
*/
|
||||
firebase.Thenable = function() {};
|
||||
|
||||
/**
|
||||
* Assign callback functions called when the Thenable value either
|
||||
* resolves, or is rejected.
|
||||
*
|
||||
* @param {(function(T): *)=} onResolve Called when the Thenable resolves.
|
||||
* @param {(function(!Error): *)=} onReject Called when the Thenable is rejected
|
||||
* (with an error).
|
||||
* @return {!firebase.Thenable<*>}
|
||||
*/
|
||||
firebase.Thenable.prototype.then = function(onResolve, onReject) {};
|
||||
|
||||
/**
|
||||
* Assign a callback when the Thenable rejects.
|
||||
*
|
||||
* @param {(function(!Error): *)=} onReject Called when the Thenable is rejected
|
||||
* (with an error).
|
||||
* @return {!firebase.Thenable<*>}
|
||||
*/
|
||||
firebase.Thenable.prototype.catch = function(onReject) {};
|
||||
|
||||
/**
|
||||
* A Promise represents an eventual (asynchronous) value. A Promise should
|
||||
* (eventually) either resolve or reject. When it does, it will call all the
|
||||
* callback functions that have been assigned via the <code>.then()</code> or
|
||||
* <code>.catch()</code> methods.
|
||||
*
|
||||
* <code>firebase.Promise</code> is the same as the native Promise
|
||||
* implementation when available in the current environment, otherwise it is a
|
||||
* compatible implementation of the Promise/A+ spec.
|
||||
*
|
||||
* @template T
|
||||
* @constructor
|
||||
* @implements {firebase.Thenable}
|
||||
* @param {function((function(T): void),
|
||||
* (function(!Error): void))} resolver
|
||||
*/
|
||||
firebase.Promise = function(resolver) {};
|
||||
|
||||
/**
|
||||
* Assign callback functions called when the Promise either resolves, or is
|
||||
* rejected.
|
||||
*
|
||||
* @param {(function(T): *)=} onResolve Called when the Promise resolves.
|
||||
* @param {(function(!Error): *)=} onReject Called when the Promise is rejected
|
||||
* (with an error).
|
||||
* @return {!firebase.Promise<*>}
|
||||
* @override
|
||||
*/
|
||||
firebase.Promise.prototype.then = function(onResolve, onReject) {};
|
||||
|
||||
/**
|
||||
* Assign a callback when the Promise rejects.
|
||||
*
|
||||
* @param {(function(!Error): *)=} onReject Called when the Promise is rejected
|
||||
* (with an error).
|
||||
* @override
|
||||
*/
|
||||
firebase.Promise.prototype.catch = function(onReject) {};
|
||||
|
||||
/**
|
||||
* Return a resolved Promise.
|
||||
*
|
||||
* @template T
|
||||
* @param {T=} value The value to be returned by the Promise.
|
||||
* @return {!firebase.Promise<T>}
|
||||
*/
|
||||
firebase.Promise.resolve = function(value) {};
|
||||
|
||||
/**
|
||||
* Return (an immediately) rejected Promise.
|
||||
*
|
||||
* @param {!Error} error The reason for the Promise being rejected.
|
||||
* @return {!firebase.Promise<*>}
|
||||
*/
|
||||
firebase.Promise.reject = function(error) {};
|
||||
|
||||
/**
|
||||
* Convert an array of Promises, to a single array of values.
|
||||
* <code>Promise.all()</code> resolves only after all the Promises in the array
|
||||
* have resolved.
|
||||
*
|
||||
* <code>Promise.all()</code> rejects when any of the promises in the Array have
|
||||
* rejected.
|
||||
*
|
||||
* @param {!Array<!firebase.Promise<*>>} values
|
||||
* @return {!firebase.Promise<!Array<*>>}
|
||||
*/
|
||||
firebase.Promise.all = function(values) {};
|
||||
|
||||
/**
|
||||
* @template V, E
|
||||
* @interface
|
||||
**/
|
||||
firebase.Observer = function() {};
|
||||
|
||||
/**
|
||||
* @param {?V} value
|
||||
*/
|
||||
firebase.Observer.prototype.next = function(value) {};
|
||||
|
||||
/**
|
||||
* @param {!E} error
|
||||
*/
|
||||
firebase.Observer.prototype.error = function(error) {};
|
||||
|
||||
firebase.Observer.prototype.complete = function() {};
|
||||
|
||||
/** @typedef {function(): void} */
|
||||
firebase.CompleteFn;
|
||||
|
||||
/** @typedef {function(): void} */
|
||||
firebase.Unsubscribe;
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {string} version
|
||||
* @param {?string} variant
|
||||
*/
|
||||
firebase.registerVersion = function(name, version, variant) {};
|
183
node_modules/firebase/externs/firebase-app-internal-externs.js
generated
vendored
Normal file
183
node_modules/firebase/externs/firebase-app-internal-externs.js
generated
vendored
Normal file
@ -0,0 +1,183 @@
|
||||
/**
|
||||
* @license 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Firebase namespace and Firebase App API - INTERNAL methods.
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/**
|
||||
* @param {!firebase.FirebaseComponent}
|
||||
*/
|
||||
firebase.INTERNAL.registerComponent = function(component) {};
|
||||
|
||||
/** @param {!Object} props */
|
||||
firebase.INTERNAL.extendNamespace = function(props) {};
|
||||
|
||||
firebase.INTERNAL.resetNamespace = function() {};
|
||||
|
||||
/** @typedef {function(*): void} */
|
||||
firebase.NextFn;
|
||||
|
||||
/** @typedef {function(!Error): void} */
|
||||
firebase.ErrorFn;
|
||||
|
||||
/**
|
||||
* @typedef {function((firebase.NextFn|firebase.Observer)=,
|
||||
* firebase.ErrorFn=,
|
||||
* firebase.CompleteFn=): firebase.Unsubscribe}
|
||||
*/
|
||||
firebase.Subscribe;
|
||||
|
||||
/**
|
||||
* @param {function (!firebase.Observer): void} executor
|
||||
* @param {(function (!firebase.Observer): void)=} onNoObservers
|
||||
* @return {!firebase.Subscribe}
|
||||
*/
|
||||
firebase.INTERNAL.createSubscribe = function(executor, onNoObservers) {};
|
||||
|
||||
/**
|
||||
* @param {*} target
|
||||
* @param {*} source
|
||||
*/
|
||||
firebase.INTERNAL.deepExtend = function(target, source) {};
|
||||
|
||||
/** @param {string} name */
|
||||
firebase.INTERNAL.removeApp = function(name) {};
|
||||
|
||||
/**
|
||||
* @type {!Object<string,
|
||||
* function(!firebase.app.App,
|
||||
* (function(!Object): void)=,
|
||||
* string=): firebase.Service>}
|
||||
*/
|
||||
firebase.INTERNAL.factories = {};
|
||||
|
||||
/**
|
||||
* @param {!firebase.app.App} app
|
||||
* @param {string} serviceName
|
||||
* @return {string|null}
|
||||
*/
|
||||
firebase.INTERNAL.useAsService = function(app, serviceName) {};
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {string} service All lowercase service code (e.g., 'auth')
|
||||
* @param {string} serviceName Display service name (e.g., 'Auth')
|
||||
* @param {!Object<string, string>} errors
|
||||
*/
|
||||
firebase.INTERNAL.ErrorFactory = function(service, serviceName, errors) {};
|
||||
|
||||
/**
|
||||
* @param {string} code
|
||||
* @param {Object=} data
|
||||
* @return {!firebase.FirebaseError}
|
||||
*/
|
||||
firebase.INTERNAL.ErrorFactory.prototype.create = function(code, data) {};
|
||||
|
||||
/** @interface */
|
||||
firebase.Service = function() {};
|
||||
|
||||
/** @type {!firebase.app.App} */
|
||||
firebase.Service.prototype.app;
|
||||
|
||||
/** @type {!Object} */
|
||||
firebase.Service.prototype.INTERNAL;
|
||||
|
||||
/** @return {firebase.Promise<void>} */
|
||||
firebase.Service.prototype.INTERNAL.delete = function() {};
|
||||
|
||||
/**
|
||||
* @typedef {function(!firebase.app.App,
|
||||
* !function(!Object): void,
|
||||
* string=): !firebase.Service}
|
||||
*/
|
||||
firebase.ServiceFactory;
|
||||
|
||||
/** @interface */
|
||||
firebase.ServiceNamespace = function() {};
|
||||
|
||||
/**
|
||||
* Given an (optional) app, return the instance of the service
|
||||
* associated with that app.
|
||||
*
|
||||
* @param {firebase.app.App=} app
|
||||
* @return {!firebase.Service}
|
||||
*/
|
||||
firebase.ServiceNamespace.prototype.app = function(app) {};
|
||||
|
||||
/**
|
||||
* Firebase App.INTERNAL methods - default implementations in firebase-app,
|
||||
* replaced by Auth ...
|
||||
*/
|
||||
|
||||
/**
|
||||
* Listener for an access token.
|
||||
*
|
||||
* Should pass null when the user current user is no longer value (signed
|
||||
* out or credentials become invalid).
|
||||
*
|
||||
* Firebear does not currently auto-refresh tokens, BTW - but this interface
|
||||
* would support that in the future.
|
||||
*
|
||||
* @typedef {function(?string): void}
|
||||
*/
|
||||
firebase.AuthTokenListener;
|
||||
|
||||
/**
|
||||
* Returned from app.INTERNAL.getToken().
|
||||
*
|
||||
* @typedef {{
|
||||
* accessToken: (string)
|
||||
* }}
|
||||
*/
|
||||
firebase.AuthTokenData;
|
||||
|
||||
/** @type {!Object} */
|
||||
firebase.app.App.prototype.INTERNAL;
|
||||
|
||||
/**
|
||||
* app.INTERNAL.getUid()
|
||||
*
|
||||
* @return {?string}
|
||||
*/
|
||||
firebase.app.App.prototype.INTERNAL.getUid = function() {};
|
||||
|
||||
/**
|
||||
* app.INTERNAL.getToken()
|
||||
*
|
||||
* @param {boolean=} forceRefresh Whether to force sts token refresh.
|
||||
* @return {!Promise<?firebase.AuthTokenData>}
|
||||
*/
|
||||
firebase.app.App.prototype.INTERNAL.getToken = function(forceRefresh) {};
|
||||
|
||||
/**
|
||||
* Adds an auth state listener.
|
||||
*
|
||||
* @param {!firebase.AuthTokenListener} listener The auth state listener.
|
||||
*/
|
||||
firebase.app.App.prototype.INTERNAL.addAuthTokenListener = function(
|
||||
listener
|
||||
) {};
|
||||
|
||||
/**
|
||||
* Removes an auth state listener.
|
||||
*
|
||||
* @param {!firebase.AuthTokenListener} listener The auth state listener.
|
||||
*/
|
||||
firebase.app.App.prototype.INTERNAL.removeAuthTokenListener = function(
|
||||
listener
|
||||
) {};
|
2844
node_modules/firebase/externs/firebase-auth-externs.js
generated
vendored
Normal file
2844
node_modules/firebase/externs/firebase-auth-externs.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
501
node_modules/firebase/externs/firebase-client-auth-externs.js
generated
vendored
Normal file
501
node_modules/firebase/externs/firebase-client-auth-externs.js
generated
vendored
Normal file
@ -0,0 +1,501 @@
|
||||
/**
|
||||
* @license 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Firebase client Auth API.
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/**
|
||||
* Links the authenticated provider to the user account using a pop-up based
|
||||
* OAuth flow.
|
||||
*
|
||||
* If the linking is successful, the returned result will contain the user
|
||||
* and the provider's credential.
|
||||
*
|
||||
* <h4>Error Codes</h4>
|
||||
* <dl>
|
||||
* <dt>auth/auth-domain-config-required</dt>
|
||||
* <dd>Thrown if authDomain configuration is not provided when calling
|
||||
* firebase.initializeApp(). Check Firebase Console for instructions on
|
||||
* determining and passing that field.</dd>
|
||||
* <dt>auth/cancelled-popup-request</dt>
|
||||
* <dd>Thrown if successive popup operations are triggered. Only one popup
|
||||
* request is allowed at one time on a user or an auth instance. All the
|
||||
* popups would fail with this error except for the last one.</dd>
|
||||
* <dt>auth/credential-already-in-use</dt>
|
||||
* <dd>Thrown if the account corresponding to the credential already exists
|
||||
* among your users, or is already linked to a Firebase User.
|
||||
* For example, this error could be thrown if you are upgrading an anonymous
|
||||
* user to a Google user by linking a Google credential to it and the Google
|
||||
* credential used is already associated with an existing Firebase Google
|
||||
* user.
|
||||
* An <code>error.email</code> and <code>error.credential</code>
|
||||
* ({@link firebase.auth.AuthCredential}) fields are also provided. You can
|
||||
* recover from this error by signing in with that credential directly via
|
||||
* {@link firebase.auth.Auth#signInWithCredential}.</dd>
|
||||
* <dt>auth/email-already-in-use</dt>
|
||||
* <dd>Thrown if the email corresponding to the credential already exists
|
||||
* among your users. When thrown while linking a credential to an existing
|
||||
* user, an <code>error.email</code> and <code>error.credential</code>
|
||||
* ({@link firebase.auth.AuthCredential}) fields are also provided.
|
||||
* You have to link the credential to the existing user with that email if
|
||||
* you wish to continue signing in with that credential. To do so, call
|
||||
* {@link firebase.auth.Auth#fetchProvidersForEmail}, sign in to
|
||||
* <code>error.email</code> via one of the providers returned and then
|
||||
* {@link firebase.User#linkWithCredential} the original credential to that
|
||||
* newly signed in user.</dd>
|
||||
* <dt>auth/operation-not-allowed</dt>
|
||||
* <dd>Thrown if you have not enabled the provider in the Firebase Console. Go
|
||||
* to the Firebase Console for your project, in the Auth section and the
|
||||
* <strong>Sign in Method</strong> tab and configure the provider.</dd>
|
||||
* <dt>auth/popup-blocked</dt>
|
||||
* <dt>auth/operation-not-supported-in-this-environment</dt>
|
||||
* <dd>Thrown if this operation is not supported in the environment your
|
||||
* application is running on. "location.protocol" must be http or https.
|
||||
* </dd>
|
||||
* <dd>Thrown if the popup was blocked by the browser, typically when this
|
||||
* operation is triggered outside of a click handler.</dd>
|
||||
* <dt>auth/popup-closed-by-user</dt>
|
||||
* <dd>Thrown if the popup window is closed by the user without completing the
|
||||
* sign in to the provider.</dd>
|
||||
* <dt>auth/provider-already-linked</dt>
|
||||
* <dd>Thrown if the provider has already been linked to the user. This error is
|
||||
* thrown even if this is not the same provider's account that is currently
|
||||
* linked to the user.</dd>
|
||||
* <dt>auth/unauthorized-domain</dt>
|
||||
* <dd>Thrown if the app domain is not authorized for OAuth operations for your
|
||||
* Firebase project. Edit the list of authorized domains from the Firebase
|
||||
* console.</dd>
|
||||
* </dl>
|
||||
*
|
||||
* @example
|
||||
* // Creates the provider object.
|
||||
* var provider = new firebase.auth.FacebookAuthProvider();
|
||||
* // You can add additional scopes to the provider:
|
||||
* provider.addScope('email');
|
||||
* provider.addScope('user_friends');
|
||||
* // Link with popup:
|
||||
* user.linkWithPopup(provider).then(function(result) {
|
||||
* // The firebase.User instance:
|
||||
* var user = result.user;
|
||||
* // The Facebook firebase.auth.AuthCredential containing the Facebook
|
||||
* // access token:
|
||||
* var credential = result.credential;
|
||||
* }, function(error) {
|
||||
* // An error happened.
|
||||
* });
|
||||
*
|
||||
* @param {!firebase.auth.AuthProvider} provider The provider to authenticate.
|
||||
* The provider has to be an OAuth provider. Non-OAuth providers like {@link
|
||||
* firebase.auth.EmailAuthProvider} will throw an error.
|
||||
* @return {!firebase.Promise<!firebase.auth.UserCredential>}
|
||||
*/
|
||||
firebase.User.prototype.linkWithPopup = function(provider) {};
|
||||
|
||||
/**
|
||||
* Links the authenticated provider to the user account using a full-page
|
||||
* redirect flow.
|
||||
*
|
||||
* <h4>Error Codes</h4>
|
||||
* <dl>
|
||||
* <dt>auth/auth-domain-config-required</dt>
|
||||
* <dd>Thrown if authDomain configuration is not provided when calling
|
||||
* firebase.initializeApp(). Check Firebase Console for instructions on
|
||||
* determining and passing that field.</dd>
|
||||
* <dt>auth/operation-not-supported-in-this-environment</dt>
|
||||
* <dd>Thrown if this operation is not supported in the environment your
|
||||
* application is running on. "location.protocol" must be http or https.
|
||||
* </dd>
|
||||
* <dt>auth/provider-already-linked</dt>
|
||||
* <dd>Thrown if the provider has already been linked to the user. This error is
|
||||
* thrown even if this is not the same provider's account that is currently
|
||||
* linked to the user.</dd>
|
||||
* <dt>auth/unauthorized-domain</dt>
|
||||
* <dd>Thrown if the app domain is not authorized for OAuth operations for your
|
||||
* Firebase project. Edit the list of authorized domains from the Firebase
|
||||
* console.</dd>
|
||||
* </dl>
|
||||
*
|
||||
* @param {!firebase.auth.AuthProvider} provider The provider to authenticate.
|
||||
* The provider has to be an OAuth provider. Non-OAuth providers like {@link
|
||||
* firebase.auth.EmailAuthProvider} will throw an error.
|
||||
* @return {!firebase.Promise<void>}
|
||||
*/
|
||||
firebase.User.prototype.linkWithRedirect = function(provider) {};
|
||||
|
||||
/**
|
||||
* Authenticates a Firebase client using a popup-based OAuth authentication
|
||||
* flow.
|
||||
*
|
||||
* If succeeds, returns the signed in user along with the provider's credential.
|
||||
* If sign in was unsuccessful, returns an error object containing additional
|
||||
* information about the error.
|
||||
*
|
||||
* <h4>Error Codes</h4>
|
||||
* <dl>
|
||||
* <dt>auth/account-exists-with-different-credential</dt>
|
||||
* <dd>Thrown if there already exists an account with the email address
|
||||
* asserted by the credential. Resolve this by calling
|
||||
* {@link firebase.auth.Auth#fetchProvidersForEmail} with the error.email
|
||||
* and then asking the user to sign in using one of the returned providers.
|
||||
* Once the user is signed in, the original credential retrieved from the
|
||||
* error.credential can be linked to the user with
|
||||
* {@link firebase.User#linkWithCredential} to prevent the user from signing
|
||||
* in again to the original provider via popup or redirect. If you are using
|
||||
* redirects for sign in, save the credential in session storage and then
|
||||
* retrieve on redirect and repopulate the credential using for example
|
||||
* {@link firebase.auth.GoogleAuthProvider#credential} depending on the
|
||||
* credential provider id and complete the link.</dd>
|
||||
* <dt>auth/auth-domain-config-required</dt>
|
||||
* <dd>Thrown if authDomain configuration is not provided when calling
|
||||
* firebase.initializeApp(). Check Firebase Console for instructions on
|
||||
* determining and passing that field.</dd>
|
||||
* <dt>auth/cancelled-popup-request</dt>
|
||||
* <dd>Thrown if successive popup operations are triggered. Only one popup
|
||||
* request is allowed at one time. All the popups would fail with this error
|
||||
* except for the last one.</dd>
|
||||
* <dt>auth/operation-not-allowed</dt>
|
||||
* <dd>Thrown if the type of account corresponding to the credential
|
||||
* is not enabled. Enable the account type in the Firebase Console, under
|
||||
* the Auth tab.</dd>
|
||||
* <dt>auth/operation-not-supported-in-this-environment</dt>
|
||||
* <dd>Thrown if this operation is not supported in the environment your
|
||||
* application is running on. "location.protocol" must be http or https.
|
||||
* </dd>
|
||||
* <dt>auth/popup-blocked</dt>
|
||||
* <dd>Thrown if the popup was blocked by the browser, typically when this
|
||||
* operation is triggered outside of a click handler.</dd>
|
||||
* <dt>auth/popup-closed-by-user</dt>
|
||||
* <dd>Thrown if the popup window is closed by the user without completing the
|
||||
* sign in to the provider.</dd>
|
||||
* <dt>auth/unauthorized-domain</dt>
|
||||
* <dd>Thrown if the app domain is not authorized for OAuth operations for your
|
||||
* Firebase project. Edit the list of authorized domains from the Firebase
|
||||
* console.</dd>
|
||||
* </dl>
|
||||
*
|
||||
* @example
|
||||
* // Creates the provider object.
|
||||
* var provider = new firebase.auth.FacebookAuthProvider();
|
||||
* // You can add additional scopes to the provider:
|
||||
* provider.addScope('email');
|
||||
* provider.addScope('user_friends');
|
||||
* // Sign in with popup:
|
||||
* auth.signInWithPopup(provider).then(function(result) {
|
||||
* // The firebase.User instance:
|
||||
* var user = result.user;
|
||||
* // The Facebook firebase.auth.AuthCredential containing the Facebook
|
||||
* // access token:
|
||||
* var credential = result.credential;
|
||||
* }, function(error) {
|
||||
* // The provider's account email, can be used in case of
|
||||
* // auth/account-exists-with-different-credential to fetch the providers
|
||||
* // linked to the email:
|
||||
* var email = error.email;
|
||||
* // The provider's credential:
|
||||
* var credential = error.credential;
|
||||
* // In case of auth/account-exists-with-different-credential error,
|
||||
* // you can fetch the providers using this:
|
||||
* if (error.code === 'auth/account-exists-with-different-credential') {
|
||||
* auth.fetchProvidersForEmail(email).then(function(providers) {
|
||||
* // The returned 'providers' is a list of the available providers
|
||||
* // linked to the email address. Please refer to the guide for a more
|
||||
* // complete explanation on how to recover from this error.
|
||||
* });
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* @param {!firebase.auth.AuthProvider} provider The provider to authenticate.
|
||||
* The provider has to be an OAuth provider. Non-OAuth providers like {@link
|
||||
* firebase.auth.EmailAuthProvider} will throw an error.
|
||||
* @return {!firebase.Promise<!firebase.auth.UserCredential>}
|
||||
*/
|
||||
firebase.auth.Auth.prototype.signInWithPopup = function(provider) {};
|
||||
|
||||
/**
|
||||
* Authenticates a Firebase client using a full-page redirect flow. To handle
|
||||
* the results and errors for this operation, refer to {@link
|
||||
* firebase.auth.Auth#getRedirectResult}.
|
||||
*
|
||||
* <h4>Error Codes</h4>
|
||||
* <dl>
|
||||
* <dt>auth/auth-domain-config-required</dt>
|
||||
* <dd>Thrown if authDomain configuration is not provided when calling
|
||||
* firebase.initializeApp(). Check Firebase Console for instructions on
|
||||
* determining and passing that field.</dd>
|
||||
* <dt>auth/operation-not-supported-in-this-environment</dt>
|
||||
* <dd>Thrown if this operation is not supported in the environment your
|
||||
* application is running on. "location.protocol" must be http or https.
|
||||
* </dd>
|
||||
* <dt>auth/unauthorized-domain</dt>
|
||||
* <dd>Thrown if the app domain is not authorized for OAuth operations for your
|
||||
* Firebase project. Edit the list of authorized domains from the Firebase
|
||||
* console.</dd>
|
||||
* </dl>
|
||||
*
|
||||
* @param {!firebase.auth.AuthProvider} provider The provider to authenticate.
|
||||
* The provider has to be an OAuth provider. Non-OAuth providers like {@link
|
||||
* firebase.auth.EmailAuthProvider} will throw an error.
|
||||
* @return {!firebase.Promise<void>}
|
||||
*/
|
||||
firebase.auth.Auth.prototype.signInWithRedirect = function(provider) {};
|
||||
|
||||
/**
|
||||
* Reauthenticates the current user with the specified provider using a pop-up
|
||||
* based OAuth flow.
|
||||
*
|
||||
* If the reauthentication is successful, the returned result will contain the
|
||||
* user and the provider's credential.
|
||||
*
|
||||
* <h4>Error Codes</h4>
|
||||
* <dl>
|
||||
* <dt>auth/auth-domain-config-required</dt>
|
||||
* <dd>Thrown if authDomain configuration is not provided when calling
|
||||
* firebase.initializeApp(). Check Firebase Console for instructions on
|
||||
* determining and passing that field.</dd>
|
||||
* <dt>auth/cancelled-popup-request</dt>
|
||||
* <dd>Thrown if successive popup operations are triggered. Only one popup
|
||||
* request is allowed at one time on a user or an auth instance. All the
|
||||
* popups would fail with this error except for the last one.</dd>
|
||||
* <dt>auth/user-mismatch</dt>
|
||||
* <dd>Thrown if the credential given does not correspond to the user.</dd>
|
||||
* <dt>auth/operation-not-allowed</dt>
|
||||
* <dd>Thrown if you have not enabled the provider in the Firebase Console. Go
|
||||
* to the Firebase Console for your project, in the Auth section and the
|
||||
* <strong>Sign in Method</strong> tab and configure the provider.</dd>
|
||||
* <dt>auth/popup-blocked</dt>
|
||||
* <dd>Thrown if the popup was blocked by the browser, typically when this
|
||||
* operation is triggered outside of a click handler.</dd>
|
||||
* <dt>auth/operation-not-supported-in-this-environment</dt>
|
||||
* <dd>Thrown if this operation is not supported in the environment your
|
||||
* application is running on. "location.protocol" must be http or https.
|
||||
* </dd>
|
||||
* <dt>auth/popup-closed-by-user</dt>
|
||||
* <dd>Thrown if the popup window is closed by the user without completing the
|
||||
* sign in to the provider.</dd>
|
||||
* <dt>auth/unauthorized-domain</dt>
|
||||
* <dd>Thrown if the app domain is not authorized for OAuth operations for your
|
||||
* Firebase project. Edit the list of authorized domains from the Firebase
|
||||
* console.</dd>
|
||||
* </dl>
|
||||
*
|
||||
* @example
|
||||
* // Creates the provider object.
|
||||
* var provider = new firebase.auth.FacebookAuthProvider();
|
||||
* // You can add additional scopes to the provider:
|
||||
* provider.addScope('email');
|
||||
* provider.addScope('user_friends');
|
||||
* // Reauthenticate with popup:
|
||||
* user.reauthenticateWithPopup(provider).then(function(result) {
|
||||
* // The firebase.User instance:
|
||||
* var user = result.user;
|
||||
* // The Facebook firebase.auth.AuthCredential containing the Facebook
|
||||
* // access token:
|
||||
* var credential = result.credential;
|
||||
* }, function(error) {
|
||||
* // An error happened.
|
||||
* });
|
||||
*
|
||||
* @param {!firebase.auth.AuthProvider} provider The provider to authenticate.
|
||||
* The provider has to be an OAuth provider. Non-OAuth providers like {@link
|
||||
* firebase.auth.EmailAuthProvider} will throw an error.
|
||||
* @return {!firebase.Promise<!firebase.auth.UserCredential>}
|
||||
*/
|
||||
firebase.User.prototype.reauthenticateWithPopup = function(provider) {};
|
||||
|
||||
/**
|
||||
* Reauthenticates the current user with the specified OAuth provider using a
|
||||
* full-page redirect flow.
|
||||
*
|
||||
* <h4>Error Codes</h4>
|
||||
* <dl>
|
||||
* <dt>auth/auth-domain-config-required</dt>
|
||||
* <dd>Thrown if authDomain configuration is not provided when calling
|
||||
* firebase.initializeApp(). Check Firebase Console for instructions on
|
||||
* determining and passing that field.</dd>
|
||||
* <dt>auth/operation-not-supported-in-this-environment</dt>
|
||||
* <dd>Thrown if this operation is not supported in the environment your
|
||||
* application is running on. "location.protocol" must be http or https.
|
||||
* </dd>
|
||||
* <dt>auth/user-mismatch</dt>
|
||||
* <dd>Thrown if the credential given does not correspond to the user.</dd>
|
||||
* <dt>auth/unauthorized-domain</dt>
|
||||
* <dd>Thrown if the app domain is not authorized for OAuth operations for your
|
||||
* Firebase project. Edit the list of authorized domains from the Firebase
|
||||
* console.</dd>
|
||||
* </dl>
|
||||
*
|
||||
* @param {!firebase.auth.AuthProvider} provider The provider to authenticate.
|
||||
* The provider has to be an OAuth provider. Non-OAuth providers like {@link
|
||||
* firebase.auth.EmailAuthProvider} will throw an error.
|
||||
* @return {!firebase.Promise<void>}
|
||||
*/
|
||||
firebase.User.prototype.reauthenticateWithRedirect = function(provider) {};
|
||||
|
||||
/**
|
||||
* Returns a UserCredential from the redirect-based sign-in flow.
|
||||
*
|
||||
* If sign-in succeeded, returns the signed in user. If sign-in was
|
||||
* unsuccessful, fails with an error. If no redirect operation was called,
|
||||
* returns a UserCredential with a null User.
|
||||
*
|
||||
* <h4>Error Codes</h4>
|
||||
* <dl>
|
||||
* <dt>auth/account-exists-with-different-credential</dt>
|
||||
* <dd>Thrown if there already exists an account with the email address
|
||||
* asserted by the credential. Resolve this by calling
|
||||
* {@link firebase.auth.Auth#fetchProvidersForEmail} with the error.email
|
||||
* and then asking the user to sign in using one of the returned providers.
|
||||
* Once the user is signed in, the original credential retrieved from the
|
||||
* error.credential can be linked to the user with
|
||||
* {@link firebase.User#linkWithCredential} to prevent the user from signing
|
||||
* in again to the original provider via popup or redirect. If you are using
|
||||
* redirects for sign in, save the credential in session storage and then
|
||||
* retrieve on redirect and repopulate the credential using for example
|
||||
* {@link firebase.auth.GoogleAuthProvider#credential} depending on the
|
||||
* credential provider id and complete the link.</dd>
|
||||
* <dt>auth/auth-domain-config-required</dt>
|
||||
* <dd>Thrown if authDomain configuration is not provided when calling
|
||||
* firebase.initializeApp(). Check Firebase Console for instructions on
|
||||
* determining and passing that field.</dd>
|
||||
* <dt>auth/credential-already-in-use</dt>
|
||||
* <dd>Thrown if the account corresponding to the credential already exists
|
||||
* among your users, or is already linked to a Firebase User.
|
||||
* For example, this error could be thrown if you are upgrading an anonymous
|
||||
* user to a Google user by linking a Google credential to it and the Google
|
||||
* credential used is already associated with an existing Firebase Google
|
||||
* user.
|
||||
* An <code>error.email</code> and <code>error.credential</code>
|
||||
* ({@link firebase.auth.AuthCredential}) fields are also provided. You can
|
||||
* recover from this error by signing in with that credential directly via
|
||||
* {@link firebase.auth.Auth#signInWithCredential}.</dd>
|
||||
* <dt>auth/email-already-in-use</dt>
|
||||
* <dd>Thrown if the email corresponding to the credential already exists
|
||||
* among your users. When thrown while linking a credential to an existing
|
||||
* user, an <code>error.email</code> and <code>error.credential</code>
|
||||
* ({@link firebase.auth.AuthCredential}) fields are also provided.
|
||||
* You have to link the credential to the existing user with that email if
|
||||
* you wish to continue signing in with that credential. To do so, call
|
||||
* {@link firebase.auth.Auth#fetchProvidersForEmail}, sign in to
|
||||
* <code>error.email</code> via one of the providers returned and then
|
||||
* {@link firebase.User#linkWithCredential} the original credential to that
|
||||
* newly signed in user.</dd>
|
||||
* <dt>auth/operation-not-allowed</dt>
|
||||
* <dd>Thrown if the type of account corresponding to the credential
|
||||
* is not enabled. Enable the account type in the Firebase Console, under
|
||||
* the Auth tab.</dd>
|
||||
* <dt>auth/operation-not-supported-in-this-environment</dt>
|
||||
* <dd>Thrown if this operation is not supported in the environment your
|
||||
* application is running on. "location.protocol" must be http or https.
|
||||
* </dd>
|
||||
* <dt>auth/timeout</dt>
|
||||
* <dd>Thrown typically if the app domain is not authorized for OAuth operations
|
||||
* for your Firebase project. Edit the list of authorized domains from the
|
||||
* Firebase console.</dd>
|
||||
* </dl>
|
||||
*
|
||||
* @example
|
||||
* // First, we perform the signInWithRedirect.
|
||||
* // Creates the provider object.
|
||||
* var provider = new firebase.auth.FacebookAuthProvider();
|
||||
* // You can add additional scopes to the provider:
|
||||
* provider.addScope('email');
|
||||
* provider.addScope('user_friends');
|
||||
* // Sign in with redirect:
|
||||
* auth.signInWithRedirect(provider)
|
||||
* ////////////////////////////////////////////////////////////
|
||||
* // The user is redirected to the provider's sign in flow...
|
||||
* ////////////////////////////////////////////////////////////
|
||||
* // Then redirected back to the app, where we check the redirect result:
|
||||
* auth.getRedirectResult().then(function(result) {
|
||||
* // The firebase.User instance:
|
||||
* var user = result.user;
|
||||
* // The Facebook firebase.auth.AuthCredential containing the Facebook
|
||||
* // access token:
|
||||
* var credential = result.credential;
|
||||
* // As this API can be used for sign-in, linking and reauthentication,
|
||||
* // check the operationType to determine what triggered this redirect
|
||||
* // operation.
|
||||
* var operationType = result.operationType;
|
||||
* }, function(error) {
|
||||
* // The provider's account email, can be used in case of
|
||||
* // auth/account-exists-with-different-credential to fetch the providers
|
||||
* // linked to the email:
|
||||
* var email = error.email;
|
||||
* // The provider's credential:
|
||||
* var credential = error.credential;
|
||||
* // In case of auth/account-exists-with-different-credential error,
|
||||
* // you can fetch the providers using this:
|
||||
* if (error.code === 'auth/account-exists-with-different-credential') {
|
||||
* auth.fetchProvidersForEmail(email).then(function(providers) {
|
||||
* // The returned 'providers' is a list of the available providers
|
||||
* // linked to the email address. Please refer to the guide for a more
|
||||
* // complete explanation on how to recover from this error.
|
||||
* });
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* @return {!firebase.Promise<!firebase.auth.UserCredential>}
|
||||
*/
|
||||
firebase.auth.Auth.prototype.getRedirectResult = function() {};
|
||||
|
||||
/**
|
||||
* An {@link https://www.google.com/recaptcha/ reCAPTCHA}-based application
|
||||
* verifier.
|
||||
* @param {!Element|string} container The reCAPTCHA container parameter. This
|
||||
* has different meaning depending on whether the reCAPTCHA is hidden or
|
||||
* visible. For a visible reCAPTCHA the container must be empty. If a string
|
||||
* is used, it has to correspond to an element ID. The corresponding element
|
||||
* must also must be in the DOM at the time of initialization.
|
||||
* @param {?Object=} parameters The optional reCAPTCHA parameters. Check the
|
||||
* reCAPTCHA docs for a comprehensive list. All parameters are accepted
|
||||
* except for the sitekey. Firebase Auth backend provisions a reCAPTCHA for
|
||||
* each project and will configure this upon rendering. For an invisible
|
||||
* reCAPTCHA, a size key must have the value 'invisible'.
|
||||
* @param {?firebase.app.App=} app The corresponding Firebase app. If none is
|
||||
* provided, the default Firebase App instance is used. A Firebase App
|
||||
* instance must be initialized with an API key, otherwise an error will be
|
||||
* thrown.
|
||||
* @constructor
|
||||
* @implements {firebase.auth.ApplicationVerifier}
|
||||
*/
|
||||
firebase.auth.RecaptchaVerifier = function(container, parameters, app) {};
|
||||
|
||||
/**
|
||||
* The application verifier type. For a reCAPTCHA verifier, this is 'recaptcha'.
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.auth.RecaptchaVerifier.prototype.type;
|
||||
|
||||
/**
|
||||
* Clears the reCAPTCHA widget from the page and destroys the current instance.
|
||||
*/
|
||||
firebase.auth.RecaptchaVerifier.prototype.clear = function() {};
|
||||
|
||||
/**
|
||||
* Renders the reCAPTCHA widget on the page.
|
||||
* @return {!firebase.Promise<number>} A Promise that resolves with the
|
||||
* reCAPTCHA widget ID.
|
||||
*/
|
||||
firebase.auth.RecaptchaVerifier.prototype.render = function() {};
|
||||
|
||||
/**
|
||||
* Waits for the user to solve the reCAPTCHA and resolves with the reCAPTCHA
|
||||
* token.
|
||||
* @return {!firebase.Promise<string>} A Promise for the reCAPTCHA token.
|
||||
*/
|
||||
firebase.auth.RecaptchaVerifier.prototype.verify = function() {};
|
1682
node_modules/firebase/externs/firebase-database-externs.js
generated
vendored
Normal file
1682
node_modules/firebase/externs/firebase-database-externs.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
27
node_modules/firebase/externs/firebase-database-internal-externs.js
generated
vendored
Normal file
27
node_modules/firebase/externs/firebase-database-internal-externs.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @license 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.
|
||||
*/
|
||||
/**
|
||||
* The INTERNAL interfaces to the Firebase Database service.
|
||||
* Version: ${JSCORE_VERSION}
|
||||
*
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/** @return {!firebase.Promise<void>} */
|
||||
firebase.database.Database.prototype.INTERNAL.delete = function() {};
|
||||
|
||||
/** @const {!Object} */
|
||||
firebase.database.INTERNAL;
|
73
node_modules/firebase/externs/firebase-error-externs.js
generated
vendored
Normal file
73
node_modules/firebase/externs/firebase-error-externs.js
generated
vendored
Normal file
@ -0,0 +1,73 @@
|
||||
/**
|
||||
* @license 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Firebase Error API.
|
||||
* @externs
|
||||
*/
|
||||
|
||||
//--------------------------//
|
||||
// firebase.FirebaseError //
|
||||
//--------------------------//
|
||||
|
||||
/**
|
||||
* `FirebaseError` is a subclass of the standard JavaScript `Error` object. In
|
||||
* addition to a message string and stack trace, it contains a string code.
|
||||
*
|
||||
* @interface
|
||||
*/
|
||||
firebase.FirebaseError;
|
||||
|
||||
/**
|
||||
* Error codes are strings using the following format: `"service/string-code"`.
|
||||
* Some examples include `"app/no-app"` and `"auth/user-not-found"`.
|
||||
*
|
||||
* While the message for a given error can change, the code will remain the same
|
||||
* between backward-compatible versions of the Firebase SDK.
|
||||
*
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.FirebaseError.prototype.code;
|
||||
|
||||
/**
|
||||
* An explanatory message for the error that just occurred.
|
||||
*
|
||||
* This message is designed to be helpful to you, the developer. It is not
|
||||
* intended to be displayed to the end user of your application (as it will
|
||||
* generally not convey meaningful information to them).
|
||||
*
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.FirebaseError.prototype.message;
|
||||
|
||||
/**
|
||||
* The name of the class of errors, namely `"FirebaseError"`.
|
||||
*
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.FirebaseError.prototype.name;
|
||||
|
||||
/**
|
||||
* A string value containing the execution backtrace when the error originally
|
||||
* occurred. This may not always be available.
|
||||
*
|
||||
* This information can be useful to you and can be sent to
|
||||
* {@link https://firebase.google.com/support/ Firebase Support} to help
|
||||
* explain the cause of an error.
|
||||
*
|
||||
* @type {string|undefined}
|
||||
*/
|
||||
firebase.FirebaseError.prototype.stack;
|
55
node_modules/firebase/externs/firebase-externs.js
generated
vendored
Normal file
55
node_modules/firebase/externs/firebase-externs.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* @license 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.
|
||||
*/
|
||||
// Node externs
|
||||
var process;
|
||||
/**
|
||||
* @constructor
|
||||
* @param {!string} a
|
||||
* @param {!string} b
|
||||
*/
|
||||
var Buffer = function(a, b) {};
|
||||
/**
|
||||
* @param {string=} encoding
|
||||
* @return {!string}
|
||||
*/
|
||||
Buffer.prototype.toString = function(encoding) {
|
||||
return 'dummy';
|
||||
};
|
||||
|
||||
// Browser externs
|
||||
var MozWebSocket;
|
||||
|
||||
// WinRT
|
||||
var Windows;
|
||||
|
||||
// Long-polling
|
||||
var jsonpCB;
|
||||
|
||||
//
|
||||
// CommonJS externs
|
||||
//
|
||||
|
||||
/** @const */
|
||||
var module = {};
|
||||
|
||||
/** @type {*} */
|
||||
module.exports = {};
|
||||
|
||||
/**
|
||||
* @param {string} moduleName
|
||||
* @return {*}
|
||||
*/
|
||||
var require = function(moduleName) {};
|
1374
node_modules/firebase/externs/firebase-firestore-externs.js
generated
vendored
Normal file
1374
node_modules/firebase/externs/firebase-firestore-externs.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
165
node_modules/firebase/externs/firebase-messaging-externs.js
generated
vendored
Normal file
165
node_modules/firebase/externs/firebase-messaging-externs.js
generated
vendored
Normal file
@ -0,0 +1,165 @@
|
||||
/**
|
||||
* @license 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Firebase Messaging API.
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gets the {@link firebase.messaging.Messaging `Messaging`} service for the
|
||||
* default app or a given app.
|
||||
*
|
||||
* `firebase.messaging()` can be called with no arguments to access the default
|
||||
* app's {@link firebase.messaging.Messaging `Messaging`} service or as
|
||||
* `firebase.messaging(app)` to access the
|
||||
* {@link firebase.messaging.Messaging `Messaging`} service associated with a
|
||||
* specific app.
|
||||
*
|
||||
* Calling `firebase.messaging()` in a service worker results in Firebase
|
||||
* generating notifications if the push message payload has a `notification`
|
||||
* parameter.
|
||||
*
|
||||
* @example
|
||||
* // Get the Messaging service for the default app
|
||||
* var defaultMessaging = firebase.messaging();
|
||||
*
|
||||
* @example
|
||||
* // Get the Messaging service for a given app
|
||||
* var otherMessaging = firebase.messaging(otherApp);
|
||||
*
|
||||
* @namespace
|
||||
* @param {!firebase.app.App=} app The app to create a Messaging service for.
|
||||
* If not passed, uses the default app.
|
||||
*
|
||||
* @return {!firebase.messaging.Messaging}
|
||||
*/
|
||||
firebase.messaging = function(app) {};
|
||||
|
||||
/**
|
||||
* Gets the {@link firebase.messaging.Messaging `Messaging`} service for the
|
||||
* current app.
|
||||
*
|
||||
* @example
|
||||
* var messaging = app.messaging();
|
||||
* // The above is shorthand for:
|
||||
* // var messaging = firebase.messaging(app);
|
||||
*
|
||||
* @return {!firebase.messaging.Messaging}
|
||||
*/
|
||||
firebase.app.App.prototype.messaging = function() {};
|
||||
|
||||
/**
|
||||
* The Firebase Messaging service interface.
|
||||
*
|
||||
* Do not call this constructor directly. Instead, use
|
||||
* {@link firebase.messaging `firebase.messaging()`}.
|
||||
*
|
||||
* See
|
||||
* {@link
|
||||
* https://firebase.google.com/docs/cloud-messaging/js/client
|
||||
* Set Up a JavaScript Firebase Cloud Messaging Client App}
|
||||
* for a full guide on how to use the Firebase Messaging service.
|
||||
*
|
||||
* @interface
|
||||
*/
|
||||
firebase.messaging.Messaging = function() {};
|
||||
|
||||
/**
|
||||
* Notification permissions are required to send a user push messages.
|
||||
* Calling this method displays the permission dialog to the user and
|
||||
* resolves if the permission is granted.
|
||||
*
|
||||
* @return {firebase.Promise} The promise resolves if permission is
|
||||
* granted. Otherwise, the promise is rejected with an error.
|
||||
*/
|
||||
firebase.messaging.Messaging.prototype.requestPermission = function() {};
|
||||
|
||||
/**
|
||||
* After calling `requestPermission()` you can call this method to get an FCM
|
||||
* registration token that can be used to send push messages to this user.
|
||||
*
|
||||
* @return {firebase.Promise<string>} The promise resolves if an FCM token can
|
||||
* be retrieved. This method returns null if the current origin does not have
|
||||
* permission to show notifications.
|
||||
*/
|
||||
firebase.messaging.Messaging.prototype.getToken = function() {};
|
||||
|
||||
/**
|
||||
* You should listen for token refreshes so your web app knows when FCM
|
||||
* has invalidated your existing token and you need to call `getToken()`
|
||||
* to get a new token.
|
||||
*
|
||||
* @param {!firebase.Observer<Object, void>|!function(!Object)}
|
||||
* nextOrObserver This function, or observer object with `next` defined,
|
||||
* is called when a token refresh has occurred.
|
||||
* @return {firebase.Unsubscribe} To stop listening for token
|
||||
* refresh events execute this returned function.
|
||||
*/
|
||||
firebase.messaging.Messaging.prototype.onTokenRefresh = function(
|
||||
nextOrObserver
|
||||
) {};
|
||||
|
||||
/**
|
||||
* When a push message is received and the user is currently on a page
|
||||
* for your origin, the message is passed to the page and an `onMessage()`
|
||||
* event is dispatched with the payload of the push message.
|
||||
*
|
||||
* NOTE: These events are dispatched when you have called
|
||||
* `setBackgroundMessageHandler()` in your service worker.
|
||||
*
|
||||
* @param {!firebase.Observer<Object, void>|!function(!Object)}
|
||||
* nextOrObserver This function, or observer object with `next` defined,
|
||||
* is called when a message is received and the user is currently viewing your page.
|
||||
* @return {firebase.Unsubscribe} To stop listening for messages
|
||||
* execute this returned function.
|
||||
*/
|
||||
firebase.messaging.Messaging.prototype.onMessage = function(nextOrObserver) {};
|
||||
|
||||
/**
|
||||
* To forceably stop a registration token from being used, delete it
|
||||
* by calling this method.
|
||||
*
|
||||
* @param {!string} token The token to delete.
|
||||
* @return {firebase.Promise} The promise resolves when the token has been
|
||||
* successfully deleted.
|
||||
*/
|
||||
firebase.messaging.Messaging.prototype.deleteToken = function(token) {};
|
||||
|
||||
/**
|
||||
* To use your own service worker for receiving push messages, you
|
||||
* can pass in your service worker registration in this method.
|
||||
*
|
||||
* @param {!ServiceWorkerRegistration} registration The service worker
|
||||
* registration you wish to use for push messaging.
|
||||
*/
|
||||
firebase.messaging.Messaging.prototype.useServiceWorker = function(
|
||||
registration
|
||||
) {};
|
||||
|
||||
/**
|
||||
* FCM directs push messages to your web page's `onMessage()` callback
|
||||
* if the user currently has it open. Otherwise, it calls
|
||||
* your callback passed into `setBackgroundMessageHandler()`.
|
||||
*
|
||||
* Your callback should return a promise that, once resolved, has
|
||||
* shown a notification.
|
||||
*
|
||||
* @param {!function(!Object)} callback The function to handle the push message.
|
||||
*/
|
||||
firebase.messaging.Messaging.prototype.setBackgroundMessageHandler = function(
|
||||
callback
|
||||
) {};
|
668
node_modules/firebase/externs/firebase-storage-externs.js
generated
vendored
Normal file
668
node_modules/firebase/externs/firebase-storage-externs.js
generated
vendored
Normal file
@ -0,0 +1,668 @@
|
||||
/**
|
||||
* @license 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @fileoverview Firebase Storage API.
|
||||
* @externs
|
||||
*/
|
||||
|
||||
/**
|
||||
* Gets the {@link firebase.storage.Storage `Storage`} service for the default
|
||||
* app or a given app.
|
||||
*
|
||||
* `firebase.storage()` can be called with no arguments to access the default
|
||||
* app's {@link firebase.storage.Storage `Storage`} service or as
|
||||
* `firebase.storage(app)` to access the
|
||||
* {@link firebase.storage.Storage `Storage`} service associated with a
|
||||
* specific app.
|
||||
*
|
||||
* @example
|
||||
* // Get the Storage service for the default app
|
||||
* var defaultStorage = firebase.storage();
|
||||
*
|
||||
* @example
|
||||
* // Get the Storage service for a given app
|
||||
* var otherStorage = firebase.storage(otherApp);
|
||||
*
|
||||
* @namespace
|
||||
* @param {!firebase.app.App=} app The app to create a storage service for.
|
||||
* If not passed, uses the default app.
|
||||
*
|
||||
* @return {!firebase.storage.Storage}
|
||||
*/
|
||||
firebase.storage = function(app) {};
|
||||
|
||||
/**
|
||||
* Gets the {@link firebase.storage.Storage `Storage`} service for the current
|
||||
* app, optionally initialized with a custom storage bucket.
|
||||
*
|
||||
* @example
|
||||
* var storage = app.storage();
|
||||
* // The above is shorthand for:
|
||||
* // var storage = firebase.storage(app);
|
||||
*
|
||||
* @example
|
||||
* var storage = app.storage("gs://your-app.appspot.com");
|
||||
*
|
||||
* @param {string=} url The gs:// url to your Firebase Storage Bucket.
|
||||
* If not passed, uses the app's default Storage Bucket.
|
||||
* @return {!firebase.storage.Storage}
|
||||
*/
|
||||
firebase.app.App.prototype.storage = function(url) {};
|
||||
|
||||
/**
|
||||
* The Firebase Storage service interface.
|
||||
*
|
||||
* Do not call this constructor directly. Instead, use
|
||||
* {@link firebase.storage `firebase.storage()`}.
|
||||
*
|
||||
* See
|
||||
* {@link
|
||||
* https://firebase.google.com/docs/storage/web/start/
|
||||
* Get Started on Web}
|
||||
* for a full guide on how to use the Firebase Storage service.
|
||||
*
|
||||
* @interface
|
||||
*/
|
||||
firebase.storage.Storage = function() {};
|
||||
|
||||
/**
|
||||
* The {@link firebase.app.App app} associated with the `Storage` service
|
||||
* instance.
|
||||
*
|
||||
* @example
|
||||
* var app = storage.app;
|
||||
*
|
||||
* @type {!firebase.app.App}
|
||||
*/
|
||||
firebase.storage.Storage.prototype.app;
|
||||
|
||||
/**
|
||||
* Returns a reference for the given path in the default bucket.
|
||||
* @param {string=} path A relative path to initialize the reference with,
|
||||
* for example `path/to/image.jpg`. If not passed, the returned reference
|
||||
* points to the bucket root.
|
||||
* @return {!firebase.storage.Reference} A reference for the given path.
|
||||
*/
|
||||
firebase.storage.Storage.prototype.ref = function(path) {};
|
||||
|
||||
/**
|
||||
* Returns a reference for the given absolute URL.
|
||||
* @param {string} url A URL in the form: <br />
|
||||
* 1) a gs:// URL, for example `gs://bucket/files/image.png` <br />
|
||||
* 2) a download URL taken from object metadata. <br />
|
||||
* @see {@link firebase.storage.FullMetadata.prototype.downloadURLs}
|
||||
* @return {!firebase.storage.Reference} A reference for the given URL.
|
||||
*/
|
||||
firebase.storage.Storage.prototype.refFromURL = function(url) {};
|
||||
|
||||
/**
|
||||
* The maximum time to retry operations other than uploads or downloads in
|
||||
* milliseconds.
|
||||
* @type {number}
|
||||
*/
|
||||
firebase.storage.Storage.prototype.maxOperationRetryTime;
|
||||
|
||||
/**
|
||||
* @param {number} time The new maximum operation retry time in milliseconds.
|
||||
* @see {@link firebase.storage.Storage.prototype.maxOperationRetryTime}
|
||||
*/
|
||||
firebase.storage.Storage.prototype.setMaxOperationRetryTime = function(time) {};
|
||||
|
||||
/**
|
||||
* The maximum time to retry uploads in milliseconds.
|
||||
* @type {number}
|
||||
*/
|
||||
firebase.storage.Storage.prototype.maxUploadRetryTime;
|
||||
|
||||
/**
|
||||
* @param {number} time The new maximum upload retry time in milliseconds.
|
||||
* @see {@link firebase.storage.Storage.prototype.maxUploadRetryTime}
|
||||
*/
|
||||
firebase.storage.Storage.prototype.setMaxUploadRetryTime = function(time) {};
|
||||
|
||||
/**
|
||||
* Represents a reference to a Google Cloud Storage object. Developers can
|
||||
* upload, download, and delete objects, as well as get/set object metadata.
|
||||
* @interface
|
||||
*/
|
||||
firebase.storage.Reference = function() {};
|
||||
|
||||
/**
|
||||
* Returns a gs:// URL for this object in the form
|
||||
* `gs://<bucket>/<path>/<to>/<object>`
|
||||
* @return {string} The gs:// URL.
|
||||
*/
|
||||
firebase.storage.Reference.prototype.toString = function() {};
|
||||
|
||||
/**
|
||||
* Returns a reference to a relative path from this reference.
|
||||
* @param {string} path The relative path from this reference.
|
||||
* Leading, trailing, and consecutive slashes are removed.
|
||||
* @return {!firebase.storage.Reference} The reference a the given path.
|
||||
*/
|
||||
firebase.storage.Reference.prototype.child = function(path) {};
|
||||
|
||||
/**
|
||||
* Uploads data to this reference's location.
|
||||
* @param {!Blob|!Uint8Array|!ArrayBuffer} data The data to upload.
|
||||
* @param {!firebase.storage.UploadMetadata=} metadata Metadata for the newly
|
||||
* uploaded object.
|
||||
* @return {!firebase.storage.UploadTask} An object that can be used to monitor
|
||||
* and manage the upload.
|
||||
*/
|
||||
firebase.storage.Reference.prototype.put = function(data, metadata) {};
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
* An enumeration of the possible string formats for upload.
|
||||
*/
|
||||
firebase.storage.StringFormat = {
|
||||
/**
|
||||
* Indicates the string should be interpreted "raw", that is, as normal text.
|
||||
* The string will be interpreted as UTF-16, then uploaded as a UTF-8 byte
|
||||
* sequence.
|
||||
* Example: The string 'Hello! \ud83d\ude0a' becomes the byte sequence
|
||||
* 48 65 6c 6c 6f 21 20 f0 9f 98 8a
|
||||
*/
|
||||
RAW: 'raw',
|
||||
/**
|
||||
* Indicates the string should be interpreted as base64-encoded data.
|
||||
* Padding characters (trailing '='s) are optional.
|
||||
* Example: The string 'rWmO++E6t7/rlw==' becomes the byte sequence
|
||||
* ad 69 8e fb e1 3a b7 bf eb 97
|
||||
*/
|
||||
BASE64: 'base64',
|
||||
/**
|
||||
* Indicates the string should be interpreted as base64url-encoded data.
|
||||
* Padding characters (trailing '='s) are optional.
|
||||
* Example: The string 'rWmO--E6t7_rlw==' becomes the byte sequence
|
||||
* ad 69 8e fb e1 3a b7 bf eb 97
|
||||
*/
|
||||
BASE64URL: 'base64url',
|
||||
/**
|
||||
* Indicates the string is a data URL, such as one obtained from
|
||||
* canvas.toDataURL().
|
||||
* Example: the string 'data:application/octet-stream;base64,aaaa'
|
||||
* becomes the byte sequence
|
||||
* 69 a6 9a
|
||||
* (the content-type "application/octet-stream" is also applied, but can
|
||||
* be overridden in the metadata object).
|
||||
*/
|
||||
DATA_URL: 'data_url'
|
||||
};
|
||||
|
||||
/**
|
||||
* Uploads string data to this reference's location.
|
||||
* @param {string} data The string to upload.
|
||||
* @param {!firebase.storage.StringFormat=} format The format of the string to
|
||||
* upload.
|
||||
* @param {!firebase.storage.UploadMetadata=} metadata Metadata for the newly
|
||||
* uploaded object.
|
||||
* @return {!firebase.storage.UploadTask}
|
||||
* @throws If the format is not an allowed format, or if the given string
|
||||
* doesn't conform to the specified format.
|
||||
*/
|
||||
firebase.storage.Reference.prototype.putString = function(
|
||||
data,
|
||||
format,
|
||||
metadata
|
||||
) {};
|
||||
|
||||
/**
|
||||
* Deletes the object at this reference's location.
|
||||
* @return {!firebase.Promise<void>} A Promise that resolves if the deletion
|
||||
* succeeded and rejects if it failed, including if the object didn't exist.
|
||||
*/
|
||||
firebase.storage.Reference.prototype.delete = function() {};
|
||||
|
||||
/**
|
||||
* Fetches metadata for the object at this location, if one exists.
|
||||
* @return {!firebase.Promise<firebase.storage.FullMetadata>} A Promise that
|
||||
* resolves with the metadata, or rejects if the fetch failed, including if
|
||||
* the object did not exist.
|
||||
*/
|
||||
firebase.storage.Reference.prototype.getMetadata = function() {};
|
||||
|
||||
/**
|
||||
* Updates the metadata for the object at this location, if one exists.
|
||||
* @param {!firebase.storage.SettableMetadata} metadata The new metadata.
|
||||
* Setting a property to 'null' removes it on the server, while leaving
|
||||
* a property as 'undefined' has no effect.
|
||||
* @return {!firebase.Promise<firebase.storage.FullMetadata>} A Promise that
|
||||
* resolves with the full updated metadata or rejects if the updated failed,
|
||||
* including if the object did not exist.
|
||||
*/
|
||||
firebase.storage.Reference.prototype.updateMetadata = function(metadata) {};
|
||||
|
||||
/**
|
||||
* Fetches a long lived download URL for this object.
|
||||
* @return {!firebase.Promise<string>} A Promise that resolves with the download
|
||||
* URL or rejects if the fetch failed, including if the object did not
|
||||
* exist.
|
||||
*/
|
||||
firebase.storage.Reference.prototype.getDownloadURL = function() {};
|
||||
|
||||
/**
|
||||
* A reference pointing to the parent location of this reference, or null if
|
||||
* this reference is the root.
|
||||
* @type {?firebase.storage.Reference}
|
||||
*/
|
||||
firebase.storage.Reference.prototype.parent;
|
||||
|
||||
/**
|
||||
* A reference to the root of this reference's bucket.
|
||||
* @type {!firebase.storage.Reference}
|
||||
*/
|
||||
firebase.storage.Reference.prototype.root;
|
||||
|
||||
/**
|
||||
* The name of the bucket containing this reference's object.
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.storage.Reference.prototype.bucket;
|
||||
|
||||
/**
|
||||
* The full path of this object.
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.storage.Reference.prototype.fullPath;
|
||||
|
||||
/**
|
||||
* The short name of this object, which is the last component of the full path.
|
||||
* For example, if fullPath is 'full/path/image.png', name is 'image.png'.
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.storage.Reference.prototype.name;
|
||||
|
||||
/**
|
||||
* The storage service associated with this reference.
|
||||
* @type {!firebase.storage.Storage}
|
||||
*/
|
||||
firebase.storage.Reference.prototype.storage;
|
||||
|
||||
/**
|
||||
* Object metadata that can be set at any time.
|
||||
* @interface
|
||||
*/
|
||||
firebase.storage.SettableMetadata = function() {};
|
||||
|
||||
/**
|
||||
* Served as the 'Cache-Control' header on object download.
|
||||
* @type {?string|undefined}
|
||||
*/
|
||||
firebase.storage.SettableMetadata.prototype.cacheControl;
|
||||
|
||||
/**
|
||||
* Served as the 'Content-Disposition' header on object download.
|
||||
* @type {?string|undefined}
|
||||
*/
|
||||
firebase.storage.SettableMetadata.prototype.contentDisposition;
|
||||
|
||||
/**
|
||||
* Served as the 'Content-Encoding' header on object download.
|
||||
* @type {?string|undefined}
|
||||
*/
|
||||
firebase.storage.SettableMetadata.prototype.contentEncoding;
|
||||
|
||||
/**
|
||||
* Served as the 'Content-Language' header on object download.
|
||||
* @type {?string|undefined}
|
||||
*/
|
||||
firebase.storage.SettableMetadata.prototype.contentLanguage;
|
||||
|
||||
/**
|
||||
* Served as the 'Content-Type' header on object download.
|
||||
* @type {?string|undefined}
|
||||
*/
|
||||
firebase.storage.SettableMetadata.prototype.contentType;
|
||||
|
||||
/**
|
||||
* Additional user-defined custom metadata.
|
||||
* @type {?Object<string>|undefined}
|
||||
*/
|
||||
firebase.storage.SettableMetadata.prototype.customMetadata;
|
||||
|
||||
/**
|
||||
* Object metadata that can be set at upload.
|
||||
* @interface
|
||||
* @extends {firebase.storage.SettableMetadata}
|
||||
*/
|
||||
firebase.storage.UploadMetadata = function() {};
|
||||
|
||||
/**
|
||||
* A Base64-encoded MD5 hash of the object being uploaded.
|
||||
* @type {?string|undefined}
|
||||
*/
|
||||
firebase.storage.UploadMetadata.prototype.md5Hash;
|
||||
|
||||
/**
|
||||
* The full set of object metadata, including read-only properties.
|
||||
* @interface
|
||||
* @extends {firebase.storage.UploadMetadata}
|
||||
*/
|
||||
firebase.storage.FullMetadata = function() {};
|
||||
|
||||
/**
|
||||
* The bucket this object is contained in.
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.storage.FullMetadata.prototype.bucket;
|
||||
|
||||
/**
|
||||
* The object's generation.
|
||||
* @type {string}
|
||||
* @see {@link https://cloud.google.com/storage/docs/generations-preconditions}
|
||||
*/
|
||||
firebase.storage.FullMetadata.prototype.generation;
|
||||
|
||||
/**
|
||||
* The object's metageneration.
|
||||
* @type {string}
|
||||
* @see {@link https://cloud.google.com/storage/docs/generations-preconditions}
|
||||
*/
|
||||
firebase.storage.FullMetadata.prototype.metageneration;
|
||||
|
||||
/**
|
||||
* The full path of this object.
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.storage.FullMetadata.prototype.fullPath;
|
||||
|
||||
/**
|
||||
* The short name of this object, which is the last component of the full path.
|
||||
* For example, if fullPath is 'full/path/image.png', name is 'image.png'.
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.storage.FullMetadata.prototype.name;
|
||||
|
||||
/**
|
||||
* The size of this object, in bytes.
|
||||
* @type {number}
|
||||
*/
|
||||
firebase.storage.FullMetadata.prototype.size;
|
||||
|
||||
/**
|
||||
* A date string representing when this object was created.
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.storage.FullMetadata.prototype.timeCreated;
|
||||
|
||||
/**
|
||||
* A date string representing when this object was last updated.
|
||||
* @type {string}
|
||||
*/
|
||||
firebase.storage.FullMetadata.prototype.updated;
|
||||
|
||||
/**
|
||||
* An array of long-lived download URLs. Always contains at least one URL.
|
||||
* @type {!Array<string>}
|
||||
*/
|
||||
firebase.storage.FullMetadata.prototype.downloadURLs;
|
||||
|
||||
/**
|
||||
* An event that is triggered on a task.
|
||||
* @enum {string}
|
||||
* @see {@link firebase.storage.UploadTask.prototype.on}
|
||||
*/
|
||||
firebase.storage.TaskEvent = {
|
||||
/**
|
||||
* For this event,
|
||||
* <ul>
|
||||
* <li>The `next` function is triggered on progress updates and when the
|
||||
* task is paused/resumed with a
|
||||
* {@link firebase.storage.UploadTaskSnapshot} as the first
|
||||
* argument.</li>
|
||||
* <li>The `error` function is triggered if the upload is canceled or fails
|
||||
* for another reason.</li>
|
||||
* <li>The `complete` function is triggered if the upload completes
|
||||
* successfully.</li>
|
||||
* </ul>
|
||||
*/
|
||||
STATE_CHANGED: 'state_changed'
|
||||
};
|
||||
|
||||
/**
|
||||
* Represents the current state of a running upload.
|
||||
* @enum {string}
|
||||
*/
|
||||
firebase.storage.TaskState = {
|
||||
/** Indicates that the task is still running and making progress. */
|
||||
RUNNING: 'running',
|
||||
/** Indicates that the task is paused. */
|
||||
PAUSED: 'paused',
|
||||
/** Indicates that the task completed successfully. */
|
||||
SUCCESS: 'success',
|
||||
/** Indicates that the task was canceled. */
|
||||
CANCELED: 'canceled',
|
||||
/** Indicates that the task failed for a reason other than being canceled. */
|
||||
ERROR: 'error'
|
||||
};
|
||||
|
||||
/**
|
||||
* Represents the process of uploading an object. Allows you to monitor and
|
||||
* manage the upload.
|
||||
* @interface
|
||||
*/
|
||||
firebase.storage.UploadTask = function() {};
|
||||
|
||||
/**
|
||||
* This object behaves like a Promise, and resolves with its snapshot data when
|
||||
* the upload completes.
|
||||
* @param {(?function(!firebase.storage.UploadTaskSnapshot):*)=} onFulfilled
|
||||
* The fulfillment callback. Promise chaining works as normal.
|
||||
* @param {(?function(!Error):*)=} onRejected The rejection callback.
|
||||
* @return {!firebase.Promise}
|
||||
*/
|
||||
firebase.storage.UploadTask.prototype.then = function(
|
||||
onFulfilled,
|
||||
onRejected
|
||||
) {};
|
||||
|
||||
/**
|
||||
* Equivalent to calling `then(null, onRejected)`.
|
||||
* @param {!function(!Error):*} onRejected
|
||||
* @return {!firebase.Promise}
|
||||
*/
|
||||
firebase.storage.UploadTask.prototype.catch = function(onRejected) {};
|
||||
|
||||
/**
|
||||
* Listens for events on this task.
|
||||
*
|
||||
* Events have three callback functions (referred to as `next`, `error`, and
|
||||
* `complete`).
|
||||
*
|
||||
* If only the event is passed, a function that can be used to register the
|
||||
* callbacks is returned. Otherwise, the callbacks are passed after the event.
|
||||
*
|
||||
* Callbacks can be passed either as three separate arguments <em>or</em> as the
|
||||
* `next`, `error`, and `complete` properties of an object. Any of the three
|
||||
* callbacks is optional, as long as at least one is specified. In addition,
|
||||
* when you add your callbacks, you get a function back. You can call this
|
||||
* function to unregister the associated callbacks.
|
||||
*
|
||||
* @example <caption>Pass callbacks separately or in an object.</caption>
|
||||
* var next = function(snapshot) {};
|
||||
* var error = function(error) {};
|
||||
* var complete = function() {};
|
||||
*
|
||||
* // The first example.
|
||||
* uploadTask.on(
|
||||
* firebase.storage.TaskEvent.STATE_CHANGED,
|
||||
* next,
|
||||
* error,
|
||||
* complete);
|
||||
*
|
||||
* // This is equivalent to the first example.
|
||||
* uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, {
|
||||
* 'next': next,
|
||||
* 'error': error,
|
||||
* 'complete': complete
|
||||
* });
|
||||
*
|
||||
* // This is equivalent to the first example.
|
||||
* var subscribe = uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED);
|
||||
* subscribe(next, error, complete);
|
||||
*
|
||||
* // This is equivalent to the first example.
|
||||
* var subscribe = uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED);
|
||||
* subscribe({
|
||||
* 'next': next,
|
||||
* 'error': error,
|
||||
* 'complete': complete
|
||||
* });
|
||||
*
|
||||
* @example <caption>Any callback is optional.</caption>
|
||||
* // Just listening for completion, this is legal.
|
||||
* uploadTask.on(
|
||||
* firebase.storage.TaskEvent.STATE_CHANGED,
|
||||
* null,
|
||||
* null,
|
||||
* function() {
|
||||
* console.log('upload complete!');
|
||||
* });
|
||||
*
|
||||
* // Just listening for progress/state changes, this is legal.
|
||||
* uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, function(snapshot) {
|
||||
* var percent = snapshot.bytesTransferred / snapshot.totalBytes * 100;
|
||||
* console.log(percent + "% done");
|
||||
* });
|
||||
*
|
||||
* // This is also legal.
|
||||
* uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, {
|
||||
* 'complete': function() {
|
||||
* console.log('upload complete!');
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* @example <caption>Use the returned function to remove callbacks.</caption>
|
||||
* var unsubscribe = uploadTask.on(
|
||||
* firebase.storage.TaskEvent.STATE_CHANGED,
|
||||
* function(snapshot) {
|
||||
* var percent = snapshot.bytesTransferred / snapshot.totalBytes * 100;
|
||||
* console.log(percent + "% done");
|
||||
* // Stop after receiving one update.
|
||||
* unsubscribe();
|
||||
* });
|
||||
*
|
||||
* // This code is equivalent to the above.
|
||||
* var handle = uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED);
|
||||
* unsubscribe = handle(function(snapshot) {
|
||||
* var percent = snapshot.bytesTransferred / snapshot.totalBytes * 100;
|
||||
* console.log(percent + "% done");
|
||||
* // Stop after receiving one update.
|
||||
* unsubscribe();
|
||||
* });
|
||||
*
|
||||
* @param {!firebase.storage.TaskEvent} event The event to listen for.
|
||||
* @param {(?firebase.Observer<firebase.storage.UploadTaskSnapshot,Error>|
|
||||
* ?function(!Object))=} nextOrObserver
|
||||
* The `next` function, which gets called for each item in
|
||||
* the event stream, or an observer object with some or all of these three
|
||||
* properties (`next`, `error`, `complete`).
|
||||
* @param {?function(!Error)=} error A function that gets called with an Error
|
||||
* if the event stream ends due to an error.
|
||||
* @param {?firebase.CompleteFn=} complete A function that gets called if the
|
||||
* event stream ends normally.
|
||||
* @return {
|
||||
* !firebase.Unsubscribe|
|
||||
* !function(?function(!Object),?function(!Error)=,?firebase.CompleteFn=)
|
||||
* :!firebase.Unsubscribe}
|
||||
* If only the event argument is passed, returns a function you can use to
|
||||
* add callbacks (see the examples above). If more than just the event
|
||||
* argument is passed, returns a function you can call to unregister the
|
||||
* callbacks.
|
||||
*/
|
||||
firebase.storage.UploadTask.prototype.on = function(
|
||||
event,
|
||||
nextOrObserver,
|
||||
error,
|
||||
complete
|
||||
) {};
|
||||
|
||||
/**
|
||||
* Resumes a paused task. Has no effect on a running or failed task.
|
||||
* @return {boolean} True if the resume had an effect.
|
||||
*/
|
||||
firebase.storage.UploadTask.prototype.resume = function() {};
|
||||
|
||||
/**
|
||||
* Pauses a running task. Has no effect on a paused or failed task.
|
||||
* @return {boolean} True if the pause had an effect.
|
||||
*/
|
||||
firebase.storage.UploadTask.prototype.pause = function() {};
|
||||
|
||||
/**
|
||||
* Cancels a running task. Has no effect on a complete or failed task.
|
||||
* @return {boolean} True if the cancel had an effect.
|
||||
*/
|
||||
firebase.storage.UploadTask.prototype.cancel = function() {};
|
||||
|
||||
/**
|
||||
* A snapshot of the current task state.
|
||||
* @type {!firebase.storage.UploadTaskSnapshot}
|
||||
*/
|
||||
firebase.storage.UploadTask.prototype.snapshot;
|
||||
|
||||
/**
|
||||
* Holds data about the current state of the upload task.
|
||||
* @interface
|
||||
*/
|
||||
firebase.storage.UploadTaskSnapshot = function() {};
|
||||
|
||||
/**
|
||||
* The number of bytes that have been successfully uploaded so far.
|
||||
* @type {number}
|
||||
*/
|
||||
firebase.storage.UploadTaskSnapshot.prototype.bytesTransferred;
|
||||
|
||||
/**
|
||||
* The total number of bytes to be uploaded.
|
||||
* @type {number}
|
||||
*/
|
||||
firebase.storage.UploadTaskSnapshot.prototype.totalBytes;
|
||||
|
||||
/**
|
||||
* The current state of the task.
|
||||
* @type {firebase.storage.TaskState}
|
||||
*/
|
||||
firebase.storage.UploadTaskSnapshot.prototype.state;
|
||||
|
||||
/**
|
||||
* Before the upload completes, contains the metadata sent to the server.
|
||||
* After the upload completes, contains the metadata sent back from the server.
|
||||
* @type {!firebase.storage.FullMetadata}
|
||||
*/
|
||||
firebase.storage.UploadTaskSnapshot.prototype.metadata;
|
||||
|
||||
/**
|
||||
* After the upload completes, contains a long-lived download URL for the
|
||||
* object. Also accessible in metadata.
|
||||
* @type {?string}
|
||||
*/
|
||||
firebase.storage.UploadTaskSnapshot.prototype.downloadURL;
|
||||
|
||||
/**
|
||||
* The task of which this is a snapshot.
|
||||
* @type {!firebase.storage.UploadTask}
|
||||
*/
|
||||
firebase.storage.UploadTaskSnapshot.prototype.task;
|
||||
|
||||
/**
|
||||
* The reference that spawned this snapshot's upload task.
|
||||
* @type {!firebase.storage.Reference}
|
||||
*/
|
||||
firebase.storage.UploadTaskSnapshot.prototype.ref;
|
Reference in New Issue
Block a user