Skip to content

Commit f2ed2ef

Browse files
authored
Add TypeScript type definitions (#53)
1 parent ef50526 commit f2ed2ef

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
44

55
### Unreleased
66

7+
- added TypeScript type definitions
8+
79
### [2.1.3] - 2025-01-31
810

911
- dep(eslint): upgrade to v9

index.d.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
declare class Address {
2+
user: string
3+
host: string
4+
original_host?: string
5+
6+
constructor(user: string, host: string)
7+
constructor(email: string)
8+
9+
format(use_punycode?: boolean): string
10+
11+
address(newval?: string, use_punycode?: boolean): string
12+
13+
toString(): string
14+
}
15+
16+
export { Address }

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"url": "http://haraka.github.io"
88
},
99
"main": "index.js",
10+
"types": "index.d.ts",
1011
"homepage": "https://github.com/haraka/node-address-rfc2821",
1112
"keywords": [
1213
"email",

0 commit comments

Comments
 (0)