Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ConfigBuilder<C, K>

Type parameters

  • C: object

  • K: string

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected _context

_context: Context<C> = new Context()

used to track transformations to the context

Protected _parents

_parents: Array<ConfigBuilder<any, string>>

Protected _request

_request: RequestContext = new RequestContext()

used to track transformations to the request

Optional name

name: K

Methods

body

ctx

  • ctx(obj: Partial<C>): this
  • merge an object with the context of this builder using the same logic as Object.assign

    Parameters

    • obj: Partial<C>

      an object to merge with the current context

    Returns this

delete

  • delete(): this

Protected evolve

  • evolve(builder: this): this
  • override the properties of a builder with the properties of this builder

    Parameters

    • builder: this

      the target of the property overrides

    Returns this

extend

  • extend(name: string): this
  • create a new instance of this builder type and set the properties from this builder

    Parameters

    • name: string

      the name of the cloned builder

    Returns this

flatten

formatter

get

  • get(): this

headers

inherit

  • add a builder to the beginning of the transform chain instead of the end

    Parameters

    • contextualBuilder: ContextualBuilder<C>

      a builder to add as a parent or a dynamic builder contstruction callback

    Returns this

Protected mergeContexts

  • add request and context transformations from another config builder

    Type parameters

    • T: object

    Parameters

    • builder: ConfigBuilder<T, string>

      a builder with request or context transformations

    Returns this

method

  • method(method: Method): this

Protected newInstance

parser

patch

  • patch(): this

path

pipe

  • apply a functional transformation to the builder and return the result of the transformation

    Type parameters

    Parameters

    • trfm: Transformer<this, T>

      a transformation to apply to this

    Returns T

port

post

  • post(): this

put

  • put(): this

query

Protected replaceParent

  • replaceParent(prev: this, next: this): this
  • replace a builder in the _parents array with a different builder

    Parameters

    • prev: this

      the parent builder to be replaced

    • next: this

      the builder to replace it with

    Returns this

Protected resolveContext

  • resolveContext(initialValue?: object): C
  • construct a context object by applying a series of transformations to an initialValue

    Parameters

    • Default value initialValue: object = {}

      a starting value to use for the context transformations

    Returns C

Protected resolveRequest

  • resolveRequest(context: any, initialValue?: object): Request
  • construct a request object by applying a series of transformations to an initialValue

    Parameters

    • context: any

      a context object used to resolve request transformations

    • Default value initialValue: object = {}

      the starting value to use for the request transformations

    Returns Request

url

use

  • add a builder to the end of the transform chain

    Parameters

    • contextualBuilder: ContextualBuilder<C>

      a builder to add as a parent or a dynamic builder contstruction callback

    Returns this

Static Private wrapDynamicBuilder

Generated using TypeDoc