Skip to content

Commit

Permalink
Add Typescript declaration file (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
singingwolfboy authored and philschatz committed Oct 16, 2019
1 parent 2f0c54d commit dc83503
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
declare module 'fetch-vcr' {
function fetchVCR(url: string, args: object): Promise<any>;

interface Config {
mode?: 'playback' | 'cache' | 'record' | 'erase';
fixturePath?: string;
ignoreUrls?: string[];
headerBlacklist?: string[]
}
namespace fetchVCR {
function configure(config: Config): void;
function loadFile(root: string, filename: string): Promise<string>;
function saveFile(root: string, filename: string, buffer: string): Promise<'fetch-saved'>;
function getCalled(): void;
function clearCalled(): void;
}
export default fetchVCR;
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"name": "fetch-vcr",
"description": "Stop mocking HTTP Requests. Just record and then play them back",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"scripts": {
"pretest": "./script/clean-for-test",
"test": "ava",
Expand Down

0 comments on commit dc83503

Please sign in to comment.