diff --git a/types/google-cloud__datastore/google-cloud__datastore-tests.ts b/types/google-cloud__datastore/google-cloud__datastore-tests.ts index cb723d0d5b..df48a70f59 100644 --- a/types/google-cloud__datastore/google-cloud__datastore-tests.ts +++ b/types/google-cloud__datastore/google-cloud__datastore-tests.ts @@ -72,7 +72,7 @@ const complexQuery = ds.createQuery('special_namespace', kind) .offset(10); // Running queries: -const queryCallback: QueryCallback = (err: Error, entities: TestEntity[]) => entities[0][Datastore.KEY]; +const queryCallback: QueryCallback = (err: Error, entities: TestEntity[]) => entities[0][ds.KEY]; ds.runQuery(query, queryCallback); ds.runQuery(query, options, queryCallback); diff --git a/types/google-cloud__datastore/index.d.ts b/types/google-cloud__datastore/index.d.ts index e0ef60b4bb..c6b7ed3462 100644 --- a/types/google-cloud__datastore/index.d.ts +++ b/types/google-cloud__datastore/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/googleapis/nodejs-datastore // Definitions by: Antoine Beauvais-Lacasse // Futa Ogawa +// Thomas den Hollander // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.7 @@ -35,6 +36,15 @@ declare module '@google-cloud/datastore' { import { DatastoreTransaction } from '@google-cloud/datastore/transaction'; class Datastore extends DatastoreRequest_ { + static readonly KEY: unique symbol; + static readonly MORE_RESULTS_AFTER_CURSOR: MoreResultsAfterCursor; + static readonly MORE_RESULTS_AFTER_LIMIT: MoreResultsAfterLimit; + static readonly NO_MORE_RESULTS: NoMoreResults; + + static readonly Query: typeof DatastoreQuery; + static readonly DatastoreRequest: typeof DatastoreRequest_; + static readonly Transaction: typeof DatastoreTransaction; + constructor(options?: InitOptions); readonly KEY: typeof Datastore.KEY; @@ -80,17 +90,6 @@ declare module '@google-cloud/datastore' { keyFilename?: string; credentials?: object; } - - namespace Datastore { - const KEY: unique symbol; - const MORE_RESULTS_AFTER_CURSOR: MoreResultsAfterCursor; - const MORE_RESULTS_AFTER_LIMIT: MoreResultsAfterLimit; - const NO_MORE_RESULTS: NoMoreResults; - - const Query: typeof DatastoreQuery; - const DatastoreRequest: typeof DatastoreRequest_; - const Transaction: typeof DatastoreTransaction; - } } declare module '@google-cloud/datastore/entity' {