File tree Expand file tree Collapse file tree 4 files changed +9
-15
lines changed Expand file tree Collapse file tree 4 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ export type ExprType =
122
122
* The `Expr` class provides a fluent API for building expressions. You can chain together
123
123
* method calls to create complex expressions.
124
124
*/
125
- export abstract class Expr implements ProtoSerializable , UserData {
125
+ export abstract class Expr implements ProtoSerializable < ProtoValue > , UserData {
126
126
/**
127
127
* Creates an expression that adds this expression to another expression.
128
128
*
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import {
24
24
import { invokeExecutePipeline } from '../remote/datastore' ;
25
25
import {
26
26
getEncodedDatabaseId ,
27
- JsonProtoSerializer
27
+ JsonProtoSerializer , ProtoSerializable
28
28
} from '../remote/serializer' ;
29
29
30
30
import { getDatastore } from './components' ;
@@ -117,7 +117,7 @@ function isReadableUserData(value: any): value is ReadableUserData {
117
117
/**
118
118
* Base-class implementation
119
119
*/
120
- export class Pipeline < AppModelType = DocumentData > {
120
+ export class Pipeline < AppModelType = DocumentData > implements ProtoSerializable < ExecutePipelineRequest > {
121
121
/**
122
122
* @internal
123
123
* @private
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import {
19
19
} from '../protos/firestore_proto_api' ;
20
20
import { toNumber } from '../remote/number_serializer' ;
21
21
import {
22
- JsonProtoSerializer ,
22
+ JsonProtoSerializer , ProtoSerializable ,
23
23
toMapValue ,
24
24
toStringValue
25
25
} from '../remote/serializer' ;
@@ -37,14 +37,8 @@ import { VectorValue } from './vector_value';
37
37
/**
38
38
* @beta
39
39
*/
40
- export interface Stage {
40
+ export interface Stage extends ProtoSerializable < ProtoStage > {
41
41
name : string ;
42
-
43
- /**
44
- * @internal
45
- * @private
46
- */
47
- _toProto ( jsonProtoSerializer : JsonProtoSerializer ) : ProtoStage ;
48
42
}
49
43
50
44
/**
Original file line number Diff line number Diff line change @@ -1429,8 +1429,8 @@ export function isValidResourceName(path: ResourcePath): boolean {
1429
1429
) ;
1430
1430
}
1431
1431
1432
- export interface ProtoSerializable {
1433
- _toProto ( serializer : JsonProtoSerializer ) : ProtoValue ;
1432
+ export interface ProtoSerializable < ProtoType > {
1433
+ _toProto ( serializer : JsonProtoSerializer ) : ProtoType ;
1434
1434
}
1435
1435
1436
1436
export interface UserData {
@@ -1439,10 +1439,10 @@ export interface UserData {
1439
1439
1440
1440
export function toMapValue (
1441
1441
serializer : JsonProtoSerializer ,
1442
- input : Map < string , ProtoSerializable >
1442
+ input : Map < string , ProtoSerializable < ProtoValue > >
1443
1443
) : ProtoValue {
1444
1444
const map : ProtoMapValue = { fields : { } } ;
1445
- input . forEach ( ( exp : ProtoSerializable , key : string ) => {
1445
+ input . forEach ( ( exp : ProtoSerializable < ProtoValue > , key : string ) => {
1446
1446
if ( typeof key !== 'string' ) {
1447
1447
throw new Error ( `Cannot encode map with non-string key: ${ key } ` ) ;
1448
1448
}
You can’t perform that action at this time.
0 commit comments