@pisell/utils 1.0.7 → 1.0.8

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,20 @@
1
- declare const firebaseApp: import("firebase/app").FirebaseApp;
1
+ declare const firebaseApp: any;
2
2
  export { firebaseApp };
3
3
  export declare const getPath: (path: string) => string;
4
4
  export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
5
- export declare const signUp: (email: string, password: string) => Promise<import("firebase/auth").User>;
6
- export declare const signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
7
- export declare const signOutUser: () => Promise<void>;
5
+ export declare const signUp: (email: string, password: string) => Promise<any>;
6
+ export declare const signInUser: (email: string, password: string) => Promise<any>;
7
+ export declare const signOutUser: () => Promise<any>;
8
8
  export declare const readData: (path: string) => Promise<any>;
9
- export declare const writeData: (path: string, data: any) => Promise<void>;
10
- export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
9
+ export declare const writeData: (path: string, data: any) => Promise<any>;
10
+ export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => any;
11
11
  export declare const removeDataListener: (listener: any) => void;
12
+ declare const _default: {
13
+ signInUser: (email: string, password: string) => Promise<any>;
14
+ signOutUser: () => Promise<any>;
15
+ readData: (path: string) => Promise<any>;
16
+ writeData: (path: string, data: any) => Promise<any>;
17
+ onDataChange: (path: string, callback: (snapshot: any) => void) => any;
18
+ removeDataListener: (listener: any) => void;
19
+ };
20
+ export default _default;
@@ -176,4 +176,13 @@ export var onDataChange = function onDataChange(path, callback) {
176
176
  // 移除监听器
177
177
  export var removeDataListener = function removeDataListener(listener) {
178
178
  off(listener); // 移除监听器
179
+ };
180
+
181
+ export default {
182
+ signInUser: signInUser,
183
+ signOutUser: signOutUser,
184
+ readData: readData,
185
+ writeData: writeData,
186
+ onDataChange: onDataChange,
187
+ removeDataListener: removeDataListener
179
188
  };
package/es/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export * from './document';
4
4
  export * from './date';
5
5
  export * from './platform';
6
6
  export * from './log';
7
+ export { default as firebase } from './firebase';
package/es/index.js CHANGED
@@ -3,4 +3,5 @@ export * from "./typeUtils";
3
3
  export * from "./document";
4
4
  export * from "./date";
5
5
  export * from "./platform";
6
- export * from "./log";
6
+ export * from "./log";
7
+ export { default as firebase } from "./firebase";
@@ -1,11 +1,20 @@
1
- declare const firebaseApp: import("firebase/app").FirebaseApp;
1
+ declare const firebaseApp: any;
2
2
  export { firebaseApp };
3
3
  export declare const getPath: (path: string) => string;
4
4
  export declare const setAuthStateChangeCallback: (callback: (user: any) => void) => void;
5
- export declare const signUp: (email: string, password: string) => Promise<import("firebase/auth").User>;
6
- export declare const signInUser: (email: string, password: string) => Promise<import("firebase/auth").User>;
7
- export declare const signOutUser: () => Promise<void>;
5
+ export declare const signUp: (email: string, password: string) => Promise<any>;
6
+ export declare const signInUser: (email: string, password: string) => Promise<any>;
7
+ export declare const signOutUser: () => Promise<any>;
8
8
  export declare const readData: (path: string) => Promise<any>;
9
- export declare const writeData: (path: string, data: any) => Promise<void>;
10
- export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => import("firebase/database").Unsubscribe;
9
+ export declare const writeData: (path: string, data: any) => Promise<any>;
10
+ export declare const onDataChange: (path: string, callback: (snapshot: any) => void) => any;
11
11
  export declare const removeDataListener: (listener: any) => void;
12
+ declare const _default: {
13
+ signInUser: (email: string, password: string) => Promise<any>;
14
+ signOutUser: () => Promise<any>;
15
+ readData: (path: string) => Promise<any>;
16
+ writeData: (path: string, data: any) => Promise<any>;
17
+ onDataChange: (path: string, callback: (snapshot: any) => void) => any;
18
+ removeDataListener: (listener: any) => void;
19
+ };
20
+ export default _default;
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/firebase/index.ts
30
30
  var firebase_exports = {};
31
31
  __export(firebase_exports, {
32
+ default: () => firebase_default,
32
33
  firebaseApp: () => firebaseApp,
33
34
  getPath: () => getPath,
34
35
  onDataChange: () => onDataChange,
@@ -113,6 +114,14 @@ var onDataChange = (path, callback) => {
113
114
  var removeDataListener = (listener) => {
114
115
  (0, import_database.off)(listener);
115
116
  };
117
+ var firebase_default = {
118
+ signInUser,
119
+ signOutUser,
120
+ readData,
121
+ writeData,
122
+ onDataChange,
123
+ removeDataListener
124
+ };
116
125
  // Annotate the CommonJS export names for ESM import in node:
117
126
  0 && (module.exports = {
118
127
  firebaseApp,
package/lib/index.d.ts CHANGED
@@ -4,3 +4,4 @@ export * from './document';
4
4
  export * from './date';
5
5
  export * from './platform';
6
6
  export * from './log';
7
+ export { default as firebase } from './firebase';
package/lib/index.js CHANGED
@@ -1,7 +1,13 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
5
11
  var __copyProps = (to, from, except, desc) => {
6
12
  if (from && typeof from === "object" || typeof from === "function") {
7
13
  for (let key of __getOwnPropNames(from))
@@ -11,10 +17,21 @@ var __copyProps = (to, from, except, desc) => {
11
17
  return to;
12
18
  };
13
19
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
14
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
29
 
16
30
  // src/index.ts
17
31
  var src_exports = {};
32
+ __export(src_exports, {
33
+ firebase: () => import_firebase.default
34
+ });
18
35
  module.exports = __toCommonJS(src_exports);
19
36
  __reExport(src_exports, require("./otherUtils"), module.exports);
20
37
  __reExport(src_exports, require("./typeUtils"), module.exports);
@@ -22,8 +39,10 @@ __reExport(src_exports, require("./document"), module.exports);
22
39
  __reExport(src_exports, require("./date"), module.exports);
23
40
  __reExport(src_exports, require("./platform"), module.exports);
24
41
  __reExport(src_exports, require("./log"), module.exports);
42
+ var import_firebase = __toESM(require("./firebase"));
25
43
  // Annotate the CommonJS export names for ESM import in node:
26
44
  0 && (module.exports = {
45
+ firebase,
27
46
  ...require("./otherUtils"),
28
47
  ...require("./typeUtils"),
29
48
  ...require("./document"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/utils",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",