OkfReservedFileProjection typedef
Rewrites the reserved files of a candidate during OkfBundleChangeApplier.prepare.
The result is keyed by bundle-relative path, and every key must name an
index.md or log.md file. A text replaces whatever the change set
prepared for that path; null keeps the source bundle's text, or its
absence. Paths the result does not name keep the change set's text.
Texts are decoded text without the file's UTF-8 byte order mark, as OkfProjectionInput.base holds them. A reserved file that began with one keeps it when the commit writes the projected text, as a concept does, so a projection does not add one. A projected text that begins with U+FEFF holds it as content: the commit writes a mark before it, which loading drops, so the file loads as the projected text.
The change set regenerates every ancestor index of a directory it adds,
and the Spec validator does not check where index links lead. Returning
null for the index.md of a directory the change set adds therefore
leaves its ancestors listing a missing file, so a projection that drops
such an index should also project the ancestor indexes.
Implementation
typedef OkfReservedFileProjection =
FutureOr<Map<String, String?>> Function(OkfProjectionInput input);