import { type PackFile } from "./packs"; /** コミュニティ翻訳パックのリポジトリ(export コマンドが PR 先として案内する) */ export declare const PACKS_REPO_URL = "https://github.com/daiki-moritake/yakudoc-packs"; /** * コミュニティ翻訳パックの既定の取得元。 * GitHub リポジトリの raw URL で、`packs/<言語コード>/<パッケージ名>.json` を * 直接取りに行く(専用サーバー不要)。 */ export declare const DEFAULT_REGISTRY_URL = "https://raw.githubusercontent.com/daiki-moritake/yakudoc-packs/main"; /** レジストリ URL を上書きする環境変数名 */ export declare const REGISTRY_ENV_VAR = "YAKUDOC_REGISTRY"; /** * レジストリのベース URL を決める。 * 優先順位: CLI の --registry > 環境変数 > config.json の registry > 既定。 */ export declare function resolveRegistryUrl(cliValue: string | undefined, configValue: string | undefined, env?: NodeJS.ProcessEnv): string; /** パッケージのパックを取りに行く URL を組み立てる */ export declare function packUrlFor(registryUrl: string, lang: string, packageName: string): string; /** fetch の差し替え用の最小インターフェース(テストで注入する) */ export type FetchLike = (url: string, init?: { signal?: AbortSignal; }) => Promise<{ ok: boolean; status: number; text(): Promise; }>; export type RegistryFetchResult = { status: "found"; pack: PackFile; url: string; } | { status: "not-found"; url: string; } | { status: "error"; message: string; url: string; }; /** * コミュニティ翻訳パックを取得する。 * * ネットワークは失敗して当たり前の前提で、例外は投げず結果を status で * 返す(add はオフラインでも成立する操作なので、呼び出し側は error を * 警告表示に留めて処理を続行する)。 */ export declare function fetchCommunityPack(options: { registryUrl: string; lang: string; packageName: string; fetchImpl?: FetchLike; timeoutMs?: number; }): Promise;