@rebasepro/firebase 0.0.1-canary.2 → 0.0.1-canary.eb08332

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.
Files changed (47) hide show
  1. package/README.md +97 -3
  2. package/dist/components/FirebaseLoginView.d.ts +3 -3
  3. package/dist/components/RebaseFirebaseApp.d.ts +2 -1
  4. package/dist/components/RebaseFirebaseAppProps.d.ts +9 -13
  5. package/dist/components/social_icons.d.ts +6 -6
  6. package/dist/hooks/index.d.ts +3 -1
  7. package/dist/hooks/useAppCheck.d.ts +2 -2
  8. package/dist/hooks/useBuildUserManagement.d.ts +78 -0
  9. package/dist/hooks/useFirebaseAccessGate.d.ts +44 -0
  10. package/dist/hooks/useFirebaseAuthController.d.ts +2 -2
  11. package/dist/hooks/useFirebaseRealTimeDBDelegate.d.ts +2 -2
  12. package/dist/hooks/useFirebaseStorageSource.d.ts +1 -1
  13. package/dist/hooks/{useFirestoreDataSource.d.ts → useFirestoreDriver.d.ts} +9 -9
  14. package/dist/index.es.js +2598 -2663
  15. package/dist/index.es.js.map +1 -1
  16. package/dist/index.umd.js +2704 -2702
  17. package/dist/index.umd.js.map +1 -1
  18. package/dist/types/auth.d.ts +2 -2
  19. package/dist/types/text_search.d.ts +3 -3
  20. package/dist/utils/algolia.d.ts +7 -6
  21. package/dist/utils/collections_firestore.d.ts +4 -4
  22. package/package.json +75 -65
  23. package/src/components/FirebaseLoginView.tsx +53 -50
  24. package/src/components/RebaseFirebaseApp.tsx +82 -56
  25. package/src/components/RebaseFirebaseAppProps.tsx +10 -24
  26. package/src/components/social_icons.tsx +8 -8
  27. package/src/hooks/index.ts +3 -1
  28. package/src/hooks/useAppCheck.ts +5 -5
  29. package/src/hooks/useBuildUserManagement.tsx +366 -0
  30. package/src/hooks/useFirebaseAccessGate.tsx +145 -0
  31. package/src/hooks/useFirebaseAuthController.ts +6 -8
  32. package/src/hooks/useFirebaseRealTimeDBDelegate.ts +70 -79
  33. package/src/hooks/useFirebaseStorageSource.ts +23 -25
  34. package/src/hooks/useFirestoreDriver.ts +812 -0
  35. package/src/hooks/useInitialiseFirebase.ts +2 -2
  36. package/src/types/auth.tsx +2 -2
  37. package/src/types/text_search.ts +3 -3
  38. package/src/utils/algolia.ts +6 -9
  39. package/src/utils/collections_firestore.ts +25 -29
  40. package/src/utils/database.ts +2 -2
  41. package/src/utils/local_text_search_controller.ts +12 -12
  42. package/src/utils/pinecone.ts +3 -3
  43. package/src/utils/rebase_search_controller.ts +23 -22
  44. package/src/utils/text_search_controller.ts +2 -2
  45. package/dist/social_icons.d.ts +0 -6
  46. package/src/hooks/useFirestoreDataSource.ts +0 -796
  47. package/src/social_icons.tsx +0 -135
package/README.md CHANGED
@@ -1,4 +1,98 @@
1
- # Rebase Firebase
1
+ # @rebasepro/firebase
2
2
 
