harmony-next

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

HarmonyOS NEXT(离线文档导航)

HarmonyOS NEXT (Offline Documentation Navigation)

目标:在不盲读
references/
的前提下,快速定位到 1 个或少量目标 Markdown,然后只打开这些文件。
Goal: Quickly locate 1 or a small number of target Markdown files without blindly reading the contents of
references/
, and then open only these files.

渐进式披露(按顺序走)

Progressive Disclosure (Follow in order)

  1. 先缩小范围(选 Kit 或任务)
    • Kit 导航:
      references/KITS.md
    • 任务导向:
      references/TASK_MAP.md
  2. 再精确命中文件(搜路径清单)
    • 全库路径清单:
      references/INDEX.md
    • JS/ETS API 分桶清单:
      references/JsEtsAPIReference/INDEX.md
  3. 仅在必要时浏览目录
    references/JsEtsAPIReference/
    已按桶分层:
    modules/
    topics/
    capi/headers/
    types/
    errors/
    guides/
  1. Narrow down the scope first (select Kit or task)
    • Kit navigation:
      references/KITS.md
    • Task-oriented:
      references/TASK_MAP.md
  2. Accurately locate files next (search path list)
    • Full library path list:
      references/INDEX.md
    • JS/ETS API bucket list:
      references/JsEtsAPIReference/INDEX.md
  3. Browse directories only when necessary
    references/JsEtsAPIReference/
    has been layered by buckets:
    modules/
    ,
    topics/
    ,
    capi/headers/
    ,
    types/
    ,
    errors/
    ,
    guides/
    .

常用检索(直接复制用)

Common Searches (copy directly for use)

  • 先按关键词命中路径:
    rg -n "UIAbility|AbilityStage|Want" references/INDEX.md | head
  • 查某个
    @ohos.*
    模块:
    rg -n "@ohos\\.app\\.ability\\.|@ohos\\.ability\\." references/JsEtsAPIReference/INDEX.md | head
  • 查 NDK/C API 头文件:
    rg -n "^capi/headers/.*(napi|arkui|window|ability).*\\.h\\.md$" references/JsEtsAPIReference/INDEX.md | head
  • Match paths by keyword first:
    rg -n "UIAbility|AbilityStage|Want" references/INDEX.md | head
  • Search for a specific
    @ohos.*
    module:
    rg -n "@ohos\\.app\\.ability\\.|@ohos\\.ability\\." references/JsEtsAPIReference/INDEX.md | head
  • Search for NDK/C API header files:
    rg -n "^capi/headers/.*(napi|arkui|window|ability).*\\.h\\.md$" references/JsEtsAPIReference/INDEX.md | head

生成约束(避免踩坑)

Generation Constraints (avoid pitfalls)

  • 不要全量读取:先在
    INDEX.md
    命中路径,再打开对应
    .md
  • 不确定就查文档:API 签名、入参、返回值以
    references/
    内文本为准,不凭经验补全。
  • ArkUI 优先声明式:示例优先使用
    @Entry
    /
    @Component
    /
    build()
    (除非文档明确是 NDK 或系统服务)。
<!-- version: 1.1.0 -->
  • Do not read all files: First match the path in
    INDEX.md
    , then open the corresponding
    .md
    file.
  • Check documentation if unsure: API signatures, input parameters, and return values are subject to the text in
    references/
    , do not complete them based on experience.
  • Declarative syntax is preferred for ArkUI: Examples prefer to use
    @Entry
    /
    @Component
    /
    build()
    (unless the document explicitly specifies NDK or system service).
<!-- version: 1.1.0 -->