diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..26c2f51 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,10 @@ +type Comment = { + type: 'BlockComment' | 'LineComment'; + raw: string; + value: string; + range: [number, number]; +}; + +declare function extractComments(str: string): Comment[]; + +export = extractComments; diff --git a/package.json b/package.json index fb5cf3e..6cc177e 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,10 @@ "license": "MIT", "repository": "github:prettier-solidity/solidity-comments-extractor", "homepage": "https://github.com/prettier-solidity/solidity-comments-extractor", + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, "scripts": { "lint": "eslint '**/*.js'", "prettier": "prettier '**/*.js'",