Optional valuethe value held by this schema node. used as a storage for interceptors to interact and read decoded value
it can also used as a means for storing default values for the encoder to utilize.
but besides those two scenarios, it should typically be left unassigned.
this also comes in handy when annotating types both for the encoder or decoder
Optional namename of the node, used for object property key naming by parent SchemaRecordNode
Optional childrenan array collection of child element. typically used by non-leaf nodes, such as SchemaRecordNode and SchemaTupleNode
args that should be passed on to either the type specific encoder or decoder
Optional docan optional doc string for this schema node, that should be cleared when MINIFY is true
to achive that, you would want to write your doc strings as follows:
declare const [DEBUG, MINIFY, BUNDLE]: [boolean, boolean, boolean]
const my_schema_node: SPrimitive<number> {
type: "u4l",
doc: MINIFY || "a stupid description of this 32-bit unsinged little piece of endian."
}
a mandatory kind descriptior of the primitive kind
manually set this schema's type to the provided type_name, and also
register the new type_name to global type_registery if register = true.
this is the only easy way to register type_names of sub-sub-classes of abstract SchemaNode.
check out SHeadArray to see how it extends SArray, but registers its own type_name = "headarray"
that's different from its parent class's type_name = "array"
Rest ...children: SchemaChildNode<any, string>[]Rest ...args: any[]Rest ...args: any[]Static froman abstract static method that creates an instance of this schema class, using a regular javascript object
Optional value?: TOptional args?: any[]Optional default_value: TOptional default_args: any[]Generated using TypeDoc
PrimitiveArrayType typically require length information to be decoded. this subclass of SPrimitive schema stores the length information in the head bytes using the provided HeadType binary numeric format.