Added definitions for crpc

This commit is contained in:
Alex Forbes-Reed
2018-10-22 11:24:42 +01:00
parent 0e95a07e46
commit 2f842c7fbc
4 changed files with 40 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
import crpc from 'crpc';
const client = crpc('https://example.com/');
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for crpc 0.2
// Project: https://github.com/billinghamj/crpc
// Definitions by: Alexander Forbes-Reed <https://github.com/0xdeafcafe>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
export type Client = <TReq, TRes>(path: string, body: TReq, options?: {} | null) => Promise<TRes>;
export default function crpc(baseUrl: string, options?: {}): Client;
+22
View File
@@ -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"
]
}
+6
View File
@@ -0,0 +1,6 @@
{
"extends": "dtslint/dt.json",
"rules": {
"no-unnecessary-generics": false
}
}