Skip to content

Commit

Permalink
update ExpensiMark types to include extras object
Browse files Browse the repository at this point in the history
  • Loading branch information
robertKozik committed Apr 17, 2024
1 parent f81aca3 commit 9848b00
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/ExpensiMark.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
declare type Replacement = (...args: string[]) => string;
declare type Replacement = (...args: string[], extras?: ExtrasObject) => string;
declare type Name =
| 'codeFence'
| 'inlineCodeBlock'
| 'email'
| 'link'
| 'hereMentions'
| 'roomMentions'
| 'userMentions'
| 'autoEmail'
| 'autolink'
Expand Down Expand Up @@ -32,6 +33,11 @@ declare type Rule = {
pre?: (input: string) => string;
post?: (input: string) => string;
};

declare type ExtrasObject = {
reportIdToName?: Record<string, string>;
accountIDToName?: Record<string, string>;
};
export default class ExpensiMark {
rules: Rule[];
htmlToMarkdownRules: Rule[];
Expand Down Expand Up @@ -91,14 +97,14 @@ export default class ExpensiMark {
* @param htmlString
* @param extras
*/
htmlToMarkdown(htmlString: string, extras?: Object): string;
htmlToMarkdown(htmlString: string, extras?: ExtrasObject): string;
/**
* Convert HTML to text
*
* @param htmlString
* @param extras
*/
htmlToText(htmlString: string, extras?: Object): string;
htmlToText(htmlString: string, extras?: ExtrasObject): string;
/**
* Modify text for Quotes replacing chevrons with html elements
*
Expand Down

0 comments on commit 9848b00

Please sign in to comment.