mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-13 04:00:33 +08:00
Move from namespace to static attributes (#27900)
This commit is contained in:
committed by
Sheetal Nandi
parent
378202e216
commit
10bc3fc48a
@@ -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);
|
||||
|
||||
21
types/google-cloud__datastore/index.d.ts
vendored
21
types/google-cloud__datastore/index.d.ts
vendored
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/googleapis/nodejs-datastore
|
||||
// Definitions by: Antoine Beauvais-Lacasse <https://github.com/beaulac>
|
||||
// Futa Ogawa <https://github.com/ogawa0071>
|
||||
// Thomas den Hollander <https://github.com/ThomasdenH>
|
||||
// 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' {
|
||||
|
||||
Reference in New Issue
Block a user