@@ -18,7 +18,7 @@ import {PreciseDate} from '@google-cloud/precise-date';
1818import { promisifyAll } from '@google-cloud/promisify' ;
1919import * as extend from 'extend' ;
2020import * as is from 'is' ;
21- import { ExecuteSqlRequest , Snapshot } from './transaction' ;
21+ import { ReadRequest , ExecuteSqlRequest , Snapshot } from './transaction' ;
2222import { google } from '../protos/protos' ;
2323import { Session , Database } from '.' ;
2424import {
@@ -35,6 +35,16 @@ export interface TransactionIdentifier {
3535 timestamp ?: google . protobuf . ITimestamp ;
3636}
3737
38+ export type CreateReadPartitionsResponse = [
39+ google . spanner . v1 . IPartitionReadRequest ,
40+ google . spanner . v1 . IPartitionResponse ,
41+ ] ;
42+
43+ export type CreateReadPartitionsCallback = ResourceCallback <
44+ google . spanner . v1 . IPartitionReadRequest ,
45+ google . spanner . v1 . IPartitionResponse
46+ > ;
47+
3848export type CreateQueryPartitionsResponse = [
3949 google . spanner . v1 . IPartitionQueryRequest ,
4050 google . spanner . v1 . IPartitionResponse ,
@@ -284,7 +294,17 @@ class BatchTransaction extends Snapshot {
284294 * @param {CreateReadPartitionsCallback } [callback] Callback function.
285295 * @returns {Promise<CreateReadPartitionsResponse> }
286296 */
287- createReadPartitions ( options , callback ) {
297+ createReadPartitions (
298+ options : ReadRequest ,
299+ ) : Promise < CreateReadPartitionsResponse > ;
300+ createReadPartitions (
301+ options : ReadRequest ,
302+ callback : CreateReadPartitionsCallback ,
303+ ) : void ;
304+ createReadPartitions (
305+ options : ReadRequest ,
306+ cb ?: CreateReadPartitionsCallback ,
307+ ) : void | Promise < CreateReadPartitionsResponse > {
288308 const traceConfig : traceConfig = {
289309 opts : this . _observabilityOptions ,
290310 dbName : this . getDBName ( ) ,
@@ -321,7 +341,7 @@ class BatchTransaction extends Snapshot {
321341 }
322342
323343 span . end ( ) ;
324- callback ( err , partitions , resp ) ;
344+ cb ! ( err , partitions , resp ) ;
325345 } ,
326346 ) ;
327347 } ,
0 commit comments