Disallow group names longer than 32 extended graphemes
This commit is contained in:
parent
934e0fa415
commit
ecc04d36de
12 changed files with 302 additions and 46 deletions
27
ts/Intl.d.ts
vendored
Normal file
27
ts/Intl.d.ts
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
declare namespace Intl {
|
||||
type SegmenterOptions = {
|
||||
granularity?: 'grapheme' | 'word' | 'sentence';
|
||||
};
|
||||
|
||||
type SegmentData = {
|
||||
index: number;
|
||||
input: string;
|
||||
segment: string;
|
||||
};
|
||||
|
||||
interface Segments {
|
||||
containing(index: number): SegmentData;
|
||||
|
||||
[Symbol.iterator](): Iterator<SegmentData>;
|
||||
}
|
||||
|
||||
// `Intl.Segmenter` is not yet in TypeScript's type definitions, so we add it.
|
||||
class Segmenter {
|
||||
constructor(locale?: string, options?: SegmenterOptions);
|
||||
|
||||
segment(str: string): Segments;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue