import { FileNode } from '../types'; import { Scenario } from '../scenario/types'; import { RecycleBinItem } from '../utils/storage'; import { RecentDocumentEntry } from '../context/RecentDocumentsContext'; import { PrinterDefinition, PrintJob } from '../context/PrintSpoolerContext'; import { MediaPlaylist } from '../apps/WindowsMediaPlayer'; import { EvidenceReportProps } from '../apps/EvidenceReport'; import { PowerSequence } from '../context/PowerTransitionContext'; import { QQArchive } from '../data/qq/types'; import { EraPage } from './eraPage'; /** * A reference to a piece of content. Three sources, one shape — so a `content:` * inline string can grow into a referenced file without changing the field's * meaning. * * - `string` — **inline**. The content itself (current behaviour; the fast path * for prototypes and short bodies). * - `{ url }` — a **host asset URL** resolved at load time (a build-time * `import`, a `public/` path, or a CDN URL). Portable only as far as the URL is. * - `{ asset }` — a **logical key** resolved through a {@link ContentPack}'s * `assets` manifest. The portable reference: a content pack ships its own * assets map, so the same `{ asset: 'letter' }` resolves wherever the pack is * mounted. */ export type ContentRef = string | { url: string; } | { asset: string; }; /** Narrow a {@link ContentRef} to the inline-string form. */ export declare function isInlineRef(ref: ContentRef): ref is string; /** Narrow a {@link ContentRef} to the `{ url }` host-asset form. */ export declare function isUrlRef(ref: ContentRef): ref is { url: string; }; /** Narrow a {@link ContentRef} to the `{ asset }` manifest-key form. */ export declare function isAssetRef(ref: ContentRef): ref is { asset: string; }; /** True for any value that is shaped like a {@link ContentRef}. */ export declare function isContentRef(value: unknown): value is ContentRef; /** * An authorized IE site (#149/#241). Keyed in {@link ContentPack.sites} by a * normalized URL (see {@link ./pack}.normalizeSiteUrl); when the player * navigates to a matching URL, IE renders `html` instead of falling through to * the search corpus or a Wayback iframe. This registry is the declarative way to * author a fake webpage — "authorized pages always win" (#149). */ export interface SiteDef { /** The page body to render (inline HTML, a host URL, or an asset key). */ html?: ContentRef; /** Structured early-web page, rendered with the selected period template (#281). */ page?: EraPage; /** Browser/tab title; falls back to the site's URL key when omitted. */ title?: string; /** Optional favicon (icon id, data URI, or a {@link ContentRef}). */ favicon?: ContentRef; } /** * A per-culture string table: culture id (`'en'`, `'zh'`, …) → key → text. The * carrier for #207 copy extraction inside a pack; merged into the runtime string * resolver when the pack is mounted. */ export type PackStrings = Record>; /** * A content pack — the top-level unit of an official game's content repository * (#86/#241). Every field is optional; a pack may use only one of them (e.g. a * pack that just ships authorized sites, or just a scenario). Multiple packs can * be mounted and merged (see {@link ./pack}.mergeContentPacks). */ export interface ContentPack { /** Stable id — namespaces the asset cache and feeds the snapshot fingerprint. */ id: string; /** * Logical asset key → concrete source, resolved once when the host mounts the * pack. Values are inline or `{ url }` sources — an `{ asset }` value would be * an indirection loop and is rejected by the resolver. */ assets?: Record; /** IE authorized-site registry (keys are normalized URLs, rules per #149). */ sites?: Record; /** `customFileSystem` fragment; file nodes may carry a `contentRef`. */ files?: Record; /** Authored Recycle Bin records with deterministic deletion metadata (#282). */ recycleBin?: Record; /** Authored historical MRU entries merged with runtime opens (#282). */ recentDocuments?: RecentDocumentEntry[]; /** Data-driven printers and initial spool history (#276). */ printers?: PrinterDefinition[]; printJobs?: PrintJob[]; /** Reusable WMP playlists addressable by id (#277). */ playlists?: MediaPlaylist[]; /** Reusable structured evidence-report definitions (#278). */ reports?: EvidenceReportProps[]; /** Optional authored shutdown/restart presentation (#279). */ powerSequence?: PowerSequence; /** Read-only QQ message-history archives (#280). */ qqArchives?: QQArchive[]; /** The scenario rulebook (#84/#207). */ scenario?: Scenario; /** Per-culture string tables (#207 copy extraction carrier). */ strings?: PackStrings; }