diff --git a/types/crpc/crpc-tests.ts b/types/crpc/crpc-tests.ts new file mode 100644 index 0000000000..ade069cbba --- /dev/null +++ b/types/crpc/crpc-tests.ts @@ -0,0 +1,3 @@ +import crpc from 'crpc'; + +const client = crpc('https://example.com/'); diff --git a/types/crpc/index.d.ts b/types/crpc/index.d.ts new file mode 100644 index 0000000000..c24b4fcc0f --- /dev/null +++ b/types/crpc/index.d.ts @@ -0,0 +1,9 @@ +// Type definitions for crpc 0.2 +// Project: https://github.com/billinghamj/crpc +// Definitions by: Alexander Forbes-Reed +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.9 + +export type Client = (path: string, body: TReq, options?: {} | null) => Promise; + +export default function crpc(baseUrl: string, options?: {}): Client; diff --git a/types/crpc/tsconfig.json b/types/crpc/tsconfig.json new file mode 100644 index 0000000000..d8c488b918 --- /dev/null +++ b/types/crpc/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "crpc-tests.ts" + ] +} diff --git a/types/crpc/tslint.json b/types/crpc/tslint.json new file mode 100644 index 0000000000..8f3d5d7eec --- /dev/null +++ b/types/crpc/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "no-unnecessary-generics": false + } +}