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 =
122122 * The `Expr` class provides a fluent API for building expressions. You can chain together
123123 * method calls to create complex expressions.
124124 */
125- export abstract class Expr implements ProtoSerializable , UserData {
125+ export abstract class Expr implements ProtoSerializable < ProtoValue > , UserData {
126126 /**
127127 * Creates an expression that adds this expression to another expression.
128128 *
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import {
2424import { invokeExecutePipeline } from '../remote/datastore' ;
2525import {
2626 getEncodedDatabaseId ,
27- JsonProtoSerializer
27+ JsonProtoSerializer , ProtoSerializable
2828} from '../remote/serializer' ;
2929
3030import { getDatastore } from './components' ;
@@ -117,7 +117,7 @@ function isReadableUserData(value: any): value is ReadableUserData {
117117/**
118118 * Base-class implementation
119119 */
120- export class Pipeline < AppModelType = DocumentData > {
120+ export class Pipeline < AppModelType = DocumentData > implements ProtoSerializable < ExecutePipelineRequest > {
121121 /**
122122 * @internal
123123 * @private
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import {
1919} from '../protos/firestore_proto_api' ;
2020import { toNumber } from '../remote/number_serializer' ;
2121import {
22- JsonProtoSerializer ,
22+ JsonProtoSerializer , ProtoSerializable ,
2323 toMapValue ,
2424 toStringValue
2525} from '../remote/serializer' ;
@@ -37,14 +37,8 @@ import { VectorValue } from './vector_value';
3737/**
3838 * @beta
3939 */
40- export interface Stage {
40+ export interface Stage extends ProtoSerializable < ProtoStage > {
4141 name : string ;
42-
43- /**
44- * @internal
45- * @private
46- */
47- _toProto ( jsonProtoSerializer : JsonProtoSerializer ) : ProtoStage ;
4842}
4943
5044/**
Original file line number Diff line number Diff line change @@ -1429,8 +1429,8 @@ export function isValidResourceName(path: ResourcePath): boolean {
14291429 ) ;
14301430}
14311431
1432- export interface ProtoSerializable {
1433- _toProto ( serializer : JsonProtoSerializer ) : ProtoValue ;
1432+ export interface ProtoSerializable < ProtoType > {
1433+ _toProto ( serializer : JsonProtoSerializer ) : ProtoType ;
14341434}
14351435
14361436export interface UserData {
@@ -1439,10 +1439,10 @@ export interface UserData {
14391439
14401440export function toMapValue (
14411441 serializer : JsonProtoSerializer ,
1442- input : Map < string , ProtoSerializable >
1442+ input : Map < string , ProtoSerializable < ProtoValue > >
14431443) : ProtoValue {
14441444 const map : ProtoMapValue = { fields : { } } ;
1445- input . forEach ( ( exp : ProtoSerializable , key : string ) => {
1445+ input . forEach ( ( exp : ProtoSerializable < ProtoValue > , key : string ) => {
14461446 if ( typeof key !== 'string' ) {
14471447 throw new Error ( `Cannot encode map with non-string key: ${ key } ` ) ;
14481448 }
You can’t perform that action at this time.
0 commit comments