New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typings incorrectly generated with `any` #731

Closed
tamird opened this Issue Mar 27, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@tamird

tamird commented Mar 27, 2017

Interestingly, this only affects a few protos in my application.

Given the proto:

syntax = "proto2";
package cockroach.ts.tspb;
option go_package = "tspb";

import "gogoproto/gogo.proto";

// TimeSeriesQueryResponse is the standard response for time series queries
// returned to cockroach clients.
message TimeSeriesQueryResponse {
  // Result is the data returned from a single metric query over a time span.
  message Result {
    optional Query query = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true];
    repeated TimeSeriesDatapoint datapoints = 2 [(gogoproto.nullable) = false];
  }

  // A set of Results; there will be one result for each Query in the matching
  // TimeSeriesQueryRequest, in the same order. A Result will be present for
  // each Query even if there are zero datapoints to return.
  repeated Result results = 1 [(gogoproto.nullable) = false];
}

type Result$Properties below has any properties:

            namespace TimeSeriesQueryResponse {

                /**
                 * Properties of a Result.
                 * @typedef cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties
                 * @type Object
                 * @property {*} [query] Result query.
                 * @property {Array.<*>} [datapoints] Result datapoints.
                 */
                type Result$Properties = {
                    query?: any;
                    datapoints?: any[];
                };

                /**
                 * Constructs a new Result.
                 * @exports cockroach.ts.tspb.TimeSeriesQueryResponse.Result
                 * @implements cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties
                 * @constructor
                 * @param {cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties=} [properties] Properties to set
                 */
                class Result implements cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties {

                    /**
                     * Constructs a new Result.
                     * @exports cockroach.ts.tspb.TimeSeriesQueryResponse.Result
                     * @implements cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties
                     * @constructor
                     * @param {cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties=} [properties] Properties to set
                     */
                    constructor(properties?: cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties);

                    /**
                     * @type {cockroach.ts.tspb.Query$Properties|undefined}
                     */
                    public query?: cockroach.ts.tspb.Query$Properties;

                    /**
                     * @type {Array.<cockroach.ts.tspb.TimeSeriesDatapoint$Properties>|undefined}
                     */
                    public datapoints?: cockroach.ts.tspb.TimeSeriesDatapoint$Properties[];

                    /**
                     * Creates a new Result instance using the specified properties.
                     * @param {cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties=} [properties] Properties to set
                     * @returns {cockroach.ts.tspb.TimeSeriesQueryResponse.Result} Result instance
                     */
                    public static create(properties?: cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties): cockroach.ts.tspb.TimeSeriesQueryResponse.Result;

                    /**
                     * Encodes the specified Result message. Does not implicitly {@link cockroach.ts.tspb.TimeSeriesQueryResponse.Result.verify|verify} messages.
                     * @param {cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties} message Result message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    public static encode(message: cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties, writer?: $protobuf.Writer): $protobuf.Writer;

                    /**
                     * Encodes the specified Result message, length delimited. Does not implicitly {@link cockroach.ts.tspb.TimeSeriesQueryResponse.Result.verify|verify} messages.
                     * @param {cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties} message Result message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    public static encodeDelimited(message: cockroach.ts.tspb.TimeSeriesQueryResponse.Result$Properties, writer?: $protobuf.Writer): $protobuf.Writer;

                    /**
                     * Decodes a Result message from the specified reader or buffer.
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {cockroach.ts.tspb.TimeSeriesQueryResponse.Result} Result
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cockroach.ts.tspb.TimeSeriesQueryResponse.Result;

                    /**
                     * Decodes a Result message from the specified reader or buffer, length delimited.
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {cockroach.ts.tspb.TimeSeriesQueryResponse.Result} Result
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cockroach.ts.tspb.TimeSeriesQueryResponse.Result;

                    /**
                     * Verifies a Result message.
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {?string} `null` if valid, otherwise the reason why it is not
                     */
                    public static verify(message: { [k: string]: any }): string;

                    /**
                     * Creates a Result message from a plain object. Also converts values to their respective internal types.
                     * @param {Object.<string,*>} object Plain object
                     * @returns {cockroach.ts.tspb.TimeSeriesQueryResponse.Result} Result
                     */
                    public static fromObject(object: { [k: string]: any }): cockroach.ts.tspb.TimeSeriesQueryResponse.Result;

                    /**
                     * Creates a Result message from a plain object. Also converts values to their respective internal types.
                     * This is an alias of {@link cockroach.ts.tspb.TimeSeriesQueryResponse.Result.fromObject}.
                     * @function
                     * @param {Object.<string,*>} object Plain object
                     * @returns {cockroach.ts.tspb.TimeSeriesQueryResponse.Result} Result
                     */
                    public static from(object: { [k: string]: any }): cockroach.ts.tspb.TimeSeriesQueryResponse.Result;

                    /**
                     * Creates a plain object from a Result message. Also converts values to other types if specified.
                     * @param {cockroach.ts.tspb.TimeSeriesQueryResponse.Result} message Result
                     * @param {$protobuf.ConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    public static toObject(message: cockroach.ts.tspb.TimeSeriesQueryResponse.Result, options?: $protobuf.ConversionOptions): { [k: string]: any };

                    /**
                     * Creates a plain object from this Result message. Also converts values to other types if specified.
                     * @param {$protobuf.ConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    public toObject(options?: $protobuf.ConversionOptions): { [k: string]: any };

                    /**
                     * Converts this Result to JSON.
                     * @returns {Object.<string,*>} JSON object
                     */
                    public toJSON(): { [k: string]: any };
                }
            }

