diff --git a/types/resolve-protobuf-schema/index.d.ts b/types/resolve-protobuf-schema/index.d.ts new file mode 100644 index 0000000000..247b91c27d --- /dev/null +++ b/types/resolve-protobuf-schema/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for resolve-protobuf-schema 2.1 +// Project: https://github.com/mafintosh/resolve-protobuf-schema +// Definitions by: Claas Ahlrichs +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.7 + +import { Schema } from 'protocol-buffers-schema/types'; + +declare namespace ResolveProtobufSchema { + function sync(file: string): Schema; +} + +declare function ResolveProtobufSchema(file: string, callback: (error: Error | null, schema?: Schema) => void): void; +export = ResolveProtobufSchema; diff --git a/types/resolve-protobuf-schema/resolve-protobuf-schema-tests.ts b/types/resolve-protobuf-schema/resolve-protobuf-schema-tests.ts new file mode 100644 index 0000000000..f4d492054f --- /dev/null +++ b/types/resolve-protobuf-schema/resolve-protobuf-schema-tests.ts @@ -0,0 +1,9 @@ +import resolve from 'resolve-protobuf-schema'; + +// resolve.sync(path) sync version of resolve +resolve.sync('./test.proto'); + +// resolve(path, cb) read and resolve a schema +resolve('./test.proto', (error, schema) => { + // ... +}); diff --git a/types/resolve-protobuf-schema/tsconfig.json b/types/resolve-protobuf-schema/tsconfig.json new file mode 100644 index 0000000000..73d14fed36 --- /dev/null +++ b/types/resolve-protobuf-schema/tsconfig.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "resolve-protobuf-schema-tests.ts" + ] +} diff --git a/types/resolve-protobuf-schema/tslint.json b/types/resolve-protobuf-schema/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/resolve-protobuf-schema/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }