/** * The order the channel table is written in. * * `compiled-program.md` 2.7 says only that a channel's `id` equals its position * in the array, so any order is a legal program. The worked example of 12.2 is * the whole of the evidence about which order to choose, and it shows a plot * declared on the last line of the script holding channel 0 while a `signal` * three lines above it holds channel 1. So the specification's own order is not the * order the declarations are met in; it is the order `outputs` lists its * fields. * * That is the rule applied here, and it is applied as a renumbering after the * fact rather than by emitting in two passes: a channel's index is needed the * moment an `EMIT` is written, and an emitter that walked the file twice to * learn it would have two places that decide what a declaration is. */ import type { Emitter } from './context.js'; import type { Channel, Instruction, Outputs } from './program.js'; export interface ChannelOrder { readonly channels: readonly Channel[]; readonly names: readonly string[]; /** The new index of each old one, for rewriting an `EMIT` and a declaration. */ readonly moved: readonly number[]; } export declare function orderChannels(e: Emitter): ChannelOrder; export declare function renumberCode(code: readonly Instruction[], moved: readonly number[]): readonly Instruction[]; export declare function renumberOutputs(e: Emitter, moved: readonly number[]): Outputs; //# sourceMappingURL=channels.d.ts.map