import type { CommunityInfo } from "./wiki-surprise.js";
export interface LensData {
    communities: Array<{
        name: string;
        slug: string;
        fileCount: number;
        cohesion: number;
    }>;
    edges: Array<{
        from: number;
        to: number;
        weight: number;
    }>;
}
/** Literal type-tags for the existing (pre-v2.1) page kinds. Kept aligned with
 *  the `type` enum in `schemas/wiki-manifest-v2.schema.json` → `PageEntry`. */
export type ExistingPageKind = "index" | "community" | "hubs" | "surprises" | "hotspots" | "framework" | "overview" | "architecture";
/** A standard (non-journal) page entry in the manifest's `pages` array. */
export interface ExistingPageEntry {
    slug: string;
    title: string;
    type: ExistingPageKind;
    file: string;
    outbound_links: string[];
}
/** Literal type-tags for the three journal-page kinds introduced in v2.1.
 *  Each value is disjoint from `ExistingPageKind`, so `type` remains a valid
 *  discriminant across the full `PageEntry` union. */
export type JournalPageKind = "journal-overview" | "journal-rollup" | "journal-phase";
/** A journal-oriented page entry (added in manifest schema v2.1). Cohesion
 *  point: grouped with `ExistingPageEntry` above so the discriminated-union
 *  shape is visible at a glance (CQ14). */
export interface JournalPageEntry {
    slug: string;
    title: string;
    type: JournalPageKind;
    file: string;
    outbound_links: string[];
    source: "generated" | "ai-authored" | "hand-written";
    journal_content_hashes?: Record<string, string>;
    parent_slug?: string;
}
/** Discriminated union of every page kind the manifest can emit. The `type`
 *  field is the discriminant — exhaustive switches on `type` still type-check. */
export type PageEntry = ExistingPageEntry | JournalPageEntry;
export interface WikiManifest {
    manifest_schema_version: "2.1.0";
    generated_at: string;
    index_hash: string;
    git_commit: string;
    pages: PageEntry[];
    slug_redirects: Record<string, string>;
    token_estimates: Record<string, number>;
    file_to_community: Record<string, string>;
    degraded: boolean;
    degraded_reasons?: string[];
    lens_data?: LensData;
}
export type ModuleRole = "framework-tools" | "framework-routes" | "framework-components" | "core-library" | "data-access" | "utilities" | "parsers" | "storage" | "search" | "cli" | "tests" | "scripts" | "micro-module" | "unknown";
export interface KeyExport {
    name: string;
    kind: "function" | "class" | "interface" | "type" | "component" | "hook" | "default_export";
    file: string;
    signature?: string;
}
export interface ModuleMetadata {
    slug: string;
    name: string;
    description: string;
    role: ModuleRole;
    files: number;
    cohesion: number;
    key_exports: KeyExport[];
    depends_on: string[];
    depended_by: string[];
    has_hotspot: boolean;
    workspace?: string;
    key_exports_approximate?: boolean;
}
export interface DependencySummary {
    prod_total: number;
    dev_total: number;
    key: Array<{
        name: string;
        version: string;
        kind: "prod" | "dev";
    }>;
}
export interface ProjectOverview {
    name: string;
    git_remote: string | null;
    project_type: "monorepo" | "single";
    stack: {
        language: string;
        language_version: string | null;
        framework: string | null;
        framework_version: string | null;
        test_runner: string | null;
        package_manager: string | null;
        build_tool: string | null;
    };
    scripts: Record<string, string>;
    entry_points: string[];
    workspaces: string[];
    dependencies: DependencySummary;
    known_gotchas: {
        gotcha: string;
        severity: "high" | "medium" | "low";
    }[];
    stats: {
        total_files: number;
        total_commits: number | null;
        contributors: number | null;
    };
}
export interface WikiManifestV2 {
    schema_version: 2;
    manifest_schema_version: "2.1.0";
    generated_at: string;
    index_hash: string;
    git_commit: string;
    project: ProjectOverview;
    modules: ModuleMetadata[];
    pages: WikiManifest["pages"];
    slug_redirects: Record<string, string>;
    token_estimates: Record<string, number>;
    file_to_community: Record<string, string>;
    lens_data?: LensData;
    degraded: boolean;
    degraded_reasons?: string[];
    modules_truncated?: boolean;
    truncation_reason?: "module_count_cap" | "token_budget";
}
export interface PageInfo {
    slug: string;
    title: string;
    type: ExistingPageKind;
    file: string;
    content: string;
}
/** Converts a community name to a URL-safe kebab-case slug. */
export declare function toSlug(name: string): string;
/**
 * Builds a collision-free `name -> slug` map. Duplicates are disambiguated with
 * a numeric suffix (`-2`, `-3`, …) in iteration order. Empty-slug names fall
 * back to the literal `community` base.
 */
export interface BuildUniqueSlugsOptions {
    monorepo?: boolean;
    workspaces?: string[];
}
export declare function buildUniqueSlugs(communities: readonly {
    name: string;
    files?: string[];
}[], options?: BuildUniqueSlugsOptions): Map<string, string>;
/**
 * Maps every file from every community to the community's kebab-case slug
 * using a collision-free slug map.
 */
export declare function buildFileToCommunityMap(communities: CommunityInfo[], slugMap?: Map<string, string>): Record<string, string>;
/**
 * Builds the wiki manifest — a single JSON artifact that describes every
 * generated wiki page and its metadata.
 */
export declare function buildWikiManifest(options: {
    index_hash: string;
    git_commit: string;
    pages: PageInfo[];
    communities: CommunityInfo[];
    oldManifest?: WikiManifest;
    degradedReasons?: string[];
    journalPages?: JournalPageEntry[];
}): WikiManifest;
//# sourceMappingURL=wiki-manifest.d.ts.map