Skip to content

Commit

Permalink
add index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
vallyian committed Jan 4, 2022
1 parent 819b9ea commit 6fb564d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ require("protoc-binary").binary;
### `version`

```js
/* Returns version of local protoc binary version */
/* Returns version of local protoc binary */
require("protoc-binary").version;
```

Expand Down
15 changes: 15 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
declare module "protoc-binary" {
/** Absolute path to local protoc binary */
export const binary: string;

/** Version of local protoc binary */
export const version: string | "";

/**
* Function wrapper for protoc binary
* @param {string[]} args protoc arguments
* @param {string} protoDir [optional] absolute path to dir containing .proto files
* @returns void
*/
export function protoc(args: string[], protoDir?: string): void;
}
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = Object.freeze({
/** Absolute path to local protoc binary */
binary: consts.binary,

/** Version of local protoc binary version, or empty string */
/** Version of local protoc binary, or empty string */
get version() { return getBinaryVersion(); },

protoc
Expand Down

0 comments on commit 6fb564d

Please sign in to comment.