Skip to content

Commit

Permalink
Merge pull request #44 from rwalle61/add-typescript-declaration-file
Browse files Browse the repository at this point in the history
add TypeScript declaration file
  • Loading branch information
WaleedAshraf authored Sep 30, 2021
2 parents ba4b3b9 + a32c839 commit 8e2f4ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
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 'asyncapi-validator' {
type Validator = {
validate: (
key: string,
payload: unknown,
channel: string,
operation: 'publish' | 'subscribe',
) => void;
};

const fromSource: (
path: string | Record<string, unknown>,
options: { msgIdentifier: string; ignoreArray?: boolean },
) => Promise<Validator>;
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "3.1.0",
"description": "message validator through asyncapi schema",
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"test": "jest",
"lint": "./node_modules/.bin/eslint ./"
Expand Down

0 comments on commit 8e2f4ca

Please sign in to comment.