Options
All
  • Public
  • Public/Protected
  • All
Menu

Module index

Index

References

ErrCallback

Re-exports ErrCallback

HttpParams

Re-exports HttpParams

ReadValueParams

Re-exports ReadValueParams

TypeAndValue

Re-exports TypeAndValue

TypeAndValueCallback

Re-exports TypeAndValueCallback

TypeCallback

Re-exports TypeCallback

ValueCallback

Re-exports ValueCallback

WriteParams

Re-exports WriteParams

WriteTypeValueParams

Re-exports WriteTypeValueParams

httpRespond

Re-exports httpRespond

readType

Re-exports readType

readTypeAndValue

Re-exports readTypeAndValue

readValue

Re-exports readValue

writeType

Re-exports writeType

writeTypeAndValue

Re-exports writeTypeAndValue

writeValue

Re-exports writeValue

Type aliases

StructFields

StructFields<E, READ_E>: {[ key in keyof E]: Type<E[key], READ_E[key]> }

Maps each key in E to a type capable of writing the type of value stored by that key in E

Type parameters

  • E

  • READ_E: E

Variables

Const r

r: read = ...

Functions

getType

  • getType(name: string): RegisterableType
  • Gets the recursive type registered with the specified name

    throws

    If no type is registered with that name

    Parameters

    • name: string

      The name of the registered type

    Returns RegisterableType

    The registered type

Const isRegistered

  • isRegistered(name: string): boolean
  • Returns whether the specified name already has a recursive type registered with it from a call to registerType

    Parameters

    • name: string

      The name to check

    Returns boolean

    Whether the name has been mapped to a type

registerType

  • registerType(__namedParameters: TypeAndName): void
  • Registers a type with a name so the name can be used in a RecursiveType. Due to implementation limitations, the type must be one of the following types:

    If you need to use a different type, wrap it in a single-field StructType.

    THIS METHOD OF REGISTERING RECURSIVE TYPES HAS BEEN DEPRECATED. Instead, please use RecursiveType.setType:

    //A binary tree of unsigned bytes
    let treeType = new sb.RecursiveType('tree-node')
    treeType.setType(new sb.StructType({
      left: new sb.OptionalType(treeType),
      value: new sb.UnsignedByteType,
      right: new sb.OptionalType(treeType)
    }))
    

    Example:

    //A binary tree of unsigned bytes
    let treeType = new sb.RecursiveType('tree-node')
    sb.registerType({
      type: new sb.StructType({
        left: new sb.OptionalType(treeType),
        value: new sb.UnsignedByteType,
        right: new sb.OptionalType(treeType)
      }),
      name: 'tree-node' //name must match name passed to RecursiveType constructor
    })
    
    throws

    If a type is already registered under the name

    Parameters

    • __namedParameters: TypeAndName

    Returns void

Generated using TypeDoc