@types/protoc-plugin
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Installation

npm install --save @types/protoc-plugin

Summary

This package contains type definitions for protoc-plugin (https://github.com/konsumer/node-protoc-plugin/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/protoc-plugin.

index.d.ts

/// <reference types="node" />

import {
    CodeGeneratorRequest as pb_CodeGeneratorRequest,
    CodeGeneratorResponse as pb_CodeGeneratorResponse,
} from "google-protobuf/google/protobuf/compiler/plugin_pb";
import { FileDescriptorProto, SourceCodeInfo } from "google-protobuf/google/protobuf/descriptor_pb";
import * as stream from "stream";
import Location = SourceCodeInfo.Location;

type OutputFiles = pb_CodeGeneratorResponse.File.AsObject[];
type SimplePluginCallback = (
    filesToGenerate: readonly FileDescriptorProto.AsObject[],
) => OutputFiles | Promise<OutputFiles>;

declare function simplePlugin(cb: SimplePluginCallback): Promise<void>;
declare namespace simplePlugin {
    function CodeGeneratorRequest(stdin?: stream.Readable): Promise<pb_CodeGeneratorRequest>;
    function CodeGeneratorResponse(stdout?: stream.Writable): (files: OutputFiles) => void;
    function CodeGeneratorResponseError(stdout?: stream.Writable): (err: Error) => void;
    function findCommentByPath(path: number[], locationList: Location.AsObject[]): string;
}

export = simplePlugin;

Additional Details

Credits

These definitions were written by Jonny Reeves.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/protoc-plugin

Weekly Downloads

217

Version

0.0.5

License

MIT

Unpacked Size

4.94 kB

Total Files

5

Last publish

Collaborators

  • types