Skip to content

Commit a65a247

Browse files
committed
Removed unnecessary exports
1 parent 6660f98 commit a65a247

File tree

7 files changed

+20
-100
lines changed

7 files changed

+20
-100
lines changed

common/api-review/data-connect.api.md

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,12 @@
55
```ts
66

77
import { AppCheckInternalComponentName } from '@firebase/app-check-interop-types';
8-
import { AppCheckTokenListener } from '@firebase/app-check-interop-types';
9-
import { AppCheckTokenResult } from '@firebase/app-check-interop-types';
108
import { FirebaseApp } from '@firebase/app';
119
import { FirebaseAuthInternalName } from '@firebase/auth-interop-types';
12-
import { FirebaseAuthTokenData } from '@firebase/auth-interop-types';
1310
import { FirebaseError } from '@firebase/util';
14-
import { FirebaseOptions } from '@firebase/app-types';
1511
import { LogLevelString } from '@firebase/logger';
1612
import { Provider } from '@firebase/component';
1713

18-
// @public
19-
export class AppCheckTokenProvider {
20-
constructor(appName_: string, appCheckProvider?: Provider<AppCheckInternalComponentName>);
21-
// (undocumented)
22-
addTokenChangeListener(listener: AppCheckTokenListener): void;
23-
// (undocumented)
24-
getToken(forceRefresh?: boolean): Promise<AppCheckTokenResult>;
25-
}
26-
27-
// @public (undocumented)
28-
export type AuthTokenListener = (token: string | null) => void;
29-
30-
// @public (undocumented)
31-
export interface AuthTokenProvider {
32-
// (undocumented)
33-
addTokenChangeListener(listener: AuthTokenListener): void;
34-
// (undocumented)
35-
getToken(forceRefresh: boolean): Promise<FirebaseAuthTokenData | null>;
36-
}
37-
3814
// @public (undocumented)
3915
export interface CancellableOperation<T> extends PromiseLike<{
4016
data: T;
@@ -66,8 +42,6 @@ export class DataConnect {
6642
// (undocumented)
6743
getSettings(): ConnectorConfig;
6844
// (undocumented)
69-
initialized: boolean;
70-
// (undocumented)
7145
isEmulator: boolean;
7246
// (undocumented)
7347
setInitialized(): void;
@@ -95,24 +69,6 @@ export interface DataConnectSubscription<Data, Variables> {
9569
userCallback: OnResultSubscription<Data, Variables>;
9670
}
9771

98-
// @public (undocumented)
99-
export interface DataConnectTransport {
100-
// (undocumented)
101-
invokeMutation<T, U>(queryName: string, body?: U): PromiseLike<{
102-
data: T;
103-
errors: Error[];
104-
}>;
105-
// (undocumented)
106-
invokeQuery<T, U>(queryName: string, body?: U): PromiseLike<{
107-
data: T;
108-
errors: Error[];
109-
}>;
110-
// (undocumented)
111-
onTokenChanged: (token: string | null) => void;
112-
// (undocumented)
113-
useEmulator(host: string, port?: number, sslEnabled?: boolean): void;
114-
}
115-
11672
// @public (undocumented)
11773
export type DataSource = typeof SOURCE_CACHE | typeof SOURCE_SERVER;
11874

@@ -122,20 +78,6 @@ export function executeMutation<Data, Variables>(mutationRef: MutationRef<Data,
12278
// @public
12379
export function executeQuery<Data, Variables>(queryRef: QueryRef<Data, Variables>): QueryPromise<Data, Variables>;
12480

125-
// @public (undocumented)
126-
export const FIREBASE_DATA_CONNECT_EMULATOR_HOST_VAR = "FIREBASE_DATA_CONNECT_EMULATOR_HOST";
127-
128-
// @public (undocumented)
129-
export class FirebaseAuthProvider implements AuthTokenProvider {
130-
constructor(_appName: string, _options: FirebaseOptions, _authProvider: Provider<FirebaseAuthInternalName>);
131-
// (undocumented)
132-
addTokenChangeListener(listener: AuthTokenListener): void;
133-
// (undocumented)
134-
getToken(forceRefresh: boolean): Promise<FirebaseAuthTokenData | null>;
135-
// (undocumented)
136-
removeTokenChangeListener(listener: (token: string | null) => void): void;
137-
}
138-
13981
// @public
14082
export function getDataConnect(options: ConnectorConfig): DataConnect;
14183

@@ -161,10 +103,6 @@ export function mutationRef<Data>(dcInstance: DataConnect, mutationName: string)
161103
// @public (undocumented)
162104
export function mutationRef<Data, Variables>(dcInstance: DataConnect, mutationName: string, variables: Variables): MutationRef<Data, Variables>;
163105

164-
// @public (undocumented)
165-
export interface MutationResponse<T> extends CancellableOperation<T> {
166-
}
167-
168106
// @public
169107
export interface MutationResult<Data, Variables> extends DataConnectResult<Data, Variables> {
170108
// (undocumented)
@@ -221,10 +159,6 @@ export function queryRef<Data>(dcInstance: DataConnect, queryName: string): Quer
221159
// @public
222160
export function queryRef<Data, Variables>(dcInstance: DataConnect, queryName: string, variables: Variables): QueryRef<Data, Variables>;
223161

224-
// @public (undocumented)
225-
export interface QueryResponse<T> extends CancellableOperation<T> {
226-
}
227-
228162
// @public
229163
export interface QueryResult<Data, Variables> extends DataConnectResult<Data, Variables> {
230164
// (undocumented)
@@ -249,14 +183,6 @@ export interface RefInfo<Variables> {
249183
variables: Variables;
250184
}
251185

252-
// @public (undocumented)
253-
export interface Sender<T> {
254-
// (undocumented)
255-
abort: () => void;
256-
// (undocumented)
257-
send: () => Promise<T>;
258-
}
259-
260186
// @public
261187
export interface SerializedRef<Data, Variables> extends OpResult<Data> {
262188
// (undocumented)
@@ -294,9 +220,6 @@ export function terminate(dataConnect: DataConnect): Promise<void>;
294220
// @public
295221
export function toQueryRef<Data, Variables>(serializedRef: SerializedRef<Data, Variables>): QueryRef<Data, Variables>;
296222

297-
// @public (undocumented)
298-
export type TransportClass = new (options: DataConnectOptions, apiKey?: string, authProvider?: AuthTokenProvider, appCheckProvider?: AppCheckTokenProvider, transportOptions?: TransportOptions, _isUsingGen?: boolean) => DataConnectTransport;
299-
300223
// @public
301224
export interface TransportOptions {
302225
// (undocumented)

packages/data-connect/src/api/DataConnect.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface TransportOptions {
5858
port?: number;
5959
}
6060

61-
export const FIREBASE_DATA_CONNECT_EMULATOR_HOST_VAR =
61+
const FIREBASE_DATA_CONNECT_EMULATOR_HOST_VAR =
6262
'FIREBASE_DATA_CONNECT_EMULATOR_HOST';
6363

6464
/**
@@ -88,13 +88,14 @@ export class DataConnect {
8888
_queryManager!: QueryManager;
8989
_mutationManager!: MutationManager;
9090
isEmulator = false;
91-
initialized = false;
91+
_initialized = false;
9292
private _transport!: DataConnectTransport;
9393
private _transportClass: TransportClass | undefined;
9494
private _transportOptions?: TransportOptions;
9595
private _authTokenProvider?: AuthTokenProvider;
9696
_isUsingGeneratedSdk: boolean = false;
9797
private _appCheckTokenProvider?: AppCheckTokenProvider;
98+
// @internal
9899
constructor(
99100
public readonly app: FirebaseApp,
100101
// TODO(mtewani): Replace with _dataConnectOptions in the future
@@ -111,9 +112,7 @@ export class DataConnect {
111112
}
112113
}
113114
}
114-
/*
115-
@internal
116-
*/
115+
// @internal
117116
_useGeneratedSdk(): void {
118117
if (!this._isUsingGeneratedSdk) {
119118
this._isUsingGeneratedSdk = true;
@@ -128,14 +127,16 @@ export class DataConnect {
128127
return Promise.resolve();
129128
}
130129

130+
// @internal
131131
getSettings(): ConnectorConfig {
132132
const copy = JSON.parse(JSON.stringify(this.dataConnectOptions));
133133
delete copy.projectId;
134134
return copy;
135135
}
136136

137+
// @internal
137138
setInitialized(): void {
138-
if (this.initialized) {
139+
if (this._initialized) {
139140
return;
140141
}
141142
if (this._transportClass === undefined) {
@@ -157,7 +158,7 @@ export class DataConnect {
157158
);
158159
}
159160

160-
this.initialized = true;
161+
this._initialized = true;
161162
this._transport = new this._transportClass(
162163
this.dataConnectOptions,
163164
this.app.options.apiKey,
@@ -177,8 +178,9 @@ export class DataConnect {
177178
this._mutationManager = new MutationManager(this._transport);
178179
}
179180

181+
// @internal
180182
enableEmulator(transportOptions: TransportOptions): void {
181-
if (this.initialized) {
183+
if (this._initialized) {
182184
logError('enableEmulator called after initialization');
183185
throw new DataConnectError(
184186
Code.ALREADY_INITIALIZED,

packages/data-connect/src/api/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,5 @@ export * from './DataConnect';
2020
export * from './Reference';
2121
export * from './Mutation';
2222
export * from './query';
23-
export * from '../core/AppCheckTokenProvider';
2423
export { setLogLevel } from '../logger';
2524
export { validateArgs } from '../util/validateArgs';

packages/data-connect/src/core/AppCheckTokenProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
import { Provider } from '@firebase/component';
2525

2626
/**
27+
@internal
2728
* Abstraction around AppCheck's token fetching capabilities.
2829
*/
2930
export class AppCheckTokenProvider {

packages/data-connect/src/core/FirebaseAuthProvider.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ import { Provider } from '@firebase/component';
2525

2626
import { logDebug, logError } from '../logger';
2727

28+
// @internal
2829
export interface AuthTokenProvider {
2930
getToken(forceRefresh: boolean): Promise<FirebaseAuthTokenData | null>;
3031
addTokenChangeListener(listener: AuthTokenListener): void;
3132
}
3233
export type AuthTokenListener = (token: string | null) => void;
3334

35+
// @internal
3436
export class FirebaseAuthProvider implements AuthTokenProvider {
3537
private _auth: FirebaseAuthInternal;
3638
constructor(

packages/data-connect/src/network/transport/index.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ import { DataConnectOptions, TransportOptions } from '../../api/DataConnect';
1919
import { AppCheckTokenProvider } from '../../core/AppCheckTokenProvider';
2020
import { AuthTokenProvider } from '../../core/FirebaseAuthProvider';
2121

22-
// Change this to only specify specific args.
22+
/**
23+
* @internal
24+
*/
2325
export interface DataConnectTransport {
2426
invokeQuery<T, U>(
2527
queryName: string,
@@ -37,18 +39,9 @@ export interface CancellableOperation<T> extends PromiseLike<{ data: T }> {
3739
cancel: () => void;
3840
}
3941

40-
export interface QueryResponse<T> extends CancellableOperation<T> {}
41-
// export type QueryResponse<T> = {
42-
// // Type '{ data: T; }' is not assignable to type 'T'.
43-
// then: (a: (data: T) => void) => void;
44-
// }
45-
export interface MutationResponse<T> extends CancellableOperation<T> {}
46-
47-
export interface Sender<T> {
48-
abort: () => void;
49-
send: () => Promise<T>;
50-
}
51-
42+
/**
43+
* @internal
44+
*/
5245
export type TransportClass = new (
5346
options: DataConnectOptions,
5447
apiKey?: string,
@@ -57,4 +50,3 @@ export type TransportClass = new (
5750
transportOptions?: TransportOptions,
5851
_isUsingGen?: boolean
5952
) => DataConnectTransport;
60-
export * from '../../core/FirebaseAuthProvider';

packages/database/src/core/AuthTokenProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { Provider } from '@firebase/component';
2424

2525
import { log, warn } from './util/util';
2626

27+
// @internal
2728
export interface AuthTokenProvider {
2829
getToken(forceRefresh: boolean): Promise<FirebaseAuthTokenData>;
2930
addTokenChangeListener(listener: (token: string | null) => void): void;

0 commit comments

Comments
 (0)