mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #32286 from rimiti/update-node-emoji-typing
Update replace() definition from @types/node-emoji
This commit is contained in:
Vendored
+2
-1
@@ -2,6 +2,7 @@
|
||||
// Project: https://github.com/omnidan/node-emoji#readme
|
||||
// Definitions by: Tristan Jones <https://github.com/jonestristand>
|
||||
// styu <https://github.com/styu>
|
||||
// rimiti <https://github.com/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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user