diff --git a/types/node-emoji/index.d.ts b/types/node-emoji/index.d.ts index 5f4d050fb3..f07b12372c 100644 --- a/types/node-emoji/index.d.ts +++ b/types/node-emoji/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/omnidan/node-emoji#readme // Definitions by: Tristan Jones // styu +// rimiti // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped export const emoji: { @@ -1362,4 +1363,4 @@ export function unemojify(str: string): string; export function find(emoji: string): Emoji; export function hasEmoji(str: string): boolean; export function strip(str: string): string; -export function replace(str: string, callback: (emoji: Emoji) => string): string; +export function replace(str: string, replacement: ((emoji: Emoji) => string) | string, cleanSpaces?: boolean): string; diff --git a/types/node-emoji/node-emoji-tests.ts b/types/node-emoji/node-emoji-tests.ts index 918cb1e1f5..11e4788936 100644 --- a/types/node-emoji/node-emoji-tests.ts +++ b/types/node-emoji/node-emoji-tests.ts @@ -25,3 +25,7 @@ const hasEmoji: boolean = emoji.hasEmoji('🍕'); const stripped_emoji: string = emoji.strip('⚠️ 〰️ 〰️ low disk space'); const replaced_emoji: string = emoji.replace('⚠️ 〰️ 〰️ low disk space', (emoji) => `${emoji.key}:`); + +const replaced_emoji_with_string: string = emoji.replace('⚠️ 〰️ 〰️ low disk space', 'example'); + +const replaced_emoji_keep_spaces: string = emoji.replace('⚠️ 〰️ 〰️ low disk space', '', false);