Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WrappedLayout<T, U, P>

Type parameters

  • T

  • U

  • P: string = ""

Hierarchy

Index

Constructors

  • new WrappedLayout<T, U, P>(layout: Layout<T, "">, decoder: (data: T) => U, encoder: (src: U) => T, property?: P): WrappedLayout<T, U, P>
  • Type parameters

    • T

    • U

    • P: string = ""

    Parameters

    • layout: Layout<T, "">
    • decoder: (data: T) => U
        • (data: T): U
        • Parameters

          • data: T

          Returns U

    • encoder: (src: U) => T
        • (src: U): T
        • Parameters

          • src: U

          Returns T

    • Optional property: P

    Returns WrappedLayout<T, U, P>

Properties

decoder: (data: T) => U

Type declaration

    • (data: T): U
    • Parameters

      • data: T

      Returns U

encoder: (src: U) => T

Type declaration

    • (src: U): T
    • Parameters

      • src: U

      Returns T

layout: Layout<T, "">
property?: P
span: number

Methods

  • decode(b: Buffer, offset?: number): U
  • Parameters

    • b: Buffer
    • Optional offset: number

    Returns U

  • encode(src: U, b: Buffer, offset?: number): number
  • Parameters

    • src: U
    • b: Buffer
    • Optional offset: number

    Returns number

  • getSpan(b: Buffer, offset?: number): number
  • Parameters

    • b: Buffer
    • Optional offset: number

    Returns number

  • replicate<AP>(name: AP): Layout<U, AP>
  • Type parameters

    • AP: string

    Parameters

    • name: AP

    Returns Layout<U, AP>