Given the proto:

syntax = "proto3";
package cockroach.server.serverpb;
option go_package = "serverpb";

// EventsResponse contains a set of event log entries. This is always limited
// to the latest N entries (N is enforced in the associated endpoint).
message EventsResponse {
  message Event {
    // Timestamp is embedded in each place it's used, because proto3 defines a
    // built-in Timestamp message that we can't use, because gogoprotobuf
    // doesn't support all proto3 protobuf types yet. See
    // https://github.com/gogo/protobuf/issues/155.
    message Timestamp {
      // The time in seconds since, January 1, 1970 UTC (Unix time).
      int64 sec = 1;
      // nsec specifies a non-negative nanosecond offset within sec.
      // It must be in the range [0, 999999999].
      uint32 nsec = 2;
    }

    // timestamp is the time at which the event occurred.
    Timestamp timestamp = 1 [(gogoproto.nullable) = false];

    // event_type is the type of the event (e.g. "create_table", "drop_table".
    string event_type = 2;

    // target_id is the target for this event.
    int64 target_id = 3 [(gogoproto.customname) = "TargetID"];

    // reporting_id is the reporting ID for this event.
    int64 reporting_id = 4 [(gogoproto.customname) = "ReportingID"];

    // info has more detailed information for the event. The contents vary
    // depending on the vent.
    string info = 5;

    // unique_id is a unique identifier for this event.
    bytes unique_id = 6 [(gogoproto.customname) = "UniqueID"];
  }

  repeated Event events = 1 [(gogoproto.nullable) = false];
}

