@_henriquewilson/gabirubi-domain 1.1.16 → 1.2.0

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,6 +1,39 @@
1
- interface Timestamp {
2
- seconds: number;
3
- nanoseconds: number;
1
+ import * as _firebase_firestore from '@firebase/firestore';
2
+ import { Model } from '../model.mjs';
3
+ import { Firestore, QueryConstraint } from 'firebase/firestore';
4
+ import 'zod';
5
+
6
+ declare class FirestoreService {
7
+ private static _instance;
8
+ private static _firestore;
9
+ private _path;
10
+ private _id;
11
+ private _where;
12
+ private constructor();
13
+ /**
14
+ * Initialize singleton with Firestore instance
15
+ */
16
+ static init(firestore: Firestore): void;
17
+ /**
18
+ * Get singleton instance
19
+ */
20
+ static getInstance(): FirestoreService;
21
+ path(path: string): this;
22
+ id(id: string | number): this;
23
+ where(...where: QueryConstraint[]): this;
24
+ get<T>(): Promise<T | null>;
25
+ getAll<T>(): Promise<T[]>;
26
+ onSnapshotById<T>(callback: (doc: T | null) => void, onNotFound?: () => void): _firebase_firestore.Unsubscribe;
27
+ onSnapshot<T>(callback: (docs: T[]) => void, onNotFound?: () => void): _firebase_firestore.Unsubscribe;
28
+ add<T>(data: T): Promise<T>;
29
+ set<T>(data: T, merge?: boolean): Promise<void>;
30
+ update<T>(data: T): Promise<void>;
31
+ delete(): Promise<void>;
32
+ save<T extends Model>(data: T, merge?: boolean): Promise<T>;
33
+ private static dataToModel;
34
+ private static replaceUndefined;
35
+ private reset;
36
+ private ensureFirestore;
4
37
  }
5
38
 
6
- export { Timestamp };
39
+ export { FirestoreService };
@@ -1,6 +1,39 @@
1
- interface Timestamp {
2
- seconds: number;
3
- nanoseconds: number;
1
+ import * as _firebase_firestore from '@firebase/firestore';
2
+ import { Model } from '../model.js';
3
+ import { Firestore, QueryConstraint } from 'firebase/firestore';
4
+ import 'zod';
5
+
6
+ declare class FirestoreService {
7
+ private static _instance;
8
+ private static _firestore;
9
+ private _path;
10
+ private _id;
11
+ private _where;
12
+ private constructor();
13
+ /**
14
+ * Initialize singleton with Firestore instance
15
+ */
16
+ static init(firestore: Firestore): void;
17
+ /**
18
+ * Get singleton instance
19
+ */
20
+ static getInstance(): FirestoreService;
21
+ path(path: string): this;
22
+ id(id: string | number): this;
23
+ where(...where: QueryConstraint[]): this;
24
+ get<T>(): Promise<T | null>;
25
+ getAll<T>(): Promise<T[]>;
26
+ onSnapshotById<T>(callback: (doc: T | null) => void, onNotFound?: () => void): _firebase_firestore.Unsubscribe;
27
+ onSnapshot<T>(callback: (docs: T[]) => void, onNotFound?: () => void): _firebase_firestore.Unsubscribe;
28
+ add<T>(data: T): Promise<T>;
29
+ set<T>(data: T, merge?: boolean): Promise<void>;
30
+ update<T>(data: T): Promise<void>;
31
+ delete(): Promise<void>;
32
+ save<T extends Model>(data: T, merge?: boolean): Promise<T>;
33
+ private static dataToModel;
34
+ private static replaceUndefined;
35
+ private reset;
36
+ private ensureFirestore;
4
37
  }
5
38
 
6
- export { Timestamp };
39
+ export { FirestoreService };