Skip to content

Update type names in v9 API #5137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/api-review/analytics-exp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface AnalyticsCallOptions {
}

// @public
export interface AnalyticsOptions {
export interface AnalyticsSettings {
config?: GtagConfigParams | EventParams;
}

Expand Down Expand Up @@ -142,7 +142,7 @@ export interface GtagConfigParams {
}

// @public
export function initializeAnalytics(app: FirebaseApp, options?: AnalyticsOptions): Analytics;
export function initializeAnalytics(app: FirebaseApp, options?: AnalyticsSettings): Analytics;

// @public
export function isSupported(): Promise<boolean>;
Expand Down
14 changes: 7 additions & 7 deletions common/api-review/app-exp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ export interface FirebaseApp {
readonly options: FirebaseOptions;
}

// @public
export interface FirebaseAppConfig {
automaticDataCollectionEnabled?: boolean;
name?: string;
}

// @internal (undocumented)
export interface _FirebaseAppInternal extends FirebaseApp {
// (undocumented)
Expand All @@ -56,6 +50,12 @@ export interface _FirebaseAppInternal extends FirebaseApp {
isDeleted: boolean;
}

// @public
export interface FirebaseAppSettings {
automaticDataCollectionEnabled?: boolean;
name?: string;
}

// @public
export interface FirebaseOptions {
apiKey?: string;
Expand Down Expand Up @@ -88,7 +88,7 @@ export function _getProvider<T extends Name>(app: FirebaseApp, name: T): Provide
export function initializeApp(options: FirebaseOptions, name?: string): FirebaseApp;

// @public
export function initializeApp(options: FirebaseOptions, config?: FirebaseAppConfig): FirebaseApp;
export function initializeApp(options: FirebaseOptions, config?: FirebaseAppSettings): FirebaseApp;

// @public
export function onLog(logCallback: LogCallback | null, options?: LogOptions): void;
Expand Down
18 changes: 9 additions & 9 deletions common/api-review/installations-exp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@
import { FirebaseApp } from '@firebase/app-exp';

// @public
export function deleteInstallations(installations: FirebaseInstallations): Promise<void>;

// @public
export interface FirebaseInstallations {
}
export function deleteInstallations(installations: Installations): Promise<void>;

// @internal
export interface _FirebaseInstallationsInternal {
Expand All @@ -20,13 +16,13 @@ export interface _FirebaseInstallationsInternal {
}

// @public
export function getId(installations: FirebaseInstallations): Promise<string>;
export function getId(installations: Installations): Promise<string>;

// @public
export function getInstallations(app?: FirebaseApp): FirebaseInstallations;
export function getInstallations(app?: FirebaseApp): Installations;

// @public
export function getToken(installations: FirebaseInstallations, forceRefresh?: boolean): Promise<string>;
export function getToken(installations: Installations, forceRefresh?: boolean): Promise<string>;

// @public
export type IdChangeCallbackFn = (installationId: string) => void;
Expand All @@ -35,7 +31,11 @@ export type IdChangeCallbackFn = (installationId: string) => void;
export type IdChangeUnsubscribeFn = () => void;

// @public
export function onIdChange(installations: FirebaseInstallations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn;
export interface Installations {
}

// @public
export function onIdChange(installations: Installations, callback: IdChangeCallbackFn): IdChangeUnsubscribeFn;


```
21 changes: 9 additions & 12 deletions common/api-review/messaging-exp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { Observer } from '@firebase/util';
import { Unsubscribe } from '@firebase/util';

// @public
export function deleteToken(messaging: FirebaseMessaging): Promise<boolean>;
export function deleteToken(messaging: Messaging): Promise<boolean>;

// @public
export interface FcmOptions {
Expand All @@ -19,21 +19,14 @@ export interface FcmOptions {
}

// @public
export interface FirebaseMessaging {
}

// @internal (undocumented)
export type _FirebaseMessagingName = 'messaging';

// @public
export function getMessaging(app?: FirebaseApp): FirebaseMessaging;
export function getMessaging(app?: FirebaseApp): Messaging;

// @public
export function getToken(messaging: FirebaseMessaging, options?: GetTokenOptions): Promise<string>;
export function getToken(messaging: Messaging, options?: GetTokenOptions): Promise<string>;

// @public
export interface GetTokenOptions {
swReg?: ServiceWorkerRegistration;
serviceWorkerRegistration?: ServiceWorkerRegistration;
vapidKey?: string;
}

Expand All @@ -51,6 +44,10 @@ export interface MessagePayload {
notification?: NotificationPayload;
}

// @public
export interface Messaging {
}

export { NextFn }

// @public
Expand All @@ -63,7 +60,7 @@ export interface NotificationPayload {
export { Observer }

// @public
export function onMessage(messaging: FirebaseMessaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe;
export function onMessage(messaging: Messaging, nextOrObserver: NextFn<MessagePayload> | Observer<MessagePayload>): Unsubscribe;

export { Unsubscribe }

Expand Down
10 changes: 5 additions & 5 deletions common/api-review/remote-config-exp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,18 @@ export interface RemoteConfig {
};
fetchTimeMillis: number;
lastFetchStatus: FetchStatus;
settings: Settings;
settings: RemoteConfigSettings;
}

// @public
export function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void;

// @public
export interface Settings {
export interface RemoteConfigSettings {
fetchTimeoutMillis: number;
minimumFetchIntervalMillis: number;
}

// @public
export function setLogLevel(remoteConfig: RemoteConfig, logLevel: LogLevel): void;

// @public
export interface Value {
asBoolean(): boolean;
Expand Down
32 changes: 16 additions & 16 deletions common/api-review/storage.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Subscribe } from '@firebase/util';
import { Unsubscribe } from '@firebase/util';

// @public
export function connectStorageEmulator(storage: StorageService, host: string, port: number): void;
export function connectStorageEmulator(storage: FirebaseStorage, host: string, port: number): void;

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

// @public
export interface FirebaseStorage extends _FirebaseService {
readonly app: FirebaseApp;
maxOperationRetryTime: number;
maxUploadRetryTime: number;
}

// @public
export interface FirebaseStorageError extends FirebaseError {
serverResponse: string | null;
Expand Down Expand Up @@ -65,7 +72,7 @@ export function getDownloadURL(ref: StorageReference): Promise<string>;
export function getMetadata(ref: StorageReference): Promise<FullMetadata>;

// @public
export function getStorage(app?: FirebaseApp, bucketUrl?: string): StorageService;
export function getStorage(app?: FirebaseApp, bucketUrl?: string): FirebaseStorage;

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

// @public
export function ref(storage: StorageService, url?: string): StorageReference;
export function ref(storage: FirebaseStorage, url?: string): StorageReference;

// @public
export function ref(storageOrRef: StorageService | StorageReference, path?: string): StorageReference;
export function ref(storageOrRef: FirebaseStorage | StorageReference, path?: string): StorageReference;

// @internal
export class _Reference {
// Warning: (ae-forgotten-export) The symbol "StorageService" needs to be exported by the entry point index.d.ts
constructor(_service: StorageService_2, location: string | _Location);
// Warning: (ae-forgotten-export) The symbol "FirebaseStorageImpl" needs to be exported by the entry point index.d.ts
constructor(_service: FirebaseStorageImpl, location: string | _Location);
get bucket(): string;
get fullPath(): string;
// (undocumented)
_location: _Location;
get name(): string;
// (undocumented)
protected _newRef(service: StorageService_2, location: _Location): _Reference;
protected _newRef(service: FirebaseStorageImpl, location: _Location): _Reference;
get parent(): _Reference | null;
get root(): _Reference;
get storage(): StorageService_2;
get storage(): FirebaseStorageImpl;
_throwIfRoot(name: string): void;
// @override
toString(): string;
Expand Down Expand Up @@ -159,17 +166,10 @@ export interface StorageReference {
name: string;
parent: StorageReference | null;
root: StorageReference;
storage: StorageService;
storage: FirebaseStorage;
toString(): string;
}

// @public
export interface StorageService extends _FirebaseService {
readonly app: FirebaseApp;
maxOperationRetryTime: number;
maxUploadRetryTime: number;
}

// @public
export type StringFormat = string;

Expand Down
4 changes: 2 additions & 2 deletions packages-exp/analytics-exp/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { _getProvider, FirebaseApp, getApp } from '@firebase/app-exp';
import {
Analytics,
AnalyticsCallOptions,
AnalyticsOptions,
AnalyticsSettings,
CustomParams,
EventNameString,
EventParams
Expand Down Expand Up @@ -89,7 +89,7 @@ export function getAnalytics(app: FirebaseApp = getApp()): Analytics {
*/
export function initializeAnalytics(
app: FirebaseApp,
options: AnalyticsOptions = {}
options: AnalyticsSettings = {}
): Analytics {
// Dependencies
const analyticsProvider: Provider<'analytics-exp'> = _getProvider(
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/analytics-exp/src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

import { SettingsOptions, Analytics, AnalyticsOptions } from './public-types';
import { SettingsOptions, Analytics, AnalyticsSettings } from './public-types';
import { Gtag, DynamicConfig, MinimalDynamicConfig } from './types';
import { getOrCreateDataLayer, wrapOrCreateGtag } from './helpers';
import { AnalyticsError, ERROR_FACTORY } from './errors';
Expand Down Expand Up @@ -177,7 +177,7 @@ function warnOnBrowserContextMismatch(): void {
export function factory(
app: FirebaseApp,
installations: _FirebaseInstallationsInternal,
options?: AnalyticsOptions
options?: AnalyticsSettings
): AnalyticsService {
warnOnBrowserContextMismatch();
const appId = app.options.appId;
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/analytics-exp/src/initialize-analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
} from '@firebase/util';
import { ERROR_FACTORY, AnalyticsError } from './errors';
import { findGtagScriptOnPage, insertScriptTag } from './helpers';
import { AnalyticsOptions } from './public-types';
import { AnalyticsSettings } from './public-types';

async function validateIndexedDB(): Promise<boolean> {
if (!isIndexedDBAvailable()) {
Expand Down Expand Up @@ -74,7 +74,7 @@ export async function initializeAnalytics(
installations: _FirebaseInstallationsInternal,
gtagCore: Gtag,
dataLayerName: string,
options?: AnalyticsOptions
options?: AnalyticsSettings
): Promise<string> {
const dynamicConfigPromise = fetchDynamicConfigWithRetry(app);
// Once fetched, map measurementIds to appId, for ease of lookup in wrapped gtag function.
Expand Down
2 changes: 1 addition & 1 deletion packages-exp/analytics-exp/src/public-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export interface GtagConfigParams {
* Analytics initialization options.
* @public
*/
export interface AnalyticsOptions {
export interface AnalyticsSettings {
/**
* Params to be passed in the initial gtag config call during analytics initialization.
*/
Expand Down
5 changes: 1 addition & 4 deletions packages-exp/app-check-exp/src/internal-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,7 @@ export function addTokenListener(

// Create the refresher but don't start it if `isTokenAutoRefreshEnabled`
// is not true.
if (
!newState.tokenRefresher.isRunning() &&
state.isTokenAutoRefreshEnabled
) {
if (!newState.tokenRefresher.isRunning() && state.isTokenAutoRefreshEnabled) {
newState.tokenRefresher.start();
}

Expand Down
6 changes: 3 additions & 3 deletions packages-exp/app-exp/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import {
FirebaseApp,
FirebaseOptions,
FirebaseAppConfig
FirebaseAppSettings
} from './public-types';
import { DEFAULT_ENTRY_NAME, PLATFORM_LOG_STRING } from './constants';
import { ERROR_FACTORY, AppError } from './errors';
Expand Down Expand Up @@ -105,7 +105,7 @@ export function initializeApp(
*/
export function initializeApp(
options: FirebaseOptions,
config?: FirebaseAppConfig
config?: FirebaseAppSettings
): FirebaseApp;
export function initializeApp(
options: FirebaseOptions,
Expand All @@ -116,7 +116,7 @@ export function initializeApp(
rawConfig = { name };
}

const config: Required<FirebaseAppConfig> = {
const config: Required<FirebaseAppSettings> = {
name: DEFAULT_ENTRY_NAME,
automaticDataCollectionEnabled: false,
...rawConfig
Expand Down
4 changes: 2 additions & 2 deletions packages-exp/app-exp/src/firebaseApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import {
FirebaseApp,
FirebaseOptions,
FirebaseAppConfig
FirebaseAppSettings
} from './public-types';
import {
ComponentContainer,
Expand All @@ -36,7 +36,7 @@ export class FirebaseAppImpl implements FirebaseApp {

constructor(
options: FirebaseOptions,
config: Required<FirebaseAppConfig>,
config: Required<FirebaseAppSettings>,
container: ComponentContainer
) {
this._options = { ...options };
Expand Down
2 changes: 1 addition & 1 deletion packages-exp/app-exp/src/public-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export interface FirebaseOptions {
*
* Configuration options given to {@link (initializeApp:1) | initializeApp()}
*/
export interface FirebaseAppConfig {
export interface FirebaseAppSettings {
/**
* custom name for the Firebase App.
* The default value is `"[DEFAULT]"`.
Expand Down
Loading