namespace-guard 0.17.0 → 0.17.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -5,6 +5,10 @@ type LlmConfusableMapEntry = {
5
5
  source: LlmConfusableSource;
6
6
  script: string;
7
7
  codepoint: string;
8
+ /** Width ratio between source and target at natural rendering size. Null if not measured. */
9
+ widthRatio?: number | null;
10
+ /** Height ratio between source and target at natural rendering size. Null if not measured. */
11
+ heightRatio?: number | null;
8
12
  };
9
13
  type LlmConfusableMap = Readonly<Record<string, readonly LlmConfusableMapEntry[]>>;
10
14
  declare const LLM_CONFUSABLE_MAP: LlmConfusableMap;
@@ -174,6 +178,18 @@ type CanonicaliseOptions = {
174
178
  * every character in a word.
175
179
  */
176
180
  strategy?: "mixed" | "all";
181
+ /**
182
+ * Maximum allowed width or height ratio between source and target at natural
183
+ * rendering size (default: `3.0`). Pairs where the source character is more
184
+ * than this many times wider or taller than the Latin target are skipped,
185
+ * because the size difference would be visible in running text even if the
186
+ * shapes match after normalisation.
187
+ *
188
+ * Set to `Infinity` to disable size-ratio filtering. Set to `2.0` for
189
+ * stricter filtering. Only applies to novel (non-TR39) pairs that have
190
+ * measured size ratios.
191
+ */
192
+ maxSizeRatio?: number;
177
193
  };
178
194
  /** Options for `scan()` and `isClean()`. */
179
195
  type ScanOptions = CanonicaliseOptions & {
package/dist/index.d.ts CHANGED
@@ -5,6 +5,10 @@ type LlmConfusableMapEntry = {
5
5
  source: LlmConfusableSource;
6
6
  script: string;
7
7
  codepoint: string;
8
+ /** Width ratio between source and target at natural rendering size. Null if not measured. */
9
+ widthRatio?: number | null;
10
+ /** Height ratio between source and target at natural rendering size. Null if not measured. */
11
+ heightRatio?: number | null;
8
12
  };
9
13
  type LlmConfusableMap = Readonly<Record<string, readonly LlmConfusableMapEntry[]>>;
10
14
  declare const LLM_CONFUSABLE_MAP: LlmConfusableMap;
@@ -174,6 +178,18 @@ type CanonicaliseOptions = {
174
178
  * every character in a word.
175
179
  */
176
180
  strategy?: "mixed" | "all";
181
+ /**
182
+ * Maximum allowed width or height ratio between source and target at natural
183
+ * rendering size (default: `3.0`). Pairs where the source character is more
184
+ * than this many times wider or taller than the Latin target are skipped,
185
+ * because the size difference would be visible in running text even if the
186
+ * shapes match after normalisation.
187
+ *
188
+ * Set to `Infinity` to disable size-ratio filtering. Set to `2.0` for
189
+ * stricter filtering. Only applies to novel (non-TR39) pairs that have
190
+ * measured size ratios.
191
+ */
192
+ maxSizeRatio?: number;
177
193
  };
178
194
  /** Options for `scan()` and `isClean()`. */
179
195
  type ScanOptions = CanonicaliseOptions & {