3
- This library provides a set of utilities to integrate [Rebase](https://rebase.pro) with
4
- [Firebase](https://firebase.google.com/).
3
+ Firebase client adapter for Rebase connects the Rebase admin panel to Firebase (Firestore, Auth, Storage).
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pnpm add @rebasepro/firebase
9
+ ```
10
+
11
+ **Peer dependencies:** `firebase ^10.12.2 || ^11.0.0 || ^12.0.0`, `react >= 19.0.0`, `react-dom >= 19.0.0`, `typesense ^1.8.0` (optional)
12
+
13
+ ## What This Package Does
14
+
15
+ This package provides the full Firebase integration layer for Rebase. It includes:
16
+
17
+ - A top-level `RebaseFirebaseApp` component that wires up Firebase Auth, Firestore, and Storage into a complete admin app with login, routing, and data management.
18
+ - React hooks for each Firebase service (auth, Firestore, storage, App Check, user management).
19
+ - Text search adapters (Algolia, Pinecone, Typesense, local, Rebase-hosted).
20
+ - Firebase login view with configurable sign-in providers.
21
+
22
+ ## Key Exports
23
+
24
+ ### Components
25
+
26
+ | Export | Description |
27
+ |---|---|
28
+ | `RebaseFirebaseApp` | Full-featured Rebase app component backed by Firebase. Handles init, auth, routing, and rendering |
29
+ | `RebaseFirebaseAppProps` | Props type for `RebaseFirebaseApp` — name, logo, collections, views, signInOptions, plugins, etc. |
30
+ | `FirebaseLoginView` | Standalone Firebase login view with social sign-in buttons |
31
+
32
+ ### Hooks
33
+
34
+ | Export | Description |
35
+ |---|---|
36
+ | `useInitialiseFirebase` | Initializes the Firebase app from config |
37
+ | `useFirebaseAuthController` | Manages Firebase Auth state (sign-in, sign-out, user) |
38
+ | `useFirestoreDriver` | Creates a Firestore-backed `DataDriver` for CRUD and realtime listeners |
39
+ | `useFirebaseStorageSource` | Provides file upload/download via Firebase Storage |
40
+ | `useAppCheck` | Enables Firebase App Check verification |
41
+ | `useRecaptcha` | reCAPTCHA integration for App Check |
42
+ | `useBuildUserManagement` | Builds a user/role management delegate from Firestore |
43
+ | `useFirebaseAccessGate` | Evaluates whether the current user can access the admin panel |
44
+ | `useFirebaseRealTimeDBDelegate` | Realtime Database integration |
45
+
46
+ ### Utils
47
+
48
+ | Export | Description |
49
+ |---|---|
50
+ | `buildAlgoliaSearchController` | Algolia text search adapter |
51
+ | `buildPineconeSearchController` | Pinecone text search adapter |
52
+ | `buildRebaseSearchController` | Rebase-hosted search adapter |
53
+ | `buildLocalTextSearchController` | Client-side fuzzy search (Fuse.js) |
54
+ | `buildTextSearchController` | Generic text search adapter builder |
55
+ | `buildCollectionsFromFirestore` | Auto-generate collection configs by introspecting Firestore data |
56
+
57
+ ### Types
58
+
59
+ | Export | Description |
60
+ |---|---|
61
+ | `FirebaseSignInProvider` | Provider ID strings (`google.com`, `github.com`, etc.) |
62
+ | `FirebaseSignInOption` | Sign-in config with scopes and custom parameters |
63
+ | `FirebaseAuthController` | Extended auth controller type for Firebase |
64
+ | `FirebaseUserWrapper` | Rebase user wrapper around Firebase User |
65
+ | `FirestoreTextSearchControllerBuilder` | Builder type for text search controllers |
66
+ | `AppCheckOptions` | App Check configuration type |
67
+
68
+ ## Quick Start
69
+
70
+ ```tsx
71
+ import { RebaseFirebaseApp } from "@rebasepro/firebase";
72
+
73
+ const firebaseConfig = {
74
+ apiKey: "...",
75
+ authDomain: "...",
76
+ projectId: "...",
77
+ storageBucket: "...",
78
+ };
79
+
80
+ export default function App() {
81
+ return (
82
+ <RebaseFirebaseApp
83
+ name="My Admin"
84
+ firebaseConfig={firebaseConfig}
85
+ collections={[/* your collections */]}
86
+ signInOptions={["google.com"]}
87
+ />
88
+ );
89
+ }
90
+ ```
91
+
92
+ ## Related Packages
93
+
94
+ - `@rebasepro/admin` — Admin panel UI (Scaffold, Drawer, SideDialogs)
95
+ - `@rebasepro/app` — Core framework (Rebase provider, routing)
96
+ - `@rebasepro/common` — Shared data utilities
97
+ - `@rebasepro/types` — Shared type definitions
98
+ - `@rebasepro/ui` — UI component library
@@ -54,7 +54,7 @@ export interface FirebaseLoginViewProps {
54
54
  * You may want to use it in conjunction with the `disabled` prop.
55
55
  */
56
56
  additionalComponent?: ReactNode;
57
- notAllowedError?: any;
57
+ notAllowedError?: string | Error;
58
58
  className?: string;
59
59
  }
60
60
  /**
@@ -63,10 +63,10 @@ export interface FirebaseLoginViewProps {
63
63
 
64
64
  * @category Firebase
65
65
  */
66
- export declare function FirebaseLoginView({ children, allowSkipLogin, logo, signInOptions, firebaseApp, authController, noUserComponent, disableSignupScreen, disableResetPassword, disabled, additionalComponent, notAllowedError, className }: FirebaseLoginViewProps): import("react/jsx-runtime").JSX.Element;
66
+ export declare function FirebaseLoginView({ children, allowSkipLogin, logo, signInOptions, firebaseApp, authController, noUserComponent, disableSignupScreen, disableResetPassword, disabled, additionalComponent, notAllowedError, className }: FirebaseLoginViewProps): React.JSX.Element;
67
67
  export declare function LoginButton({ icon, onClick, text, disabled }: {
68
68
  icon: React.ReactNode;
69
69
  onClick: () => void;
70
70
  text: string;
71
71
  disabled?: boolean;
72
- }): import("react/jsx-runtime").JSX.Element;
72
+ }): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { RebaseFirebaseAppProps } from "./RebaseFirebaseAppProps";
2
3
  /**
3
4
  * This is the default implementation of a Rebase app using the Firebase services
@@ -16,4 +17,4 @@ import { RebaseFirebaseAppProps } from "./RebaseFirebaseAppProps";
16
17
 
17
18
  * @category Firebase
18
19
  */
19
- export declare function RebaseFirebaseApp({ name, logo, logoDark, authenticator, collections, views, adminViews, textSearchControllerBuilder, allowSkipLogin, signInOptions, firebaseConfig, onFirebaseInit, appCheckOptions, dateTimeFormat, locale, basePath, baseCollectionPath, onAnalyticsEvent, propertyConfigs: propertyConfigsProp, plugins, autoOpenDrawer, firestoreIndexesBuilder, components, localTextSearchEnabled, userManagement }: RebaseFirebaseAppProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function RebaseFirebaseApp({ name, logo, logoDark, accessGate, collections, views, adminViews, textSearchControllerBuilder, allowSkipLogin, signInOptions, firebaseConfig, onFirebaseInit, appCheckOptions, dateTimeFormat, locale, basePath, baseCollectionPath, onAnalyticsEvent, propertyConfigs: propertyConfigsProp, plugins, autoOpenDrawer, firestoreIndexesBuilder, components, localTextSearchEnabled }: RebaseFirebaseAppProps): React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
- import { Authenticator, CMSAnalyticsEvent, CMSView, CMSViewsBuilder, EntityCollection, EntityCollectionsBuilder, RebasePlugin, Locale, PropertyConfig } from "@rebasepro/core";
3
- import { UserManagementDelegate } from "@rebasepro/types";
2
+ import { AnalyticsEvent, AppView, AppViewsBuilder, CollectionConfig, CollectionConfigsBuilder, RebasePlugin, Locale, PropertyConfig } from "@rebasepro/types";
3
+ import { FirebaseAccessGate } from "../hooks/useFirebaseAccessGate";
4
4
  import { FirebaseApp } from "@firebase/app";
5
5
  import { FirebaseLoginViewProps } from "./FirebaseLoginView";
6
6
  import { AppCheckOptions, FirebaseSignInOption, FirebaseSignInProvider, FirebaseUserWrapper, FirestoreTextSearchControllerBuilder } from "../types";
@@ -29,17 +29,17 @@ export type RebaseFirebaseAppProps = {
29
29
  * Each of the navigation entries in this field
30
30
  * generates an entry in the main menu.
31
31
  */
32
- collections?: EntityCollection[] | EntityCollectionsBuilder;
32
+ collections?: CollectionConfig[] | CollectionConfigsBuilder;
33
33
  /**
34
34
  * Custom additional views created by the developer, added to the main
35
35
  * navigation
36
36
  */
37
- views?: CMSView[] | CMSViewsBuilder;
37
+ views?: AppView[] | AppViewsBuilder;
38
38
  /**
39
39
  * Custom additional views created by the developer, added to the admin
40
40
  * navigation
41
41
  */
42
- adminViews?: CMSView[] | CMSViewsBuilder;
42
+ adminViews?: AppView[] | AppViewsBuilder;
43
43
  /**
44
44
  * Record of custom form fields to be used in the CMS.
45
45
  * You can use the key to reference the custom field in
@@ -48,12 +48,12 @@ export type RebaseFirebaseAppProps = {
48
48
  propertyConfigs?: PropertyConfig[];
49
49
  /**
50
50
  * Do the users need to log in to access the CMS.
51
- * You can specify an Authenticator function to discriminate which users can
52
- * access the CMS or not.
51
+ * You can specify a {@link FirebaseAccessGate} function to discriminate
52
+ * which users can access the CMS or not.
53
53
  * If not specified, authentication is enabled but no user restrictions
54
54
  * apply
55
55
  */
56
- authenticator?: boolean | Authenticator<FirebaseUserWrapper>;
56
+ accessGate?: boolean | FirebaseAccessGate<FirebaseUserWrapper>;
57
57
  /**
58
58
  * List of sign in options that will be displayed in the login
59
59
  * view if `authentication` is enabled. You can pass Firebase providers strings,
@@ -109,7 +109,7 @@ export type RebaseFirebaseAppProps = {
109
109
  /**
110
110
  * Callback used to get analytics events from the CMS
111
111
  */
112
- onAnalyticsEvent?: (event: CMSAnalyticsEvent, data?: object) => void;
112
+ onAnalyticsEvent?: (event: AnalyticsEvent, data?: object) => void;
113
113
  /**
114
114
  * Use plugins to modify the behaviour of the CMS.
115
115
  * Currently, in ALPHA, and likely subject to change.
@@ -127,10 +127,6 @@ export type RebaseFirebaseAppProps = {
127
127
  firestoreIndexesBuilder?: FirestoreIndexesBuilder;
128
128
  localTextSearchEnabled?: boolean;
129
129
  components?: ComponentsRegistry;
130
- /**
131
- * Delegate for user and role management. Provides the admin views if specified.
132
- */
133
- userManagement?: UserManagementDelegate;
134
130
  };
135
131
  export type ComponentsRegistry = {
136
132
  /**
@@ -1,6 +1,6 @@
1
- export declare const googleIcon: (mode: "light" | "dark") => import("react/jsx-runtime").JSX.Element;
2
- export declare const appleIcon: (mode: "light" | "dark") => import("react/jsx-runtime").JSX.Element;
3
- export declare const githubIcon: (mode: "light" | "dark") => import("react/jsx-runtime").JSX.Element;
4
- export declare const facebookIcon: (mode: "light" | "dark") => import("react/jsx-runtime").JSX.Element;
5
- export declare const microsoftIcon: (mode: "light" | "dark") => import("react/jsx-runtime").JSX.Element;
6
- export declare const twitterIcon: (mode: "light" | "dark") => import("react/jsx-runtime").JSX.Element;
1
+ export declare const googleIcon: (mode: "light" | "dark") => import("react").JSX.Element;
2
+ export declare const appleIcon: (mode: "light" | "dark") => import("react").JSX.Element;
3
+ export declare const githubIcon: (mode: "light" | "dark") => import("react").JSX.Element;
4
+ export declare const facebookIcon: (mode: "light" | "dark") => import("react").JSX.Element;
5
+ export declare const microsoftIcon: (mode: "light" | "dark") => import("react").JSX.Element;
6
+ export declare const twitterIcon: (mode: "light" | "dark") => import("react").JSX.Element;
@@ -2,6 +2,8 @@ export * from "./useFirebaseAuthController";
2
2
  export * from "./useFirebaseStorageSource";
3
3
  export * from "./useInitialiseFirebase";
4
4
  export * from "./useAppCheck";
5
- export * from "./useFirestoreDataSource";
5
+ export * from "./useFirestoreDriver";
6
6
  export * from "./useFirebaseRealTimeDBDelegate";
7
7
  export * from "./useRecaptcha";
8
+ export * from "./useBuildUserManagement";
9
+ export * from "./useFirebaseAccessGate";
@@ -10,11 +10,11 @@ export interface InitializeAppCheckProps {
10
10
  export interface InitializeAppCheckResult {
11
11
  loading: boolean;
12
12
  appCheckVerified?: boolean;
13
- error?: any;
13
+ error?: unknown;
14
14
  }
15
15
  /**
16
16
  * Function used to initialise Firebase App Check.
17
17
  *
18
18
  * @group Firebase
19
19
  */
20
- export declare function useAppCheck({ firebaseApp, options, }: InitializeAppCheckProps): InitializeAppCheckResult;
20
+ export declare function useAppCheck({ firebaseApp, options }: InitializeAppCheckProps): InitializeAppCheckResult;
@@ -0,0 +1,78 @@
1
+ import { AuthController, DataDriver, User } from "@rebasepro/types";
2
+ import { FirebaseAccessGate } from "./useFirebaseAccessGate";
3
+ export interface Role {
4
+ id: string;
5
+ name: string;
6
+ isAdmin?: boolean;
7
+ }
8
+ export interface UserManagementDelegateParams<CONTROLLER extends AuthController<User> = AuthController<User>> {
9
+ authController: CONTROLLER;
10
+ /**
11
+ * The delegate in charge of persisting the data.
12
+ */
13
+ dataSourceDelegate?: DataDriver;
14
+ /**
15
+ * Path where the plugin users configuration is stored.
16
+ * Default: __FIRECMS/config/users
17
+ * You can specify a different path if you want to store the user management configuration in a different place.
18
+ * Please keep in mind that the FireCMS users are not necessarily the same as the Firebase users (but they can be).
19
+ * The path should be relative to the root of the database, and should always have an odd number of segments.
20
+ */
21
+ usersPath?: string;
22
+ /**
23
+ * Path where the plugin roles configuration is stored.
24
+ * Default: __FIRECMS/config/roles
25
+ */
26
+ rolesPath?: string;
27
+ /**
28
+ * The roles that are available in the user management system.
29
+ * If you provide this, the user management system will not fetch the roles from the database.
30
+ */
31
+ roles?: Role[];
32
+ /**
33
+ * If there are no roles in the database, provide a button to create the default roles.
34
+ */
35
+ allowDefaultRolesCreation?: boolean;
36
+ }
37
+ /**
38
+ * This hook is used to build a user management object that can be used to
39
+ * manage users and roles in a Firestore backend.
40
+ * @param authController
41
+ * @param dataSourceDelegate
42
+ * @param usersPath
43
+ * @param rolesPath
44
+ * @param roles
45
+ * @param allowDefaultRolesCreation
46
+ */
47
+ export declare function useBuildUserManagement<CONTROLLER extends AuthController<User> = AuthController<User>, USER extends User = CONTROLLER extends AuthController<infer U> ? U : User>({ authController, dataSourceDelegate, roles: rolesProp, usersPath, rolesPath, allowDefaultRolesCreation }: UserManagementDelegateParams<CONTROLLER>): {
48
+ loading: boolean;
49
+ roles: Role[];
50
+ users: USER[];
51
+ saveUser: (user: USER) => Promise<USER>;
52
+ saveRole: (role: Role) => Promise<void>;
53
+ rolesError: Error | undefined;
54
+ deleteUser: (user: User) => Promise<void>;
55
+ deleteRole: (role: Role) => Promise<void>;
56
+ usersError: Error | undefined;
57
+ isAdmin: boolean;
58
+ allowDefaultRolesCreation: boolean;
59
+ defineRolesFor: (user: User) => string[] | undefined;
60
+ accessGate: FirebaseAccessGate<USER>;
61
+ } & CONTROLLER & {
62
+ initialLoading: boolean;
63
+ userRoles: string[] | undefined;
64
+ getUser: (uid: string) => USER | null;
65
+ user: {
66
+ roles: string[] | undefined;
67
+ uid: string;
68
+ displayName: string | null;
69
+ email: string | null;
70
+ photoURL: string | null;
71
+ providerId: string;
72
+ isAnonymous: boolean;
73
+ emailVerified?: boolean;
74
+ createdAt?: Date | string | null;
75
+ metadata?: Record<string, any>;
76
+ getIdToken?: (forceRefresh?: boolean) => Promise<string>;
77
+ } | null;
78
+ };
@@ -0,0 +1,44 @@
1
+ import { AuthController, RebaseData, StorageSource, User } from "@rebasepro/types";
2
+ /**
3
+ * Client-side gate that decides whether a Firebase-authenticated user
4
+ * is allowed to access the CMS UI.
5
+ *
6
+ * Return `true` to allow access or `false` / throw to deny.
7
+ * @group Firebase
8
+ */
9
+ export type FirebaseAccessGate<USER extends User = User> = (props: {
10
+ /**
11
+ * Logged-in user or null
12
+ */
13
+ user: USER | null;
14
+ /**
15
+ * AuthController
16
+ */
17
+ authController: AuthController<USER>;
18
+ /**
19
+ * Unified data access API
20
+ */
21
+ data: RebaseData;
22
+ /**
23
+ * Used storage implementation
24
+ */
25
+ storageSource: StorageSource;
26
+ }) => boolean | Promise<boolean>;
27
+ /**
28
+ * Hook that evaluates a {@link FirebaseAccessGate} callback after
29
+ * the user logs in and gates access to the main CMS view.
30
+ *
31
+ * @group Firebase
32
+ */
33
+ export declare function useFirebaseAccessGate<USER extends User = User>({ disabled, authController, accessGate, storageSource, data }: {
34
+ disabled?: boolean;
35
+ authController: AuthController<USER>;
36
+ accessGate?: boolean | FirebaseAccessGate<USER>;
37
+ data: RebaseData;
38
+ storageSource: StorageSource;
39
+ }): {
40
+ canAccessMainView: boolean;
41
+ authLoading: boolean;
42
+ notAllowedError: unknown;
43
+ authVerified: boolean;
44
+ };
@@ -1,12 +1,12 @@
1
1
  import { FirebaseApp } from "@firebase/app";
2
2
  import { FirebaseAuthController, FirebaseSignInOption, FirebaseSignInProvider, FirebaseUserWrapper } from "../types";
3
- import { Role, User } from "@rebasepro/core";
3
+ import type { User } from "@rebasepro/types";
4
4
  export interface FirebaseAuthControllerProps {
5
5
  loading?: boolean;
6
6
  firebaseApp?: FirebaseApp;
7
7
  signInOptions?: Array<FirebaseSignInProvider | FirebaseSignInOption>;
8
8
  onSignOut?: () => void;
9
- defineRolesFor?: (user: User) => Promise<Role[] | undefined> | Role[] | undefined;
9
+ defineRolesFor?: (user: User) => Promise<string[] | undefined> | string[] | undefined;
10
10
  }
11
11
  /**
12
12
  * Use this hook to build an {@link AuthController} based on Firebase Auth
@@ -1,5 +1,5 @@
1
1
  import { FirebaseApp } from "@firebase/app";
2
- import { DataSource } from "@rebasepro/core";
2
+ import { DataDriver } from "@rebasepro/types";
3
3
  export declare function useFirebaseRTDBDelegate({ firebaseApp }: {
4
4
  firebaseApp?: FirebaseApp;
5
- }): DataSource;
5
+ }): DataDriver;
@@ -1,5 +1,5 @@
1
1
  import { FirebaseApp } from "@firebase/app";
2
- import { StorageSource } from "@rebasepro/core";
2
+ import { StorageSource } from "@rebasepro/types";
3
3
  /**
4
4
  * @group Firebase
5
5
  */
@@ -1,11 +1,11 @@
1
- import { DataSource, EntityCollection, FilterCombination } from "@rebasepro/core";
1
+ import { DataDriver, CollectionConfig, FilterCombination } from "@rebasepro/types";
2
2
  import { Firestore } from "@firebase/firestore";
3
3
  import { FirebaseApp } from "@firebase/app";
4
4
  import { FirestoreTextSearchControllerBuilder } from "../types/text_search";
5
5
  /**
6
6
  * @group Firebase
7
7
  */
8
- export interface FirestoreDataSourceProps {
8
+ export interface FirestoreDataDriverProps {
9
9
  firebaseApp?: FirebaseApp;
10
10
  /**
11
11
  * You can use this controller to return a list of ids from a search index, given a
@@ -26,22 +26,22 @@ export interface FirestoreDataSourceProps {
26
26
  }
27
27
  export type FirestoreIndexesBuilder = (params: {
28
28
  path: string;
29
- collection: EntityCollection<any>;
29
+ collection: CollectionConfig<any>;
30
30
  }) => FilterCombination<string>[] | undefined;
31
- export type FirestoreDataSource = DataSource & {
31
+ export type FirestoreDataDriver = DataDriver & {
32
32
  initTextSearch: (props: {
33
33
  path: string;
34
34
  databaseId?: string;
35
- collection?: EntityCollection;
35
+ collection?: CollectionConfig;
36
36
  }) => Promise<boolean>;
37
37
  };
38
38
  /**
39
- * Use this hook to build a {@link DataSource} based on Firestore
39
+ * Use this hook to build a {@link DataDriver} based on Firestore
40
40
  * @param firebaseApp
41
41
  * @param textSearchControllerBuilder
42
42
  * @group Firebase
43
43
  */
44
- export declare function useFirestoreDataSource({ firebaseApp, textSearchControllerBuilder, firestoreIndexesBuilder, localTextSearchEnabled }: FirestoreDataSourceProps): FirestoreDataSource;
44
+ export declare function useFirestoreDriver({ firebaseApp, textSearchControllerBuilder, firestoreIndexesBuilder, localTextSearchEnabled }: FirestoreDataDriverProps): FirestoreDataDriver;
45
45
  /**
46
46
  * Recursive function that converts Firestore data types into CMS or plain
47
47
  * JS types.
@@ -52,5 +52,5 @@ export declare function useFirestoreDataSource({ firebaseApp, textSearchControll
52
52
  * @param data
53
53
  * @group Firestore
54
54
  */
55
- export declare function firestoreToCMSModel(data: any): any;
56
- export declare function cmsToFirestoreModel(data: any, firestore: Firestore, inArray?: boolean): any;
55
+ export declare function firestoreToCMSModel(data: unknown): unknown;
56
+ export declare function cmsToFirestoreModel(data: unknown, firestore: Firestore, inArray?: boolean): unknown;