Skip to content

Commit

Permalink
feat: add d.ts for the main converter function to support TypeScript
Browse files Browse the repository at this point in the history
Closes #9
  • Loading branch information
skoropadas committed Jul 22, 2024
1 parent 5b75aeb commit 5c42d89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"remark",
"unified"
],
"types": "types/index.d.ts",
"author": "Skoropad Aleksandr <[email protected]>",
"license": "MIT",
"bugs": {
Expand Down
13 changes: 13 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
export type UnsupportedTagsStrategy = 'escape' | 'remove' | 'keep'

declare module 'telegramify-markdown' {

/**
* Converts markdown to Telegram's format.
* @param markdown The markdown to convert.
* @param unsupportedTagsStrategy The strategy to use for unsupported tags.
*/
function convert(markdown: string, unsupportedTagsStrategy: UnsupportedTagsStrategy): string

export = convert
}

0 comments on commit 5c42d89

Please sign in to comment.