The vocabulary of a bridge: the modes of a transfer, the rails that bound it, and the plan that comes before any change. A plan is a value: a list of actions, a closed union, in a fixed order, with what it would lose and a hash of its whole, so that a person can review it and the apply of it can refuse to run when what it was made from has changed.
The way a pair of files is compared, cheapest first: the revisions when both are SHA-256 of the bytes, the size and the time, or the bytes themselves hashed.
What decided that an action is needed: the comparator, absent where the file is not at the destination, size where the sizes differ, and undecided where no comparator could say, so that the file is copied again.
What a transfer does: copy never deletes; sync makes the destination equal and deletes only within its allowance; move copies, checks, and removes the source; check only compares.
One thing a plan does, a closed union. Paths are relative to the endpoint's prefix; rel is the path at the source and target the path at the destination.
type Plan = {
readonly mode: ModeName;
readonly source: string;
readonly dest: string;
readonly actions: readonl…(455 characters)
typePlan= {
readonlymode:ModeName;
readonlysource:string;
readonlydest:string;
readonlyactions:readonlyAction[];
readonlyunchanged:number;
/** What a transfer carries: the bytes of an object. Its other facts (type, time, mode) are the destination's own. */readonlycarries:readonly ["bytes"];
/** The bytes that would be written. */readonlybytes:number;
readonlylosses:readonlyLoss[];
readonlyhash:PlanHash;
};
What a plan is: the mode, where from and where to, the actions in order, what is already equal, what it would lose and its hash.
type Rails = {
/** Only the files matching one of these are transferred; none means every file. */
readonly include?…(724 characters)
typeRails= {
/** Only the files matching one of these are transferred; none means every file. */readonlyinclude?:readonlyGlob[];
/** Files matching one of these are left out. */readonlyexclude?:readonlyGlob[];
/** Files at the destination matching one of these are never deleted or renamed. */readonlyprotect?:readonlyGlob[];
readonlymaxFiles?:number;
readonlymaxBytes?:number;
/** Files larger than this are left as they are. */readonlymaxObjectBytes?:number;
/** Refuse unless the destination holds nothing under its prefix. */readonlyrequireEmptyDestination?:boolean;
/** Never replace a file that is already at the destination. */readonlyneverOverwrite?:boolean;
};
The rails that bound a transfer. Every pattern is a glob; the limits count the files and bytes that would be written.