For AI agents: the complete documentation index is available at https://canary.gukhanmun.org/ko-KR/llms.txt, the full documentation bundle is available at https://canary.gukhanmun.org/ko-KR/llms-full.txt, and this page is available as Markdown at https://canary.gukhanmun.org/ko-KR/guide/javascript/directives.md.
  • 한국어 (한글)
  • 지시

    directives 옵션을 사용하면 특정 한자 문자에 대해 병기 표지를 덮어쓸 수 있습니다.

    지시 인터페이스(interface)

    interface Directives {
      
    Directives.requireHanja?: string[] | undefined
    requireHanja
    ?: string[]; // 出力에 漢字를 恒常 表示
    Directives.requireHangul?: string[] | undefined
    requireHangul
    ?: string[]; // 한글 讀音을 恒常 表示("original" 모드用)
    Directives.skipAnnotation?: string[] | undefined
    skipAnnotation
    ?: string[]; // 倂記를 全的으로 抑制
    }

    각 배열은 표지를 덮어쓰려는 한자 문자열을 담습니다:

    import { 
    function load(options?: GukhanmunLoadOptions): Promise<Gukhanmun>

    Creates a Gukhanmun converter with the given options.

    Initialises the WASM module on the first call (subsequent calls reuse the cached module). Compiled dictionaries supplied via GukhanmunOptions.dictionaries are fetched, while MapDictionarySource entry lists are serialised and built in memory as Rust MapDictionary values.

    Note: unlike the Rust ko-kr preset, the JavaScript preset never includes a bundled dictionary. Pass dictionaries: [await stdictFst()] to include the Standard Korean Language Dictionary.

    @paramoptions - Conversion options. All fields are optional; defaults match the ko-kr preset.@returnsA Gukhanmun instance.@throws{@linkGukhanmunError } on invalid options or dictionary load failure.
    load
    } from "@gukhanmun/wasm";
    import {
    function stdictFst(): Promise<FileDictionarySource>

    Loads the bundled Standard Korean Language Dictionary as a

    FileDictionarySource ready to pass to load({ dictionaries: [...] }).

    @returnsA FileDictionarySource with format: "fst" and role: "reference".
    stdictFst
    } from "@gukhanmun/stdict-fst";
    const
    const g: Gukhanmun
    g
    = await
    function load(options?: GukhanmunLoadOptions): Promise<Gukhanmun>

    Creates a Gukhanmun converter with the given options.

    Initialises the WASM module on the first call (subsequent calls reuse the cached module). Compiled dictionaries supplied via GukhanmunOptions.dictionaries are fetched, while MapDictionarySource entry lists are serialised and built in memory as Rust MapDictionary values.

    Note: unlike the Rust ko-kr preset, the JavaScript preset never includes a bundled dictionary. Pass dictionaries: [await stdictFst()] to include the Standard Korean Language Dictionary.

    @paramoptions - Conversion options. All fields are optional; defaults match the ko-kr preset.@returnsA Gukhanmun instance.@throws{@linkGukhanmunError } on invalid options or dictionary load failure.
    load
    ({
    dictionaries?: readonly (DictionarySource | LoadedDictionary)[] | undefined
    dictionaries
    : [await
    function stdictFst(): Promise<FileDictionarySource>

    Loads the bundled Standard Korean Language Dictionary as a

    FileDictionarySource ready to pass to load({ dictionaries: [...] }).

    @returnsA FileDictionarySource with format: "fst" and role: "reference".
    stdictFst
    ()],
    directives?: Directives | undefined

    Per-hanja rendering directives that override dictionary marks.

    @seeDirectives
    directives
    : {
    Directives.requireHanja?: readonly string[] | undefined

    Hanja forms that must always be shown with their original hanja alongside the hangul reading, as if requireHanja were set in the dictionary.

    requireHanja
    : ["漢", "字"],
    Directives.requireHangul?: readonly string[] | undefined

    Hanja forms that must always be shown with a hangul gloss alongside the original hanja (relevant for rendering: "original").

    requireHangul
    : ["東"],
    Directives.skipAnnotation?: readonly string[] | undefined

    Hanja forms whose annotation should be suppressed entirely; the renderer emits only the primary plain text form (hangul or hanja depending on rendering).

    skipAnnotation
    : ["中"],
    }, });

    렌더링 모드와의 결합

    지시는 활성 렌더링 모드와 상호작용합니다:

    • requireHanja는 "hangul-only" 모드에서 가장 잘 드러나며, 한자가 한글 독음 곁에 나타나도록 강제합니다.
    • requireHangul은 "original" 모드에서 특정 문자의 한글 병기를 강제하는 데 유용합니다.
    • skipAnnotation은 모드와 무관하게 일절의 병기를 억제합니다.