Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace K

K stands for Konstruct

Helper for constructing xml-like javascript object.

Index

Functions

Functions

ARRAY

  • Example:

    {
      tag: K.ARRAY('s32', [1, 2, 3], {attr: "4"})
    }

    Represents:

    <tag __type="s32" __count="3" attr="2">1 2 3</tag>

    Parameters

    • type: "u8" | "s8"

      __type attribute, which is used during encoding and compression

    • content: Buffer

      array of data, __count attribute will be automatically set to content.length

    • Optional attr: KAttrMap

      attribute map in addition to __type and __count

    Returns any

  • Parameters

    Returns any

  • Parameters

    Returns any

ATTR

  • ATTR(attr: KAttrMap, inner?: any): any
  • Example:

    {
      tag: K.ATTR({attr: "1"}, {
        inner: [{}, {}]
      })
    }

    Represents:

    <tag attr="1">
      <inner/>
      <inner/>
    </tag>

    Parameters

    • attr: KAttrMap

      Attribute map

    • Optional inner: any

      Inner tag/data

    Returns any

ITEM

Generated using TypeDoc