@pisell/utils 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,11 @@
1
1
  import { FirebaseApp } from 'firebase/app';
2
2
  import { Auth } from 'firebase/auth';
3
- import { Database } from 'firebase/database';
3
+ import { ref, Database, goOnline, goOffline } from 'firebase/database';
4
4
  declare let firebaseApp: FirebaseApp;
5
5
  declare let auth: Auth;
6
6
  declare let database: Database;
7
7
  export declare const initFirebase: (config?: any) => void;
8
- export { database, firebaseApp, auth };
8
+ export { database, firebaseApp, auth, ref, goOnline, goOffline };
9
9
  export declare const getPath: (path: string) => string;
10
10
  export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
11
11
  export declare const signUp: (email: string, password: string) => Promise<import("firebase/auth").User>;
@@ -5,7 +5,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
5
5
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
6
  import { initializeApp } from 'firebase/app';
7
7
  import { getAuth, createUserWithEmailAndPassword, signInWithEmailAndPassword, signOut } from 'firebase/auth';
8
- import { getDatabase, ref, set, get, off, onValue, onChildChanged } from 'firebase/database';
8
+ import { getDatabase, ref, set, get, off, onValue, onChildChanged, goOnline, goOffline } from 'firebase/database';
9
9
  import { firebaseConfig } from "./config";
10
10
  import { isUndefined } from "../typeUtils";
11
11
  var isClient = typeof window != "undefined" && window.document;
@@ -30,7 +30,7 @@ if (isClient && window.__wxjs_environment !== "miniprogram" && isDefaultInit) {
30
30
  }
31
31
 
32
32
  // 导出 Firebase 配置,以便在需要时进行访问
33
- export { database, firebaseApp, auth };
33
+ export { database, firebaseApp, auth, ref, goOnline, goOffline };
34
34
 
35
35
  // 配置化 Firebase 路径
36
36
  export var getPath = function getPath(path) {
@@ -1,11 +1,11 @@
1
1
  import { FirebaseApp } from 'firebase/app';
2
2
  import { Auth } from 'firebase/auth';
3
- import { Database } from 'firebase/database';
3
+ import { ref, Database, goOnline, goOffline } from 'firebase/database';
4
4
  declare let firebaseApp: FirebaseApp;
5
5
  declare let auth: Auth;
6
6
  declare let database: Database;
7
7
  export declare const initFirebase: (config?: any) => void;
8
- export { database, firebaseApp, auth };
8
+ export { database, firebaseApp, auth, ref, goOnline, goOffline };
9
9
  export declare const getPath: (path: string) => string;
10
10
  export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
11
11
  export declare const signUp: (email: string, password: string) => Promise<import("firebase/auth").User>;
@@ -24,10 +24,13 @@ __export(firebase_exports, {
24
24
  default: () => firebase_default,
25
25
  firebaseApp: () => firebaseApp,
26
26
  getPath: () => getPath,
27
+ goOffline: () => import_database.goOffline,
28
+ goOnline: () => import_database.goOnline,
27
29
  initFirebase: () => initFirebase,
28
30
  onDataChange: () => onDataChange,
29
31
  onDataChanged: () => onDataChanged,
30
32
  readData: () => readData,
33
+ ref: () => import_database.ref,
31
34
  removeDataListener: () => removeDataListener,
32
35
  setAuthStateChangeCallback: () => setAuthStateChangeCallback,
33
36
  signInUser: () => signInUser,
@@ -139,10 +142,13 @@ var firebase_default = {
139
142
  database,
140
143
  firebaseApp,
141
144
  getPath,
145
+ goOffline,
146
+ goOnline,
142
147
  initFirebase,
143
148
  onDataChange,
144
149
  onDataChanged,
145
150
  readData,
151
+ ref,
146
152
  removeDataListener,
147
153
  setAuthStateChangeCallback,
148
154
  signInUser,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/utils",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "sideEffects": false,
5
5
  "main": "./lib/index.js",
6
6
  "module": "./es/index.js",