Class CLTypeParser

A utility class for parsing various CLTypes from different formats, such as JSON, strings, and bytes. This class includes static methods for handling both simple and complex types, along with error handling for unsupported or unrecognized formats.

Hierarchy

  • CLTypeParser

Constructors

Properties

BufferConstructorNotDetectedError: Error = ...

Error thrown when a buffer constructor is not detected.

ComplexTypeFormatInvalidError: Error = ...

Error thrown when a complex type format is invalid.

ErrComplexTypeFormatNotDetected: Error = ...

Error thrown when a complex type format is not detected.

ErrJsonConstructorNotFound: Error = ...

Error thrown when a JSON constructor is not found.

simpleTypeByID: {
    0: undefined | CLType;
    1: undefined | CLType;
    10: undefined | CLType;
    11: undefined | CLType;
    12: undefined | CLType;
    13: undefined | CLType;
    14: undefined | CLType;
    15: undefined | CLType;
    16: undefined | CLType;
    17: undefined | CLType;
    18: undefined | CLType;
    19: undefined | CLType;
    2: undefined | CLType;
    20: undefined | CLType;
    21: undefined | CLType;
    22: undefined | CLType;
    3: undefined | CLType;
    4: undefined | CLType;
    5: undefined | CLType;
    6: undefined | CLType;
    7: undefined | CLType;
    8: undefined | CLType;
    9: undefined | CLType;
} = ...

A record of simple CLTypes indexed by their TypeID.

Type declaration

simpleTypeByName: Record<string, CLType> = ...

A record of simple CLTypes indexed by their TypeName.

Methods

  • Parses a CLType from a complex structure.

    Returns

    The parsed CLType.

    Throws

    Various errors if the structure is invalid or unrecognized.

    Parameters

    • rawData: any

      The complex structure to parse.

    Returns CLType

  • Retrieves a simple CLType by its TypeName.

    Returns

    The corresponding CLType.

    Throws

    Error if the type name is not registered.

    Parameters

    • typeName: string

      The TypeName of the CLType to retrieve.

    Returns CLType

Generated using TypeDoc