Open luffigo123 opened 1 year ago
Hi everybody, There is no set method of map filed on TS.
When a proto file has map field: syntax = "proto3";
package example;
message Example { map<string, string> labels = 1; }
It generates this TS definitions export class Example extends jspb.Message { getLabelsMap(): jspb.Map<string, string>; clearLabelsMap(): void;
serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Example.AsObject; static toObject(includeInstance: boolean, msg: Example): Example.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo}; static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; static serializeBinaryToWriter(message: Example, writer: jspb.BinaryWriter): void; static deserializeBinary(bytes: Uint8Array): Example; static deserializeBinaryFromReader(message: Example, reader: jspb.BinaryReader): Example; }
export namespace Example { export type AsObject = { labelsMap: Array<[string, string]>, } }
Note: No setLablesMap() method, @jonny-improbable could you take a look about this issue?
Hi everybody, There is no set method of map filed on TS.
When a proto file has map field: syntax = "proto3";
package example;
message Example { map<string, string> labels = 1; }
It generates this TS definitions export class Example extends jspb.Message { getLabelsMap(): jspb.Map<string, string>; clearLabelsMap(): void;
serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): Example.AsObject; static toObject(includeInstance: boolean, msg: Example): Example.AsObject; static extensions: {[key: number]: jspb.ExtensionFieldInfo};
static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo};
static serializeBinaryToWriter(message: Example, writer: jspb.BinaryWriter): void;
static deserializeBinary(bytes: Uint8Array): Example;
static deserializeBinaryFromReader(message: Example, reader: jspb.BinaryReader): Example;
}
export namespace Example { export type AsObject = { labelsMap: Array<[string, string]>, } }
Note: No setLablesMap() method, @jonny-improbable could you take a look about this issue?