The table of a library that is Kanon (commons 0033-kanonFR-010): its units, each in one of the three layers or the library's own checking, as data a manifest declares and a program reads. This module holds the types of the table, the ranks of the layers and the decoder that reads a table from the kanon field of a manifest.
Parse, don't validate: a folder and a package name are branded types made only by their smart constructors (parseFolder, parsePackageName), and a Table holds nothing else, so a function that takes one never checks again. A unit is a sum, LayeredUnit | OwnUnit: a layered unit has a layer, an own unit (the library's tests and tools) has none and may import any file of the library by a relative path, so that no unit is both or neither. A unit with instances is one unit for each folder under it (a dialect, a surface, a model). What a unit may import of the library's other units is, by default, every unit of a layer above its own; where mayImport is given it is the exact list of the other units it may import. What it may import by package name is open where packages is absent, and exactly the listed packages where it is given.
A package a unit may import, with the subpaths it may reach: any (the package and every entry of it), [] (the package's own entry only) or the listed subpaths.
One instance of a unit kind that a host declares (0033-kanonFR-019): a dialect, in a folder under the unit it is an instance of or in a package of its own. A sum, so that an instance is in a folder or in a package and never both; the package of a package instance is made by the family's rule.
How far down a layer stands: Governance 1, Logical 2, Physical 3; a higher rank imports a lower (0033-kanonFR-007). A registry: one entry for each layer, which the compiler holds.
type Table = {
/** The package's own name, which a unit uses to import another unit. */
readonly package: PackageNam…(827 characters)
typeTable= {
/** The package's own name, which a unit uses to import another unit. */readonlypackage:PackageName;
readonlyunits:readonlyUnit[];
/** The naming rule of the packages that extend this library, where it has any (0033-kanon FR-021). */readonlyfamily?:FamilyRule;
/** The instances of its units that it declares (0033-kanon FR-019). */readonlyinstances:readonlyInstance[];
/** The plugins it declares (0033-kanon FR-020). */readonlyplugins:readonlyPlugin[];
/** The host library this package extends, as a dialect or a plugin of it: a package is a host or an extension, never both (0033-kanon FR-020). */readonlyextends?:PackageName;
/** Its role in that host, where the host's family takes members of any scope (0033-kanon FR-027). */readonlyrole?:ExtensionRole;
};