Skip to content

Commit 16958be

Browse files
authored
Update type names in v9 API (#5137)
* update installations type * update fcm types * update perf types * update analytics types * update app types * update remote config types * Revert "update perf types" This reverts commit 4cb34ed. * change StorageService to FirebaseStorage * change StorageService to FirebaseStorage
1 parent b62b6df commit 16958be

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+229
-238
lines changed

common/api-review/analytics-exp.api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface AnalyticsCallOptions {
1717
}
1818

1919
// @public
20-
export interface AnalyticsOptions {
20+
export interface AnalyticsSettings {
2121
config?: GtagConfigParams | EventParams;
2222
}
2323

@@ -142,7 +142,7 @@ export interface GtagConfigParams {
142142
}
143143

144144
// @public
145-
export function initializeAnalytics(app: FirebaseApp, options?: AnalyticsOptions): Analytics;
145+
export function initializeAnalytics(app: FirebaseApp, options?: AnalyticsSettings): Analytics;
146146

147147
// @public
148148
export function isSupported(): Promise<boolean>;

common/api-review/app-exp.api.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@ export interface FirebaseApp {
4040
readonly options: FirebaseOptions;
4141
}
4242

43-
// @public
44-
export interface FirebaseAppConfig {
45-
automaticDataCollectionEnabled?: boolean;
46-
name?: string;
47-
}
48-
4943
// @internal (undocumented)
5044
export interface _FirebaseAppInternal extends FirebaseApp {
5145
// (undocumented)
@@ -56,6 +50,12 @@ export interface _FirebaseAppInternal extends FirebaseApp {
5650
isDeleted: boolean;
5751
}
5852

53+
// @public
54+
export interface FirebaseAppSettings {
55+
automaticDataCollectionEnabled?: boolean;
56+
name?: string;
57+
}
58+
5959
// @public
6060
export interface FirebaseOptions {
6161
apiKey?: string;
@@ -88,7 +88,7 @@ export function _getProvider<T extends Name>(app: FirebaseApp, name: T): Provide
8888
export function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;
8989

9090
// @public
91-
export function initializeApp(options: FirebaseOptions, config?: FirebaseAppConfig): FirebaseApp;
91+
export function initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp;
9292

9393
// @public
9494
export function onLog(logCallback: LogCallback | null, options?: LogOptions): void;

common/api-review/installations-exp.api.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,7 @@
77
import { FirebaseApp } from '@firebase/app-exp';
88

99
// @public
10-
export function deleteInstallations(installations: FirebaseInstallations): Promise<void>;
11-
12-
// @public
13-
export interface FirebaseInstallations {
14-
}
10+
export function deleteInstallations(installations: Installations): Promise<void>;
1511

1612
// @internal
1713
export interface _FirebaseInstallationsInternal {
@@ -20,13 +16,13 @@ export interface _FirebaseInstallationsInternal {
2016
}
2117

2218
// @public
23-
export function getId(installations: FirebaseInstallations): Promise<string>;
19+
export function getId(installations: Installations): Promise<string>;
2420

2521
// @public
26-
export function getInstallations(app?: FirebaseApp): FirebaseInstallations;
22+
export function getInstallations(app?: FirebaseApp): Installations;
2723

2824
// @public
29-
export function getToken(installations: FirebaseInstallations, forceRefresh?: boolean): Promise<string>;
25+
export function getToken(installations: Installations, forceRefresh?: boolean): Promise<string>;
3026

3127
// @public
3228
export type IdChangeCallbackFn = (installationId: string) => void;
@@ -35,7 +31,11 @@ export type IdChangeCallbackFn = (installationId: string) => void;
3531
export type IdChangeUnsubscribeFn = () => void;
3632

3733
// @public
38-
export function onIdChange(installations: FirebaseInstallations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn;
34+
export interface Installations {
35+
}
36+
37+
// @public
38+
export function onIdChange(installations: Installations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn;
3939

4040

4141
```

common/api-review/messaging-exp.api.md

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Observer } from '@firebase/util';
1010
import { Unsubscribe } from '@firebase/util';
1111

1212
// @public
13-
export function deleteToken(messaging: FirebaseMessaging): Promise<boolean>;
13+
export function deleteToken(messaging: Messaging): Promise<boolean>;
1414

1515
// @public
1616
export interface FcmOptions {
@@ -19,21 +19,14 @@ export interface FcmOptions {
1919
}
2020

2121
// @public
22-
export interface FirebaseMessaging {
23-
}
24-
25-
// @internal (undocumented)
26-
export type _FirebaseMessagingName = 'messaging';
27-
28-
// @public
29-
export function getMessaging(app?: FirebaseApp): FirebaseMessaging;
22+
export function getMessaging(app?: FirebaseApp): Messaging;
3023

3124
// @public
32-
export function getToken(messaging: FirebaseMessaging, options?: GetTokenOptions): Promise<string>;
25+
export function getToken(messaging: Messaging, options?: GetTokenOptions): Promise<string>;
3326

3427
// @public
3528
export interface GetTokenOptions {
36-
swReg?: ServiceWorkerRegistration;
29+
serviceWorkerRegistration?: ServiceWorkerRegistration;
3730
vapidKey?: string;
3831
}
3932

@@ -51,6 +44,10 @@ export interface MessagePayload {
5144
notification?: NotificationPayload;
5245
}
5346

47+
// @public
48+
export interface Messaging {
49+
}
50+
5451
export { NextFn }
5552

5653
// @public
@@ -63,7 +60,7 @@ export interface NotificationPayload {
6360
export { Observer }
6461

6562
// @public
66-
export function onMessage(messaging: FirebaseMessaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe;
63+
export function onMessage(messaging: Messaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe;
6764

6865
export { Unsubscribe }
6966

common/api-review/remote-config-exp.api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ export interface RemoteConfig {
4949
};
5050
fetchTimeMillis: number;
5151
lastFetchStatus: FetchStatus;
52-
settings: Settings;
52+
settings: RemoteConfigSettings;
5353
}
5454

5555
// @public
56-
export function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void;
57-
58-
// @public
59-
export interface Settings {
56+
export interface RemoteConfigSettings {
6057
fetchTimeoutMillis: number;
6158
minimumFetchIntervalMillis: number;
6259
}
6360

61+
// @public
62+
export function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void;
63+
6464
// @public
6565
export interface Value {
6666
asBoolean(): boolean;

common/api-review/storage.api.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { Subscribe } from '@firebase/util';
1616
import { Unsubscribe } from '@firebase/util';
1717

1818
// @public
19-
export function connectStorageEmulator(storage: StorageService, host: string, port: number): void;
19+
export function connectStorageEmulator(storage: FirebaseStorage, host: string, port: number): void;
2020

2121
// @public
2222
export function deleteObject(ref: StorageReference): Promise<void>;
@@ -36,6 +36,13 @@ export class _FbsBlob {
3636
uploadData(): Blob | Uint8Array;
3737
}
3838

39+
// @public
40+
export interface FirebaseStorage extends _FirebaseService {
41+
readonly app: FirebaseApp;
42+
maxOperationRetryTime: number;
43+
maxUploadRetryTime: number;
44+
}
45+
3946
// @public
4047
export interface FirebaseStorageError extends FirebaseError {
4148
serverResponse: string | null;
@@ -65,7 +72,7 @@ export function getDownloadURL(ref: StorageReference): Promise<string>;
6572
export function getMetadata(ref: StorageReference): Promise<FullMetadata>;
6673

6774
// @public
68-
export function getStorage(app?: FirebaseApp, bucketUrl?: string): StorageService;
75+
export function getStorage(app?: FirebaseApp, bucketUrl?: string): FirebaseStorage;
6976

7077
// @public
7178
export function list(ref: StorageReference, options?: ListOptions): Promise<ListResult>;
@@ -106,25 +113,25 @@ export class _Location {
106113
}
107114

108115
// @public
109-
export function ref(storage: StorageService, url?: string): StorageReference;
116+
export function ref(storage: FirebaseStorage, url?: string): StorageReference;
110117

111118
// @public
112-
export function ref(storageOrRef: StorageService | StorageReference, path?: string): StorageReference;
119+
export function ref(storageOrRef: FirebaseStorage | StorageReference, path?: string): StorageReference;
113120

114121
// @internal
115122
export class _Reference {
116-
// Warning: (ae-forgotten-export) The symbol "StorageService" needs to be exported by the entry point index.d.ts
117-
constructor(_service: StorageService_2, location: string | _Location);
123+
// Warning: (ae-forgotten-export) The symbol "FirebaseStorageImpl" needs to be exported by the entry point index.d.ts
124+
constructor(_service: FirebaseStorageImpl, location: string | _Location);
118125
get bucket(): string;
119126
get fullPath(): string;
120127
// (undocumented)
121128
_location: _Location;
122129
get name(): string;
123130
// (undocumented)
124-
protected _newRef(service: StorageService_2, location: _Location): _Reference;
131+
protected _newRef(service: FirebaseStorageImpl, location: _Location): _Reference;
125132
get parent(): _Reference | null;
126133
get root(): _Reference;
127-
get storage(): StorageService_2;
134+
get storage(): FirebaseStorageImpl;
128135
_throwIfRoot(name: string): void;
129136
// @override
130137
toString(): string;
@@ -159,17 +166,10 @@ export interface StorageReference {
159166
name: string;
160167
parent: StorageReference | null;
161168
root: StorageReference;
162-
storage: StorageService;
169+
storage: FirebaseStorage;
163170
toString(): string;
164171
}
165172

166-
// @public
167-
export interface StorageService extends _FirebaseService {
168-
readonly app: FirebaseApp;
169-
maxOperationRetryTime: number;
170-
maxUploadRetryTime: number;
171-
}
172-
173173
// @public
174174
export type StringFormat = string;
175175

packages-exp/analytics-exp/src/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { _getProvider, FirebaseApp, getApp } from '@firebase/app-exp';
2121
import {
2222
Analytics,
2323
AnalyticsCallOptions,
24-
AnalyticsOptions,
24+
AnalyticsSettings,
2525
CustomParams,
2626
EventNameString,
2727
EventParams
@@ -89,7 +89,7 @@ export function getAnalytics(app: FirebaseApp = getApp()): Analytics {
8989
*/
9090
export function initializeAnalytics(
9191
app: FirebaseApp,
92-
options: AnalyticsOptions = {}
92+
options: AnalyticsSettings = {}
9393
): Analytics {
9494
// Dependencies
9595
const analyticsProvider: Provider<'analytics-exp'> = _getProvider(

packages-exp/analytics-exp/src/factory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { SettingsOptions, Analytics, AnalyticsOptions } from './public-types';
18+
import { SettingsOptions, Analytics, AnalyticsSettings } from './public-types';
1919
import { Gtag, DynamicConfig, MinimalDynamicConfig } from './types';
2020
import { getOrCreateDataLayer, wrapOrCreateGtag } from './helpers';
2121
import { AnalyticsError, ERROR_FACTORY } from './errors';
@@ -177,7 +177,7 @@ function warnOnBrowserContextMismatch(): void {
177177
export function factory(
178178
app: FirebaseApp,
179179
installations: _FirebaseInstallationsInternal,
180-
options?: AnalyticsOptions
180+
options?: AnalyticsSettings
181181
): AnalyticsService {
182182
warnOnBrowserContextMismatch();
183183
const appId = app.options.appId;

packages-exp/analytics-exp/src/initialize-analytics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
} from '@firebase/util';
2828
import { ERROR_FACTORY, AnalyticsError } from './errors';
2929
import { findGtagScriptOnPage, insertScriptTag } from './helpers';
30-
import { AnalyticsOptions } from './public-types';
30+
import { AnalyticsSettings } from './public-types';
3131

3232
async function validateIndexedDB(): Promise<boolean> {
3333
if (!isIndexedDBAvailable()) {
@@ -74,7 +74,7 @@ export async function initializeAnalytics(
7474
installations: _FirebaseInstallationsInternal,
7575
gtagCore: Gtag,
7676
dataLayerName: string,
77-
options?: AnalyticsOptions
77+
options?: AnalyticsSettings
7878
): Promise<string> {
7979
const dynamicConfigPromise = fetchDynamicConfigWithRetry(app);
8080
// Once fetched, map measurementIds to appId, for ease of lookup in wrapped gtag function.

packages-exp/analytics-exp/src/public-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export interface GtagConfigParams {
102102
* Analytics initialization options.
103103
* @public
104104
*/
105-
export interface AnalyticsOptions {
105+
export interface AnalyticsSettings {
106106
/**
107107
* Params to be passed in the initial gtag config call during analytics initialization.
108108
*/

packages-exp/app-exp/src/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import {
1919
FirebaseApp,
2020
FirebaseOptions,
21-
FirebaseAppConfig
21+
FirebaseAppSettings
2222
} from './public-types';
2323
import { DEFAULT_ENTRY_NAME, PLATFORM_LOG_STRING } from './constants';
2424
import { ERROR_FACTORY, AppError } from './errors';
@@ -105,7 +105,7 @@ export function initializeApp(
105105
*/
106106
export function initializeApp(
107107
options: FirebaseOptions,
108-
config?: FirebaseAppConfig
108+
config?: FirebaseAppSettings
109109
): FirebaseApp;
110110
export function initializeApp(
111111
options: FirebaseOptions,
@@ -116,7 +116,7 @@ export function initializeApp(
116116
rawConfig = { name };
117117
}
118118

119-
const config: Required<FirebaseAppConfig> = {
119+
const config: Required<FirebaseAppSettings> = {
120120
name: DEFAULT_ENTRY_NAME,
121121
automaticDataCollectionEnabled: false,
122122
...rawConfig

packages-exp/app-exp/src/firebaseApp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import {
1919
FirebaseApp,
2020
FirebaseOptions,
21-
FirebaseAppConfig
21+
FirebaseAppSettings
2222
} from './public-types';
2323
import {
2424
ComponentContainer,
@@ -36,7 +36,7 @@ export class FirebaseAppImpl implements FirebaseApp {
3636

3737
constructor(
3838
options: FirebaseOptions,
39-
config: Required<FirebaseAppConfig>,
39+
config: Required<FirebaseAppSettings>,
4040
container: ComponentContainer
4141
) {
4242
this._options = { ...options };

packages-exp/app-exp/src/public-types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export interface FirebaseOptions {
123123
*
124124
* Configuration options given to {@link (initializeApp:1) | initializeApp()}
125125
*/
126-
export interface FirebaseAppConfig {
126+
export interface FirebaseAppSettings {
127127
/**
128128
* custom name for the Firebase App.
129129
* The default value is `"[DEFAULT]"`.

packages-exp/installations-exp/src/api/delete-installations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import { remove, update } from '../helpers/idb-manager';
2020
import { RequestStatus } from '../interfaces/installation-entry';
2121
import { ERROR_FACTORY, ErrorCode } from '../util/errors';
2222
import { FirebaseInstallationsImpl } from '../interfaces/installation-impl';
23-
import { FirebaseInstallations } from '../interfaces/public-types';
23+
import { Installations } from '../interfaces/public-types';
2424

2525
/**
2626
* Deletes the Firebase Installation and all associated data.
@@ -29,7 +29,7 @@ import { FirebaseInstallations } from '../interfaces/public-types';
2929
* @public
3030
*/
3131
export async function deleteInstallations(
32-
installations: FirebaseInstallations
32+
installations: Installations
3333
): Promise<void> {
3434
const { appConfig } = installations as FirebaseInstallationsImpl;
3535

0 commit comments

Comments
 (0)