Create a new instance of the TypesFileReader with the specified options for parsing types from a file.
Optionaloptions: Partial<TypesFileReaderOptions>Optional configuration for the reader.
ProtectedremoveProtectedreadProtectedreadProtectedisProtectedisProtectedisParse the content of a types file and return the result, including the successfully parsed types and any errors encountered. If a Workspace was passed in options, that Workspace will be changed to reflect successful declarations.
The content of the types file to parse.
The result of parsing, including the successfully parsed types and any errors encountered.
ProtectedparseProtectedcollect
Reader class for parsing types files that define data structures for input (and output) properties. You should use this class to read types from a text file, where each line (or block) defines a type as a JSON object with a "key" property and either: "type" or "properties" that define the type structure. The reader will parse the file content and return an object containing the successfully parsed types as well as any errors encountered during parsing. The reader supports both line-by-line and block-by-block reading, but blocks are the default and highly recommended. It also includes error handling for invalid syntax and duplicate keys, ensuring that the resulting types object is valid and usable within the rule engine.
N.B. Declarations need to be in order, otherwise errors will be returned.
N.B. This is a transactional safe reader. If you provide a workspace and select the option accept: 'all', then that workplace will not be affected if any errors are encountered.