Add type definitions for Typescript
Closed this issue · 2 comments
Pustur commented
I'd like to add type definitions but I don't have any experience with Typescript yet.
The definition would be for the public API, so just this function:
whatsapp-chat-parser/src/index.js
Line 7 in 9d78a68
The API is pretty well documented in the readme.
I'd like to have a types
folder in the root of the project, with a index.d.ts
file inside.
When done, a PR can be opened against the develop
branch.
Anyone interested in taking this? Would be very appreciated.
Cretezy commented
interface Message {
date: string;
author: string;
message: string;
}
interface ParseStringOptions {
daysFirst?: boolean;
}
export function parseString(string: string, options?: ParseStringOptions): Promise<Message[]>;
Place in root as whatsapp-chat-parser.d.ts
.
In package.json
:
- If
files
is set, add there - Add
"types": "whatsapp-chat-parser.d.ts"
on root