@gukhanmun/types 0.3.0-dev.196 → 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.
- package/dist/index.d.ts +48 -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
|
*
|
|
@@ -479,7 +523,9 @@ interface Gukhanmun {
|
|
|
479
523
|
* `originalGloss`, which are not meaningfully representable as plain
|
|
480
524
|
* values.
|
|
481
525
|
*/
|
|
482
|
-
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
|
+
}>;
|
|
483
529
|
}
|
|
484
530
|
/**
|
|
485
531
|
* Factory interface satisfied by both `@gukhanmun/wasm` and
|
|
@@ -578,4 +624,4 @@ declare class GukhanmunError extends Error {
|
|
|
578
624
|
}[];
|
|
579
625
|
}
|
|
580
626
|
//#endregion
|
|
581
|
-
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 };
|