Event$Properties below has timestamp?: any;

            namespace EventsResponse {

                /**
                 * Properties of an Event.
                 * @typedef cockroach.server.serverpb.EventsResponse.Event$Properties
                 * @type Object
                 * @property {*} [timestamp] Event timestamp.
                 * @property {string} [event_type] Event event_type.
                 * @property {Long} [target_id] Event target_id.
                 * @property {Long} [reporting_id] Event reporting_id.
                 * @property {string} [info] Event info.
                 * @property {Uint8Array} [unique_id] Event unique_id.
                 */
                type Event$Properties = {
                    timestamp?: any;
                    event_type?: string;
                    target_id?: Long;
                    reporting_id?: Long;
                    info?: string;
                    unique_id?: Uint8Array;
                };

                /**
                 * Constructs a new Event.
                 * @exports cockroach.server.serverpb.EventsResponse.Event
                 * @implements cockroach.server.serverpb.EventsResponse.Event$Properties
                 * @constructor
                 * @param {cockroach.server.serverpb.EventsResponse.Event$Properties=} [properties] Properties to set
                 */
                class Event implements cockroach.server.serverpb.EventsResponse.Event$Properties {

                    /**
                     * Constructs a new Event.
                     * @exports cockroach.server.serverpb.EventsResponse.Event
                     * @implements cockroach.server.serverpb.EventsResponse.Event$Properties
                     * @constructor
                     * @param {cockroach.server.serverpb.EventsResponse.Event$Properties=} [properties] Properties to set
                     */
                    constructor(properties?: cockroach.server.serverpb.EventsResponse.Event$Properties);

                    /**
                     * @type {cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties|undefined}
                     */
                    public timestamp?: cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties;

                    /**
                     * @type {string|undefined}
                     */
                    public event_type?: string;

                    /**
                     * @type {Long|undefined}
                     */
                    public target_id?: Long;

                    /**
                     * @type {Long|undefined}
                     */
                    public reporting_id?: Long;

                    /**
                     * @type {string|undefined}
                     */
                    public info?: string;

                    /**
                     * @type {Uint8Array|undefined}
                     */
                    public unique_id?: Uint8Array;

                    /**
                     * Creates a new Event instance using the specified properties.
                     * @param {cockroach.server.serverpb.EventsResponse.Event$Properties=} [properties] Properties to set
                     * @returns {cockroach.server.serverpb.EventsResponse.Event} Event instance
                     */
                    public static create(properties?: cockroach.server.serverpb.EventsResponse.Event$Properties): cockroach.server.serverpb.EventsResponse.Event;

                    /**
                     * Encodes the specified Event message. Does not implicitly {@link cockroach.server.serverpb.EventsResponse.Event.verify|verify} messages.
                     * @param {cockroach.server.serverpb.EventsResponse.Event$Properties} message Event message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    public static encode(message: cockroach.server.serverpb.EventsResponse.Event$Properties, writer?: $protobuf.Writer): $protobuf.Writer;

                    /**
                     * Encodes the specified Event message, length delimited. Does not implicitly {@link cockroach.server.serverpb.EventsResponse.Event.verify|verify} messages.
                     * @param {cockroach.server.serverpb.EventsResponse.Event$Properties} message Event message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    public static encodeDelimited(message: cockroach.server.serverpb.EventsResponse.Event$Properties, writer?: $protobuf.Writer): $protobuf.Writer;

                    /**
                     * Decodes an Event message from the specified reader or buffer.
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {cockroach.server.serverpb.EventsResponse.Event} Event
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cockroach.server.serverpb.EventsResponse.Event;

                    /**
                     * Decodes an Event message from the specified reader or buffer, length delimited.
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {cockroach.server.serverpb.EventsResponse.Event} Event
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cockroach.server.serverpb.EventsResponse.Event;

                    /**
                     * Verifies an Event message.
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {?string} `null` if valid, otherwise the reason why it is not
                     */
                    public static verify(message: { [k: string]: any }): string;

                    /**
                     * Creates an Event message from a plain object. Also converts values to their respective internal types.
                     * @param {Object.<string,*>} object Plain object
                     * @returns {cockroach.server.serverpb.EventsResponse.Event} Event
                     */
                    public static fromObject(object: { [k: string]: any }): cockroach.server.serverpb.EventsResponse.Event;

                    /**
                     * Creates an Event message from a plain object. Also converts values to their respective internal types.
                     * This is an alias of {@link cockroach.server.serverpb.EventsResponse.Event.fromObject}.
                     * @function
                     * @param {Object.<string,*>} object Plain object
                     * @returns {cockroach.server.serverpb.EventsResponse.Event} Event
                     */
                    public static from(object: { [k: string]: any }): cockroach.server.serverpb.EventsResponse.Event;

                    /**
                     * Creates a plain object from an Event message. Also converts values to other types if specified.
                     * @param {cockroach.server.serverpb.EventsResponse.Event} message Event
                     * @param {$protobuf.ConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    public static toObject(message: cockroach.server.serverpb.EventsResponse.Event, options?: $protobuf.ConversionOptions): { [k: string]: any };

                    /**
                     * Creates a plain object from this Event message. Also converts values to other types if specified.
                     * @param {$protobuf.ConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    public toObject(options?: $protobuf.ConversionOptions): { [k: string]: any };

                    /**
                     * Converts this Event to JSON.
                     * @returns {Object.<string,*>} JSON object
                     */
                    public toJSON(): { [k: string]: any };
                }

                namespace Event {

                    /**
                     * Properties of a Timestamp.
                     * @typedef cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties
                     * @type Object
                     * @property {Long} [sec] Timestamp sec.
                     * @property {number} [nsec] Timestamp nsec.
                     */
                    type Timestamp$Properties = {
                        sec?: Long;
                        nsec?: number;
                    };

                    /**
                     * Constructs a new Timestamp.
                     * @exports cockroach.server.serverpb.EventsResponse.Event.Timestamp
                     * @implements cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties
                     * @constructor
                     * @param {cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties=} [properties] Properties to set
                     */
                    class Timestamp implements cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties {

                        /**
                         * Constructs a new Timestamp.
                         * @exports cockroach.server.serverpb.EventsResponse.Event.Timestamp
                         * @implements cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties
                         * @constructor
                         * @param {cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties=} [properties] Properties to set
                         */
                        constructor(properties?: cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties);

                        /**
                         * @type {Long|undefined}
                         */
                        public sec?: Long;

                        /**
                         * @type {number|undefined}
                         */
                        public nsec?: number;

                        /**
                         * Creates a new Timestamp instance using the specified properties.
                         * @param {cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties=} [properties] Properties to set
                         * @returns {cockroach.server.serverpb.EventsResponse.Event.Timestamp} Timestamp instance
                         */
                        public static create(properties?: cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties): cockroach.server.serverpb.EventsResponse.Event.Timestamp;

                        /**
                         * Encodes the specified Timestamp message. Does not implicitly {@link cockroach.server.serverpb.EventsResponse.Event.Timestamp.verify|verify} messages.
                         * @param {cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties} message Timestamp message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        public static encode(message: cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties, writer?: $protobuf.Writer): $protobuf.Writer;

                        /**
                         * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link cockroach.server.serverpb.EventsResponse.Event.Timestamp.verify|verify} messages.
                         * @param {cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties} message Timestamp message or plain object to encode
                         * @param {$protobuf.Writer} [writer] Writer to encode to
                         * @returns {$protobuf.Writer} Writer
                         */
                        public static encodeDelimited(message: cockroach.server.serverpb.EventsResponse.Event.Timestamp$Properties, writer?: $protobuf.Writer): $protobuf.Writer;

                        /**
                         * Decodes a Timestamp message from the specified reader or buffer.
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @param {number} [length] Message length if known beforehand
                         * @returns {cockroach.server.serverpb.EventsResponse.Event.Timestamp} Timestamp
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cockroach.server.serverpb.EventsResponse.Event.Timestamp;

                        /**
                         * Decodes a Timestamp message from the specified reader or buffer, length delimited.
                         * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                         * @returns {cockroach.server.serverpb.EventsResponse.Event.Timestamp} Timestamp
                         * @throws {Error} If the payload is not a reader or valid buffer
                         * @throws {$protobuf.util.ProtocolError} If required fields are missing
                         */
                        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cockroach.server.serverpb.EventsResponse.Event.Timestamp;

                        /**
                         * Verifies a Timestamp message.
                         * @param {Object.<string,*>} message Plain object to verify
                         * @returns {?string} `null` if valid, otherwise the reason why it is not
                         */
                        public static verify(message: { [k: string]: any }): string;

                        /**
                         * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
                         * @param {Object.<string,*>} object Plain object
                         * @returns {cockroach.server.serverpb.EventsResponse.Event.Timestamp} Timestamp
                         */
                        public static fromObject(object: { [k: string]: any }): cockroach.server.serverpb.EventsResponse.Event.Timestamp;

                        /**
                         * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
                         * This is an alias of {@link cockroach.server.serverpb.EventsResponse.Event.Timestamp.fromObject}.
                         * @function
                         * @param {Object.<string,*>} object Plain object
                         * @returns {cockroach.server.serverpb.EventsResponse.Event.Timestamp} Timestamp
                         */
                        public static from(object: { [k: string]: any }): cockroach.server.serverpb.EventsResponse.Event.Timestamp;

                        /**
                         * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
                         * @param {cockroach.server.serverpb.EventsResponse.Event.Timestamp} message Timestamp
                         * @param {$protobuf.ConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        public static toObject(message: cockroach.server.serverpb.EventsResponse.Event.Timestamp, options?: $protobuf.ConversionOptions): { [k: string]: any };

                        /**
                         * Creates a plain object from this Timestamp message. Also converts values to other types if specified.
                         * @param {$protobuf.ConversionOptions} [options] Conversion options
                         * @returns {Object.<string,*>} Plain object
                         */
                        public toObject(options?: $protobuf.ConversionOptions): { [k: string]: any };

                        /**
                         * Converts this Timestamp to JSON.
                         * @returns {Object.<string,*>} JSON object
                         */
                        public toJSON(): { [k: string]: any };
                    }
                }
            }

