JsonHelpers Module
Types
Functions and values
| Function or value | Description |
Full Usage:
convStateToJC (compL, connL)
Parameters:
Component list
connL : Connection list
Returns: JSONCanvasState
|
|
|
|
|
NB tryParseNativeAs, not tryParseAs. Both are SimpleJson and both end in the same AST-to-value conversion; they differ only in how the AST is built. tryParseAs uses Fable.Parsimmon parser combinators over the whole file and measured ~8x slower than the native JSON.parse variant - 59ms against 7ms on a 108KB sheet - and this function tries up to three types in turn, so it paid that cost more than once per sheet loaded. The two were checked to agree on every demo sheet, for each of the three types below.
|
Full Usage:
stateToJsonString (arg1, arg2, arg3)
Parameters:
CanvasState
arg1 : SavedWaveInfo option
arg2 : SheetInfo option
Returns: Result<string, string>
|
The ordinary save: stamped with the time it is written, which is what says which sheet the user was last working on - see MenuHelpers.chooseWhichToOpen. A rewrite that is not an edit of the user's, such as the id conversion a project open does, keeps the stamp it read and goes through stateToJsonStringAt instead.
|
Full Usage:
stateToJsonStringAt time (cState, waveInfo, sheetInfo)
Parameters:
DateTime
cState : CanvasState
waveInfo : SavedWaveInfo option
sheetInfo : SheetInfo option
Returns: Result<string, string>
|
|
Full Usage:
stateToJsonStringExperimental (cState, waveInfo, sheetInfo)
Parameters:
CanvasState
waveInfo : SavedWaveInfo option
sheetInfo : SheetInfo option
Returns: Result<string, string>
|
|