Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GroupBuilder<C, K, X, A>

Type parameters

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected _children

_children: X = {} as X

Protected _context

_context: Context<C> = new Context()

used to track transformations to the context

Protected Optional _ctor

_ctor: ActionConstructor<K, A, any>

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

Private addChild

  • addChild<T>(name: string, builder: T): void
  • nest a child builder under this builder with a given name

    Type parameters

    Parameters

    • name: string

      the name of the property on the constructed client

    • builder: T

      a builder to nest as a child of this builder, it must extend GroupBuilder

    Returns void

body

build

  • build a client with this builder as the root

    Parameters

    • Default value fetch: fetch = _fetch

      an override for the fetch instance used by the resulting client

    Returns BuiltClient<A, X>

Protected buildChildren

  • buildChildren(fetch: fetch, mixin?: this): Record<keyof X, any>
  • build the child clients of this builder

    Parameters

    • fetch: fetch

      an override for the fetch instance used by the resulting client

    • Optional mixin: this

      a builder to inherit from before building the child clients

    Returns Record<keyof X, any>

ctor

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

extend

  • extend(name: string): this

flatten

formatter

get

  • get(): this

headers

inherit

Protected mergeContexts

method

  • method(method: Method): this

nest

Protected newInstance

parser

patch

  • patch(): this

path

pipe

port

post

  • post(): this

put

  • put(): this

query

Protected replaceParent

  • replaceParent(prev: this, next: this): 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

Protected wrappedConstructor

  • wrappedConstructor(self?: this): function
  • wrap the constructor with context update handlers

    Parameters

    • Default value self: this = this

      an override for the builder to accept new transformations

    Returns function

      • (...args: A): void
      • Parameters

        • Rest ...args: A

        Returns void

Generated using TypeDoc