diff --git a/types/google-cloud__storage/google-cloud__storage-tests.ts b/types/google-cloud__storage/google-cloud__storage-tests.ts index e701fe5681..a301aa063c 100644 --- a/types/google-cloud__storage/google-cloud__storage-tests.ts +++ b/types/google-cloud__storage/google-cloud__storage-tests.ts @@ -38,7 +38,7 @@ export class TestStorage { }; // import Storage class - static gcs: Storage; + static gcs: Storage = new Storage(); // the bucket private buckets: Bucket[] = []; diff --git a/types/google-cloud__storage/index.d.ts b/types/google-cloud__storage/index.d.ts index e97249be24..88743b8af8 100644 --- a/types/google-cloud__storage/index.d.ts +++ b/types/google-cloud__storage/index.d.ts @@ -1,6 +1,6 @@ -// Type definitions for @google-cloud/storage 0.6 +// Type definitions for @google-cloud/storage v1.1.0 // Project: https://github.com/GoogleCloudPlatform/google-cloud-node/tree/master/packages/storage -// Definitions by: Brian Love +// Definitions by: Brian Love // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// @@ -301,6 +301,21 @@ declare module "@google-cloud/storage/storage" { updated?: string; } + interface Credentials { + client_email?: string; + private_key?: string; + } + + interface ConfigurationObject { + autoRetry?: boolean; + credentials?: Credentials; + email?: string; + keyFilename?: string; + maxRetries?: number; + projectId?: string; + promise?: PromiseLibrary; + } + /** * The options when downloading a file. */ @@ -343,6 +358,7 @@ declare module "@google-cloud/storage/storage" { * The Storage class allows you interact with Google Cloud Storage. */ class Storage { + constructor(options?: ConfigurationObject); acl: Acl; bucket(name: string|Bucket): Bucket; channel(id: string, resourceId: string): Channel; @@ -350,4 +366,6 @@ declare module "@google-cloud/storage/storage" { getBuckets(query?: BucketQuery): Promise<[Bucket[]]>; getBucketsStream(query?: BucketQuery): Promise<[ReadStream]>; } + + type PromiseLibrary = () => PromiseLike; }