Skip to content

Instantly share code, notes, and snippets.

@JLarky
Created August 1, 2017 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JLarky/09cce0eedb5be151a9e71dba0271c2a0 to your computer and use it in GitHub Desktop.
Save JLarky/09cce0eedb5be151a9e71dba0271c2a0 to your computer and use it in GitHub Desktop.
grapheme-splitter typescript type declaration
// import GraphemeSplitter = require("grapheme-splitter");
// console.log((new GraphemeSplitter()).splitGraphemes("πŸŒ·πŸŽπŸ’©πŸ˜œπŸ‘πŸ³οΈβ€πŸŒˆ"));
declare module 'grapheme-splitter' {
class GraphemeSplitter {
constructor();
public splitGraphemes(input: string): string[];
public countGraphemes(input: string): number;
}
export = GraphemeSplitter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment