demo-protobuf: Rename field Repeated -> RepeatedString

This commit is contained in:
willclarktech 2020-06-23 11:15:50 +02:00
parent 94ecbca474
commit 4bd773eb10
No known key found for this signature in database
GPG Key ID: 551A86E2E398ADF7
3 changed files with 5 additions and 5 deletions

View File

@ -35,7 +35,7 @@ describe("decorator demo", () => {
@CosmosField.UInt64(5)
public readonly uint64Demo?: number;
@CosmosField.Repeated(6)
@CosmosField.RepeatedString(6)
public readonly listDemo?: readonly string[];
@CosmosField.Nested(7, MsgNestedDemo)

View File

@ -8,9 +8,9 @@ function getTypeName(typeUrl: string): string {
}
export function CosmosMessage(registry: Registry, typeUrl: string): TypeDecorator<any> {
return (constructor: Constructor<Message<any>>) => {
return (ctor: Constructor<Message<any>>) => {
const typeName = getTypeName(typeUrl);
const generatedType = util.decorateType(constructor, typeName);
const generatedType = util.decorateType(ctor, typeName);
registry.register(typeUrl, generatedType);
};
}
@ -24,6 +24,6 @@ export const CosmosField = {
Int64: (id: number) => Field.d<number>(id, "int64"),
UInt64: (id: number) => Field.d<number>(id, "uint64"),
Repeated: (id: number) => Field.d<string[]>(id, "string", "repeated"),
RepeatedString: (id: number) => Field.d<string[]>(id, "string", "repeated"),
Nested: (id: number, ctor: Constructor<Message<{}>>) => Field.d(id, ctor),
};

View File

@ -7,6 +7,6 @@ export declare const CosmosField: {
Bytes: (id: number) => import("protobufjs").FieldDecorator;
Int64: (id: number) => import("protobufjs").FieldDecorator;
UInt64: (id: number) => import("protobufjs").FieldDecorator;
Repeated: (id: number) => import("protobufjs").FieldDecorator;
RepeatedString: (id: number) => import("protobufjs").FieldDecorator;
Nested: (id: number, ctor: Constructor<Message<{}>>) => import("protobufjs").FieldDecorator;
};