/** * references.ts — extract the project entities a command list depends on. * * Given a flat MV command list (an event page, a common event, a troop page…) * this returns the set of switches, variables, common events, maps, items and * assets the logic touches. It is the raw material for the project graph * (roadmap #3), the "why does X happen" reasoning (#8) and the validation * passes (#10). * * Pure, defensive, never throws on malformed parameters. */ import type { RawCommand } from "./eventAst.js"; export interface RefSet { switches: number[]; variables: number[]; selfSwitches: string[]; commonEvents: number[]; maps: number[]; items: number[]; weapons: number[]; armors: number[]; troops: number[]; animations: number[]; actors: number[]; states: number[]; audio: string[]; images: string[]; /** Plugin command names invoked (code 356), as opaque tokens. */ pluginCommands: string[]; } export interface WriteSet { switches: number[]; variables: number[]; selfSwitches: string[]; } export interface ReadSet { switches: number[]; variables: number[]; selfSwitches: string[]; } /** Extract the switches/variables/self-switches a command list *reads* (conditions/operands). */ export declare function extractReads(commands: RawCommand[] | undefined | null): ReadSet; /** Merge the reads of several command lists. */ export declare function extractReadsFromMany(lists: (RawCommand[] | undefined | null)[]): ReadSet; /** Extract the switches/variables/self-switches a command list *writes to*. */ export declare function extractWrites(commands: RawCommand[] | undefined | null): WriteSet; /** Merge the writes of several command lists. */ export declare function extractWritesFromMany(lists: (RawCommand[] | undefined | null)[]): WriteSet; /** Extract every entity reference from a single command list. */ export declare function extractRefs(commands: RawCommand[] | undefined | null): RefSet; /** Merge several command lists into one combined reference set. */ export declare function extractRefsFromMany(lists: (RawCommand[] | undefined | null)[]): RefSet; /** True when the reference set carries no references at all. */ export declare function isEmptyRefSet(refs: RefSet): boolean;