@gukhanmun/types 0.3.0-dev.185 → 0.3.0-dev.203

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +51 -3
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -287,6 +287,48 @@ interface Directives {
287
287
  */
288
288
  readonly skipAnnotation?: readonly string[];
289
289
  }
290
+ /** Policy for ordinary spaces following an eligible stop. */
291
+ type SpaceAfter = "preserve" | "remove" | "single";
292
+ /** Built-in output style; input recognition is independent of this choice. */
293
+ type PunctuationPreset = "preserve" | "modern" | "traditional" | "traditional-vertical";
294
+ /** A single Unicode scalar and its following U+0020 policy. */
295
+ interface StopStyle {
296
+ /** One Unicode scalar, validated by the shared profile resolver. */
297
+ readonly mark: string;
298
+ /** Policy applied only to U+0020 following this stop. */
299
+ readonly after: SpaceAfter;
300
+ }
301
+ /** Opening and closing Unicode punctuation scalars. */
302
+ interface DelimiterStyle {
303
+ /** Opening scalar with Unicode category Ps or Pi. */
304
+ readonly open: string;
305
+ /** Closing scalar with Unicode category Pe or Pf. */
306
+ readonly close: string;
307
+ }
308
+ /** Partial overrides; omitted roles inherit, null preserves the role. */
309
+ interface CustomPunctuationProfile {
310
+ /** Inherited preset, defaulting to preserve. */
311
+ readonly base?: PunctuationPreset;
312
+ /** Comma style; omitted inherits, null preserves. */
313
+ readonly comma?: StopStyle | null;
314
+ /** Period style; omitted inherits, null preserves. */
315
+ readonly period?: StopStyle | null;
316
+ /** Single delimiters; omitted inherits, null preserves. */
317
+ readonly single?: DelimiterStyle | null;
318
+ /** Double delimiters; omitted inherits, null preserves. */
319
+ readonly double?: DelimiterStyle | null;
320
+ }
321
+ /** Fully resolved styles, copied and deeply frozen by each binding. */
322
+ interface ResolvedPunctuationProfile {
323
+ /** Comma style, or null for preservation. */
324
+ readonly comma: StopStyle | null;
325
+ /** Period style, or null for preservation. */
326
+ readonly period: StopStyle | null;
327
+ /** Single delimiters, or null for preservation. */
328
+ readonly single: DelimiterStyle | null;
329
+ /** Double delimiters, or null for preservation. */
330
+ readonly double: DelimiterStyle | null;
331
+ }
290
332
  /**
291
333
  * Full set of options passed to {@link GukhanmunFactory.load} (or the
292
334
  * top-level `load` function) to configure a {@link Gukhanmun} instance.
@@ -296,6 +338,8 @@ interface Directives {
296
338
  * given, `"ko-kr"` is implicitly used.
297
339
  */
298
340
  interface GukhanmunOptions {
341
+ /** Independent output punctuation policy. Defaults to preserve. */
342
+ readonly punctuation?: PunctuationPreset | CustomPunctuationProfile;
299
343
  /**
300
344
  * Named configuration preset. Defaults to `"ko-kr"`.
301
345
  *
@@ -398,7 +442,9 @@ interface GukhanmunOptions {
398
442
  * Korean Language Dictionary*, add `@gukhanmun/stdict-fst` or
399
443
  * `@gukhanmun/stdict-cdb` explicitly. To use Open Korean Dictionary
400
444
  * categories, add `@gukhanmun/opendict-fst` or
401
- * `@gukhanmun/opendict-cdb` explicitly.
445
+ * `@gukhanmun/opendict-cdb` explicitly. For NIKL loanword examples, load
446
+ * `@gukhanmun/loanwords-fst` or `@gukhanmun/loanwords-cdb`. Put user
447
+ * dictionaries first, then loanwords, then the preset dictionaries.
402
448
  *
403
449
  * @see {@link DictionarySource}
404
450
  */
@@ -477,7 +523,9 @@ interface Gukhanmun {
477
523
  * `originalGloss`, which are not meaningfully representable as plain
478
524
  * values.
479
525
  */
480
- readonly options: Readonly<Required<Omit<GukhanmunOptions, "dictionaries" | "directives" | "html" | "originalGloss">>>;
526
+ readonly options: Readonly<Required<Omit<GukhanmunOptions, "dictionaries" | "directives" | "html" | "originalGloss" | "punctuation">> & {
527
+ readonly punctuation: ResolvedPunctuationProfile;
528
+ }>;
481
529
  }
482
530
  /**
483
531
  * Factory interface satisfied by both `@gukhanmun/wasm` and
@@ -576,4 +624,4 @@ declare class GukhanmunError extends Error {
576
624
  }[];
577
625
  }
578
626
  //#endregion
579
- export { ContextWindow, DictionaryEntry, DictionarySource, Directives, ErrorCode, FileDictionarySource, Format, Gukhanmun, GukhanmunError, GukhanmunFactory, GukhanmunOptions, HanjaVariantSet, HomophoneDetection, HtmlOptions, NumeralStrategy, OriginalGloss, Preset, Recovery, RenderMode, Segmentation, load };
627
+ export { ContextWindow, CustomPunctuationProfile, DelimiterStyle, DictionaryEntry, DictionarySource, Directives, ErrorCode, FileDictionarySource, Format, Gukhanmun, GukhanmunError, GukhanmunFactory, GukhanmunOptions, HanjaVariantSet, HomophoneDetection, HtmlOptions, NumeralStrategy, OriginalGloss, Preset, PunctuationPreset, Recovery, RenderMode, ResolvedPunctuationProfile, Segmentation, SpaceAfter, StopStyle, load };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gukhanmun/types",
3
- "version": "0.3.0-dev.185",
3
+ "version": "0.3.0-dev.203",
4
4
  "description": "TypeScript API contract for Gukhanmun (type declarations only, no runtime code).",
5
5
  "type": "module",
6
6
  "exports": {