Skip to content

TypeScript definition file missing static "create", "encode" and "decode" methods #820

@ben-x9

Description

@ben-x9

protobuf.js version: 6.7.3

I followed the README and ran this code to compile

$> pbjs -t static-module -w es6 -o compiled.js file1.proto file2.proto
$> pbts -o compiled.d.ts compiled.js

The generated compiled.js works fine but the compiled.d.ts file is missing static methods on all the classes:

type Success$Properties = {
    command?: CommandMsg$Properties;
};

/**
 * Constructs a new Success.
 * @exports Success
 * @constructor
 * @param {Success$Properties=} [properties] Properties to set
 */
export class Success {

    /**
     * Constructs a new Success.
     * @exports Success
     * @constructor
     * @param {Success$Properties=} [properties] Properties to set
     */
    constructor(properties?: Success$Properties);
}

type Failure$Properties = {
    type?: Failure.ErrorCode;
    details?: string;
};

/**
 * Constructs a new Failure.
 * @exports Failure
 * @constructor
 * @param {Failure$Properties=} [properties] Properties to set
 */
export class Failure {

    /**
     * Constructs a new Failure.
     * @exports Failure
     * @constructor
     * @param {Failure$Properties=} [properties] Properties to set
     */
    constructor(properties?: Failure$Properties);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions