Skip to content

Commit 47172f9

Browse files
authored
fix(types): enable TypeScript libCheck & resolve type conflicts (invertase#4306)
* chore: enable TypeScript libcheck & remove "dom" lib "dom" conflicts with @types/react-native * chore: add react types (referenced by admob types) * refactor(types, app): move "app" exports to top-level exports, rather than module declarations with namespace extensions * refactor(types): use top-level exports for module types, rather than declarations * refactor(types): for JSON config, augment existing `ReactNativeFirebase` namespace from /app Re-exporting the namespace causes collision issues -- tramples previous values rather than merging * fix(types, admob): Use string-indexing rather than dot-notation for referring to interface keys * fix(types, analytics): convert missing interface to `any` * fix(types, database): missing `value` type (treated as 'any') * fix(types, dynamic-links): fix dynamic-links `onLink` function type "Function" is not generic * fix(types, firestore): add missing generic to Promise type Keep current behavior with `any` * fix(types, messaging): remove parameter initializer in typedef Only allowed in implementations * fix(types, messaging): avoid implicit `any` via `void` return type for `setBackgroundMessageHandler` * fix(types, ml-vision): import non-ambient types in BarcodeDetectorTypes * fix(types, ml-vision): import non-ambient types in root module from BarcodeDetectorTypes * fix(types, ml-vision): repair invalid `extends` use by duplicating inherited key Could have Omit<>'ed the incompatible `bounds` key, but duplicating the one inherited key seemed less complex * fix(types, perf): add void return types to untyped perf methods * tests(admob): add type override to intentionally-wrong syntax Incorrect type is now caught by TS * tests(types, ml-vision): fix ml-vision test typo, exposed by proper types VisionBarcodeFormat.ALL_POINTS does not exist * chore(website): update typedoc to allow recursive types uses new syntax: TSConfigReader
1 parent 1b6ae55 commit 47172f9

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

lib/index.d.ts

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,21 +1634,17 @@ export namespace FirebaseAuthTypes {
16341634

16351635
type CallbackOrObserver<T extends (...args: any[]) => any> = T | { next: T };
16361636

1637-
declare module '@react-native-firebase/auth' {
1638-
// tslint:disable-next-line:no-duplicate-imports required otherwise doesn't work
1639-
import { ReactNativeFirebase } from '@react-native-firebase/app';
1640-
import ReactNativeFirebaseModule = ReactNativeFirebase.Module;
1641-
import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp;
1642-
1643-
const firebaseNamedExport: {} & ReactNativeFirebaseModule;
1644-
export const firebase = firebaseNamedExport;
1645-
1646-
const defaultExport: FirebaseModuleWithStaticsAndApp<
1647-
FirebaseAuthTypes.Module,
1648-
FirebaseAuthTypes.Statics
1649-
>;
1650-
export default defaultExport;
1651-
}
1637+
declare const defaultExport: ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<
1638+
FirebaseAuthTypes.Module,
1639+
FirebaseAuthTypes.Statics
1640+
>;
1641+
1642+
export const firebase: ReactNativeFirebase.Module & {
1643+
auth: typeof defaultExport;
1644+
app(name?: string): ReactNativeFirebase.FirebaseApp & { auth(): FirebaseAuthTypes.Module };
1645+
};
1646+
1647+
export default defaultExport;
16521648

16531649
/**
16541650
* Attach namespace to `firebase.` and `FirebaseApp.`.

0 commit comments

Comments
 (0)