File: index.d.ts

package info (click to toggle)
node-yarnpkg 4.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 24,752 kB
  • sloc: javascript: 38,953; ansic: 26,035; cpp: 7,247; sh: 2,829; makefile: 724; perl: 493
file content (24 lines) | stat: -rw-r--r-- 839 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Type definitions for grapheme-splitter

/*~ Note that ES6 modules cannot directly export class objects.
 *~ This file should be imported using the CommonJS-style:
 *~
 *~   import GraphemeSplitter = require('grapheme-splitter')
 *~
 *~ Refer to the documentation to understand common
 *~ workarounds for this limitation of ES6 modules.
 *~
 *~   https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html
 */

declare class GraphemeSplitter {
  constructor();
  /** iterate the string to an iterable iterator of grapheme clusters */
  iterateGraphemes(s: string): IterableIterator<string>;
  /** split the string to an array of grapheme clusters */
  splitGraphemes(s: string): string[];
  /** count the number of grapheme clusters in a string */
  countGraphemes(s: string): number;
}

export = GraphemeSplitter;