|
1 | 1 | /* |
2 | | - * Copyright (c) 2016-present Invertase Limited & Contributors |
3 | | - * |
4 | | - * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | | - * you may not use this library except in compliance with the License. |
6 | | - * You may obtain a copy of the License at |
7 | | - * |
8 | | - * http://www.apache.org/licenses/LICENSE-2.0 |
9 | | - * |
10 | | - * Unless required by applicable law or agreed to in writing, software |
11 | | - * distributed under the License is distributed on an "AS IS" BASIS, |
12 | | - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | | - * See the License for the specific language governing permissions and |
14 | | - * limitations under the License. |
15 | | - * |
| 2 | + * Type declarations for modules from @react-native-firebase/app |
| 3 | + * These are JavaScript modules that don't have type definitions |
16 | 4 | */ |
17 | 5 |
|
18 | | -import { ReactNativeFirebase } from '@react-native-firebase/app'; |
19 | | - |
20 | | -/** |
21 | | - * Firebase AppDistribution package for React Native. |
22 | | - * |
23 | | - * #### Example 1 |
24 | | - * |
25 | | - * Access the firebase export from the `app-distribution` package: |
26 | | - * |
27 | | - * ```js |
28 | | - * import { firebase } from '@react-native-firebase/app-distribution'; |
29 | | - * |
30 | | - * // firebase.appDistribution().X |
31 | | - * ``` |
32 | | - * |
33 | | - * #### Example 2 |
34 | | - * |
35 | | - * Using the default export from the `app-distribution` package: |
36 | | - * |
37 | | - * ```js |
38 | | - * import appDistribution from '@react-native-firebase/app-distribution'; |
39 | | - * |
40 | | - * // appDistribution().X |
41 | | - * ``` |
42 | | - * |
43 | | - * #### Example 3 |
44 | | - * |
45 | | - * Using the default export from the `app` package: |
46 | | - * |
47 | | - * ```js |
48 | | - * import firebase from '@react-native-firebase/app'; |
49 | | - * import '@react-native-firebase/app-distribution'; |
50 | | - * |
51 | | - * // firebase.appDistribution().X |
52 | | - * ``` |
53 | | - * |
54 | | - * @firebase app-distribution |
55 | | - */ |
56 | | -export namespace FirebaseAppDistributionTypes { |
57 | | - import FirebaseModule = ReactNativeFirebase.FirebaseModule; |
58 | | - |
59 | | - /** |
60 | | - * The release information returned by the update check when a new version is available. |
61 | | - */ |
62 | | - export interface AppDistributionRelease { |
63 | | - /** |
64 | | - * The short bundle version of this build (example 1.0.0). |
65 | | - */ |
66 | | - displayVersion: string; |
67 | | - |
68 | | - /** |
69 | | - * The build number of this build (example: 123). |
70 | | - */ |
71 | | - buildVersion: string; |
72 | | - |
73 | | - /** |
74 | | - * The release notes for this build, possibly null if no release notes were provided. |
75 | | - */ |
76 | | - releaseNotes: string | null; |
77 | | - |
78 | | - /** |
79 | | - * The URL for the build. |
80 | | - */ |
81 | | - downloadURL: string; |
82 | | - |
83 | | - /** |
84 | | - * Whether the download URL for this release is expired. |
85 | | - */ |
86 | | - isExpired: boolean; |
87 | | - } |
88 | | - |
89 | | - // eslint-disable-next-line @typescript-eslint/no-empty-object-type |
90 | | - export interface Statics { |
91 | | - // firebase.appDistribution.* static props go here |
92 | | - } |
93 | | - |
94 | | - /** |
95 | | - * The Firebase AppDistribution service interface. |
96 | | - * |
97 | | - * > This module is available for the default app only. |
98 | | - * |
99 | | - * #### Example |
100 | | - * |
101 | | - * Get the AppDistribution service for the default app: |
102 | | - * |
103 | | - * ```js |
104 | | - * const defaultAppAppDistribution = firebase.appDistribution(); |
105 | | - * ``` |
106 | | - */ |
107 | | - export class Module extends FirebaseModule { |
108 | | - /** |
109 | | - * Returns true if the App Distribution tester is signed in. |
110 | | - * If not an iOS device, it always rejects, as neither false nor true seem like a sensible default. |
111 | | - */ |
112 | | - isTesterSignedIn(_modularDeprecationArg?: any): Promise<boolean>; |
113 | | - |
114 | | - /** |
115 | | - * Sign-in the App Distribution tester |
116 | | - * If not an iOS device, it always rejects, as no defaults seem sensible. |
117 | | - */ |
118 | | - signInTester(_modularDeprecationArg?: any): Promise<void>; |
119 | | - |
120 | | - /** |
121 | | - * Check to see whether a new distribution is available |
122 | | - * If not an iOS device, it always rejects, as no default response seems sensible. |
123 | | - */ |
124 | | - checkForUpdate(_modularDeprecationArg?: any): Promise<AppDistributionRelease>; |
125 | | - |
126 | | - /** |
127 | | - * Sign out App Distribution tester |
128 | | - * If not an iOS device, it always rejects, as no default response seems sensible. |
129 | | - */ |
130 | | - signOutTester(_modularDeprecationArg?: any): Promise<void>; |
131 | | - } |
132 | | -} |
133 | | - |
134 | | -declare const defaultExport: ReactNativeFirebase.FirebaseModuleWithStaticsAndApp< |
135 | | - FirebaseAppDistributionTypes.Module, |
136 | | - FirebaseAppDistributionTypes.Statics |
137 | | ->; |
138 | | - |
139 | | -export const firebase: ReactNativeFirebase.Module & { |
140 | | - appDistribution: typeof defaultExport; |
141 | | - app( |
142 | | - name?: string, |
143 | | - ): ReactNativeFirebase.FirebaseApp & { appDistribution(): FirebaseAppDistributionTypes.Module }; |
144 | | -}; |
145 | | - |
146 | | -export default defaultExport; |
147 | | - |
148 | | -export * from './modular'; |
149 | | - |
150 | | -/** |
151 | | - * Attach namespace to `firebase.` and `FirebaseApp.`. |
152 | | - */ |
153 | | -declare module '@react-native-firebase/app' { |
154 | | - namespace ReactNativeFirebase { |
155 | | - import FirebaseModuleWithStaticsAndApp = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp; |
156 | | - interface Module { |
157 | | - appDistribution: FirebaseModuleWithStaticsAndApp< |
158 | | - FirebaseAppDistributionTypes.Module, |
159 | | - FirebaseAppDistributionTypes.Statics |
160 | | - >; |
161 | | - } |
162 | | - interface FirebaseApp { |
163 | | - appDistribution(): FirebaseAppDistributionTypes.Module; |
164 | | - readonly name: string; |
165 | | - } |
166 | | - } |
167 | | - |
168 | | - export function getApp(appName?: string): ReactNativeFirebase.FirebaseApp; |
169 | | -} |
170 | | - |
171 | 6 | declare module '@react-native-firebase/app/lib/common' { |
172 | | - export const MODULAR_DEPRECATION_ARG: string; |
173 | 7 | export const isIOS: boolean; |
| 8 | + export const isAndroid: boolean; |
| 9 | + export const MODULAR_DEPRECATION_ARG: any; |
174 | 10 | } |
175 | 11 |
|
176 | 12 | declare module '@react-native-firebase/app/lib/internal' { |
177 | | - export function createModuleNamespace(config: any): any; |
| 13 | + export function createModuleNamespace(options: { |
| 14 | + statics: any; |
| 15 | + version: string; |
| 16 | + namespace: string; |
| 17 | + nativeModuleName: string; |
| 18 | + nativeEvents?: boolean | string[]; |
| 19 | + hasMultiAppSupport?: boolean; |
| 20 | + hasCustomUrlOrRegionSupport?: boolean; |
| 21 | + ModuleClass: any; |
| 22 | + }): any; |
178 | 23 | export class FirebaseModule { |
179 | | - constructor(...args: any[]); |
180 | | - native: any; |
181 | 24 | app: any; |
182 | | - firebaseJson: any; |
183 | | - _customUrlOrRegion: string | null; |
| 25 | + native: any; |
| 26 | + emitter: any; |
| 27 | + constructor(app: any, config: any, customUrlOrRegion?: any); |
184 | 28 | } |
185 | 29 | export function getFirebaseRoot(): any; |
186 | 30 | } |
| 31 | + |
0 commit comments