Given the proto:

syntax = "proto3";
package cockroach.server.serverpb;
option go_package = "serverpb";

// GetUIDataResponse contains the requested values and the times at which
// the values were last updated.
message GetUIDataResponse {
  // Timestamp is embedded in each place it's used, because proto3 defines a
  // built-in Timestamp message that we can't use, because gogoprotobuf doesn't
  // support all proto3 protobuf types yet. See gogoprotobuf issue #113.
  message Timestamp {
    // The time in seconds since, January 1, 1970 UTC (Unix time).
    int64 sec = 1;
    // nsec specifies a non-negative nanosecond offset within sec.
    // It must be in the range [0, 999999999].
    uint32 nsec = 2;
  }

  message Value {
    // value is the value of the requested key.
    bytes value = 1;

    // last_updated is the time at which the value was last updated.
    Timestamp last_updated = 2 [(gogoproto.nullable) = false];
  }

  // key_values maps keys to their retrieved values. If this doesn't contain a
  // a requested key, that key was not found.
  map<string, Value> key_values = 1 [(gogoproto.nullable) = false];
}

Value$Properties below has last_updated?: any;:

            namespace GetUIDataResponse {

                /**
                 * Properties of a Timestamp.
                 * @typedef cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties
                 * @type Object
                 * @property {Long} [sec] Timestamp sec.
                 * @property {number} [nsec] Timestamp nsec.
                 */
                type Timestamp$Properties = {
                    sec?: Long;
                    nsec?: number;
                };

                /**
                 * Constructs a new Timestamp.
                 * @exports cockroach.server.serverpb.GetUIDataResponse.Timestamp
                 * @implements cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties
                 * @constructor
                 * @param {cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties=} [properties] Properties to set
                 */
                class Timestamp implements cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties {

                    /**
                     * Constructs a new Timestamp.
                     * @exports cockroach.server.serverpb.GetUIDataResponse.Timestamp
                     * @implements cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties
                     * @constructor
                     * @param {cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties=} [properties] Properties to set
                     */
                    constructor(properties?: cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties);

                    /**
                     * @type {Long|undefined}
                     */
                    public sec?: Long;

                    /**
                     * @type {number|undefined}
                     */
                    public nsec?: number;

                    /**
                     * Creates a new Timestamp instance using the specified properties.
                     * @param {cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties=} [properties] Properties to set
                     * @returns {cockroach.server.serverpb.GetUIDataResponse.Timestamp} Timestamp instance
                     */
                    public static create(properties?: cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties): cockroach.server.serverpb.GetUIDataResponse.Timestamp;

                    /**
                     * Encodes the specified Timestamp message. Does not implicitly {@link cockroach.server.serverpb.GetUIDataResponse.Timestamp.verify|verify} messages.
                     * @param {cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties} message Timestamp message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    public static encode(message: cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties, writer?: $protobuf.Writer): $protobuf.Writer;

                    /**
                     * Encodes the specified Timestamp message, length delimited. Does not implicitly {@link cockroach.server.serverpb.GetUIDataResponse.Timestamp.verify|verify} messages.
                     * @param {cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties} message Timestamp message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    public static encodeDelimited(message: cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties, writer?: $protobuf.Writer): $protobuf.Writer;

                    /**
                     * Decodes a Timestamp message from the specified reader or buffer.
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {cockroach.server.serverpb.GetUIDataResponse.Timestamp} Timestamp
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cockroach.server.serverpb.GetUIDataResponse.Timestamp;

                    /**
                     * Decodes a Timestamp message from the specified reader or buffer, length delimited.
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {cockroach.server.serverpb.GetUIDataResponse.Timestamp} Timestamp
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cockroach.server.serverpb.GetUIDataResponse.Timestamp;

                    /**
                     * Verifies a Timestamp message.
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {?string} `null` if valid, otherwise the reason why it is not
                     */
                    public static verify(message: { [k: string]: any }): string;

                    /**
                     * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
                     * @param {Object.<string,*>} object Plain object
                     * @returns {cockroach.server.serverpb.GetUIDataResponse.Timestamp} Timestamp
                     */
                    public static fromObject(object: { [k: string]: any }): cockroach.server.serverpb.GetUIDataResponse.Timestamp;

                    /**
                     * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
                     * This is an alias of {@link cockroach.server.serverpb.GetUIDataResponse.Timestamp.fromObject}.
                     * @function
                     * @param {Object.<string,*>} object Plain object
                     * @returns {cockroach.server.serverpb.GetUIDataResponse.Timestamp} Timestamp
                     */
                    public static from(object: { [k: string]: any }): cockroach.server.serverpb.GetUIDataResponse.Timestamp;

                    /**
                     * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
                     * @param {cockroach.server.serverpb.GetUIDataResponse.Timestamp} message Timestamp
                     * @param {$protobuf.ConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    public static toObject(message: cockroach.server.serverpb.GetUIDataResponse.Timestamp, options?: $protobuf.ConversionOptions): { [k: string]: any };

                    /**
                     * Creates a plain object from this Timestamp message. Also converts values to other types if specified.
                     * @param {$protobuf.ConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    public toObject(options?: $protobuf.ConversionOptions): { [k: string]: any };

                    /**
                     * Converts this Timestamp to JSON.
                     * @returns {Object.<string,*>} JSON object
                     */
                    public toJSON(): { [k: string]: any };
                }

                /**
                 * Properties of a Value.
                 * @typedef cockroach.server.serverpb.GetUIDataResponse.Value$Properties
                 * @type Object
                 * @property {Uint8Array} [value] Value value.
                 * @property {*} [last_updated] Value last_updated.
                 */
                type Value$Properties = {
                    value?: Uint8Array;
                    last_updated?: any;
                };

                /**
                 * Constructs a new Value.
                 * @exports cockroach.server.serverpb.GetUIDataResponse.Value
                 * @implements cockroach.server.serverpb.GetUIDataResponse.Value$Properties
                 * @constructor
                 * @param {cockroach.server.serverpb.GetUIDataResponse.Value$Properties=} [properties] Properties to set
                 */
                class Value implements cockroach.server.serverpb.GetUIDataResponse.Value$Properties {

                    /**
                     * Constructs a new Value.
                     * @exports cockroach.server.serverpb.GetUIDataResponse.Value
                     * @implements cockroach.server.serverpb.GetUIDataResponse.Value$Properties
                     * @constructor
                     * @param {cockroach.server.serverpb.GetUIDataResponse.Value$Properties=} [properties] Properties to set
                     */
                    constructor(properties?: cockroach.server.serverpb.GetUIDataResponse.Value$Properties);

                    /**
                     * @type {Uint8Array|undefined}
                     */
                    public value?: Uint8Array;

                    /**
                     * @type {cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties|undefined}
                     */
                    public last_updated?: cockroach.server.serverpb.GetUIDataResponse.Timestamp$Properties;

                    /**
                     * Creates a new Value instance using the specified properties.
                     * @param {cockroach.server.serverpb.GetUIDataResponse.Value$Properties=} [properties] Properties to set
                     * @returns {cockroach.server.serverpb.GetUIDataResponse.Value} Value instance
                     */
                    public static create(properties?: cockroach.server.serverpb.GetUIDataResponse.Value$Properties): cockroach.server.serverpb.GetUIDataResponse.Value;

                    /**
                     * Encodes the specified Value message. Does not implicitly {@link cockroach.server.serverpb.GetUIDataResponse.Value.verify|verify} messages.
                     * @param {cockroach.server.serverpb.GetUIDataResponse.Value$Properties} message Value message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    public static encode(message: cockroach.server.serverpb.GetUIDataResponse.Value$Properties, writer?: $protobuf.Writer): $protobuf.Writer;

                    /**
                     * Encodes the specified Value message, length delimited. Does not implicitly {@link cockroach.server.serverpb.GetUIDataResponse.Value.verify|verify} messages.
                     * @param {cockroach.server.serverpb.GetUIDataResponse.Value$Properties} message Value message or plain object to encode
                     * @param {$protobuf.Writer} [writer] Writer to encode to
                     * @returns {$protobuf.Writer} Writer
                     */
                    public static encodeDelimited(message: cockroach.server.serverpb.GetUIDataResponse.Value$Properties, writer?: $protobuf.Writer): $protobuf.Writer;

                    /**
                     * Decodes a Value message from the specified reader or buffer.
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @param {number} [length] Message length if known beforehand
                     * @returns {cockroach.server.serverpb.GetUIDataResponse.Value} Value
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cockroach.server.serverpb.GetUIDataResponse.Value;

                    /**
                     * Decodes a Value message from the specified reader or buffer, length delimited.
                     * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
                     * @returns {cockroach.server.serverpb.GetUIDataResponse.Value} Value
                     * @throws {Error} If the payload is not a reader or valid buffer
                     * @throws {$protobuf.util.ProtocolError} If required fields are missing
                     */
                    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cockroach.server.serverpb.GetUIDataResponse.Value;

                    /**
                     * Verifies a Value message.
                     * @param {Object.<string,*>} message Plain object to verify
                     * @returns {?string} `null` if valid, otherwise the reason why it is not
                     */
                    public static verify(message: { [k: string]: any }): string;

                    /**
                     * Creates a Value message from a plain object. Also converts values to their respective internal types.
                     * @param {Object.<string,*>} object Plain object
                     * @returns {cockroach.server.serverpb.GetUIDataResponse.Value} Value
                     */
                    public static fromObject(object: { [k: string]: any }): cockroach.server.serverpb.GetUIDataResponse.Value;

                    /**
                     * Creates a Value message from a plain object. Also converts values to their respective internal types.
                     * This is an alias of {@link cockroach.server.serverpb.GetUIDataResponse.Value.fromObject}.
                     * @function
                     * @param {Object.<string,*>} object Plain object
                     * @returns {cockroach.server.serverpb.GetUIDataResponse.Value} Value
                     */
                    public static from(object: { [k: string]: any }): cockroach.server.serverpb.GetUIDataResponse.Value;

                    /**
                     * Creates a plain object from a Value message. Also converts values to other types if specified.
                     * @param {cockroach.server.serverpb.GetUIDataResponse.Value} message Value
                     * @param {$protobuf.ConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    public static toObject(message: cockroach.server.serverpb.GetUIDataResponse.Value, options?: $protobuf.ConversionOptions): { [k: string]: any };

                    /**
                     * Creates a plain object from this Value message. Also converts values to other types if specified.
                     * @param {$protobuf.ConversionOptions} [options] Conversion options
                     * @returns {Object.<string,*>} Plain object
                     */
                    public toObject(options?: $protobuf.ConversionOptions): { [k: string]: any };

                    /**
                     * Converts this Value to JSON.
                     * @returns {Object.<string,*>} JSON object
                     */
                    public toJSON(): { [k: string]: any };
                }
            }

dcodeIO added a commit that referenced this issue Mar 27, 2017

@tamird

This comment has been minimized.

tamird commented Mar 27, 2017

Your change seems to have fixed this issue, but also has introduced a new one. This is the diff (note that a bunch of implements Foo$Properties have been lost): https://gist.github.com/tamird/e608926392befd0b6dc51e879c96ac15.

@dcodeIO

This comment has been minimized.

Owner

dcodeIO commented Mar 27, 2017

The diff looks good to me. Implements is gone / properties are (documented) on classes because of #723 - but it should still properly typecheck because class instances still satisfy the type.

@tamird

This comment has been minimized.

tamird commented Mar 27, 2017

Ah, OK.

@tamird tamird closed this Mar 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment