diff --git a/packages/ml/__tests__/ml.test.ts b/packages/ml/__tests__/ml.test.ts new file mode 100644 index 0000000000..9bd48904c3 --- /dev/null +++ b/packages/ml/__tests__/ml.test.ts @@ -0,0 +1,19 @@ +import { describe, expect, it } from '@jest/globals'; + +import { firebase, getML } from '../lib'; + +describe('ml()', function () { + describe('namespace', function () { + it('accessible from firebase.app()', function () { + const app = firebase.app(); + expect(app.ml).toBeDefined(); + expect(app.ml().app).toEqual(app); + }); + }); + + describe('modular', function () { + it('`getML` function is properly exposed to end user', function () { + expect(getML).toBeDefined(); + }); + }); +}); diff --git a/packages/ml/lib/index.d.ts b/packages/ml/lib/index.d.ts index 10b57589ab..7e0f2ab999 100644 --- a/packages/ml/lib/index.d.ts +++ b/packages/ml/lib/index.d.ts @@ -73,6 +73,8 @@ export const firebase: ReactNativeFirebase.Module & { export default defaultExport; +export * from './modular'; + /** * Attach namespace to `firebase.` and `FirebaseApp.`. */ diff --git a/packages/ml/lib/modular/index.d.ts b/packages/ml/lib/modular/index.d.ts index afdcc67a32..5cc2d23f74 100644 --- a/packages/ml/lib/modular/index.d.ts +++ b/packages/ml/lib/modular/index.d.ts @@ -1,7 +1,6 @@ -import { ReactNativeFirebase } from '@react-native-firebase/app'; +import { FirebaseApp } from '@firebase/app-types'; import { FirebaseMLTypes } from '..'; -type FirebaseApp = ReactNativeFirebase.Module; type FirebaseML = FirebaseMLTypes.Module; /** diff --git a/packages/ml/lib/modular/index.js b/packages/ml/lib/modular/index.js index 26bb2a2c8e..4794dcb043 100644 --- a/packages/ml/lib/modular/index.js +++ b/packages/ml/lib/modular/index.js @@ -1,7 +1,7 @@ import { firebase } from '..'; /** - * @typedef {import('@react-native-firebase/app').ReactNativeFirebase.Module} FirebaseApp + * @typedef {import('@firebase/app').FirebaseApp} FirebaseApp * @typedef {import('..').FirebaseMLTypes.Module} FirebaseML */