Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: improve types for instance #655

Merged
merged 1 commit into from
Mar 19, 2020
Merged
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
9 changes: 9 additions & 0 deletions src/app-profile.ts
Original file line number Diff line number Diff line change
@@ -100,6 +100,15 @@ export type GetAppProfileResponse = [
AppProfile,
google.bigtable.admin.v2.IAppProfile
];
export type GetAppProfilesCallback = (
err: ServiceError | null,
appProfiles?: AppProfile[],
apiResponse?: google.bigtable.admin.v2.IAppProfile[]
) => void;
export type GetAppProfilesResponse = [
AppProfile[],
google.bigtable.admin.v2.IAppProfile[]
];
export type SetAppProfileMetadataCallback = (
err: ServiceError | null,
apiResponse?: google.protobuf.Empty
14 changes: 10 additions & 4 deletions src/cluster.ts
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ import {promisifyAll} from '@google-cloud/promisify';
import {CallOptions, Operation as GaxOperation} from 'google-gax';
import {ServiceError} from '@grpc/grpc-js';

import {google as btTypes} from '../protos/protos';
import {google} from '../protos/protos';
import {Bigtable} from '.';
import {Instance} from './instance';

@@ -40,20 +40,26 @@ export interface GenericOperationCallback<T> {
): void;
}

export type IEmpty = btTypes.protobuf.IEmpty;
export type ICluster = btTypes.bigtable.admin.v2.ICluster;
export type IOperation = btTypes.longrunning.IOperation;
export type IEmpty = google.protobuf.IEmpty;
export type ICluster = google.bigtable.admin.v2.ICluster;
export type IOperation = google.longrunning.IOperation;

export type ApiResponse = [IOperation];
export type CreateClusterResponse = [ICluster, GaxOperation, IOperation];
export type BooleanResponse = [boolean];
export type GetClusterResponse = [ICluster, IOperation];
export type GetClustersResponse = [ICluster[], IOperation];
export type MetadataResponse = [Metadata, IOperation];

export type CreateClusterCallback = GenericCallback<IOperation>;
export type DeleteClusterCallback = GenericCallback<IOperation>;
export type ExistsClusterCallback = GenericCallback<boolean>;
export type GetClusterCallback = GenericClusterCallback<ICluster>;
export type GetClustersCallback = (
err: ServiceError | null,
clusters?: ICluster[],
apiResponse?: google.bigtable.admin.v2.IListClustersResponse
) => void;
export type SetClusterMetadataCallback = GenericOperationCallback<IOperation>;

export interface CreateClusterOptions {
Loading