ComponentLibraries Module
Types and nested modules
Functions and values
| Function or value | Description |
Full Usage:
componentPath libPath name
Parameters:
string
name : string
Returns: string
|
|
|
|
|
The libraries available: those shipped with Issie, and those the user has made or imported. Directory names only - no file is opened - so this is cheap enough for startup, which it has to be: the catalogue is a pure render function and cannot read the disk itself. Everything about a component is read later, when its library is opened. A user library with the same name as a shipped one wins, so a library can be overridden.
|
|
|
Full Usage:
libraryIndexFor ldcs libraryName
Parameters:
LoadedComponent list
libraryName : string
Returns: int
|
The index to use for a library in this project: the one it already has if any of its sheets are present, otherwise the lowest free index. An index is free when no other library holds it and NO existing sheet begins with its prefix - not merely none of the names this library would produce. User sheet names may themselves contain underscores, so a project can already hold a sheet called L1_Anything, and letting a library share a prefix with an unrelated sheet would be confusing even where nothing actually collides. A prefix in use is skipped rather than anything being renamed or refused.
|
|
|
|
|
Full Usage:
prefixFor libraryIndex
Parameters:
int
Returns: string
|
|
Full Usage:
readComponentAndDependencies libPath name
Parameters:
string
name : string
Returns: Result<LibraryFile list, string>
|
A component and everything it needs, dependencies first - the order they must be written in. Dependencies are named rather than embedded, so they are read from the same library here. A name that is not there is an error rather than a silent omission: the component would otherwise be placed holding a custom component that refers to a sheet which does not exist.
|
Full Usage:
reservedPrefixOf ldcs sheetName
Parameters:
LoadedComponent list
sheetName : string
Returns: string option
|
|
|
|
Full Usage:
sheetNameFor libraryIndex compName
Parameters:
int
compName : string
Returns: string
|
|
Full Usage:
tryReadComponentFile path
Parameters:
string
Returns: Result<LibraryFile, string>
|
|
Full Usage:
tryReadComponentShape libPath name
Parameters:
string
name : string
Returns: Result<ComponentShape, string>
|
|
|
|
|
|
Full Usage:
unusedLibrarySheets ldcs
Parameters:
LoadedComponent list
Returns: LoadedComponent list
|
Library sheets no sheet instantiates any more, and so which should be dropped from the project. A library sheet used only by another library sheet of the same component is kept, since that one is reachable; the calculation is repeated until it settles so that a multi-sheet component goes in one piece. Deliberately NOT run when the instance is deleted: undo restores model snapshots, so deleting the sheet there would leave undo unable to bring it back. Sweeping when the project is saved or closed keeps deletion undoable.
|
Full Usage:
writeComponentFile libPath header body
Parameters:
string
header : LibraryHeader
body : string
Returns: Result<unit, string>
|