Skip to content

Commit

Permalink
Add types
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-kang committed Sep 15, 2024
1 parent 59dc8aa commit 87a4b36
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
declare module 'email-forward-parser' {
class EmailForwardParser {
read(
body: string,
subject?: string,
): {
forwarded: boolean
message: string | null
email: {
body: string
from: {
address: string
name: string | null
}
to:
| {
address: string
name: string | null
}
| {
address: string
name: string | null
}[]
| null
| undefined
cc:
| {
address: string
name: string | null
}
| {
address: string
name: string | null
}[]
| null
| undefined
subject: string | null
date: string | null
}
}
}

export default EmailForwardParser
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Parses forwarded emails and extract content",
"author": "Eliott Vincent <eliott@crisp.chat>",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"homepage": "https://github.com/crisp-oss/email-forward-parser",
"repository": {
"type": "git",
Expand Down

0 comments on commit 87a4b36

Please # to comment.