Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "node_modules/@slack/client/dist/util.d"

Index

Type aliases

AgentOption

AgentOption: Agent | object | boolean

Variables

Const callbackify

callbackify: Callbackify

The following is a polyfill of Node >= 8.2.0's util.callbackify method. The source is copied (with some modification) from: https://github.com/nodejs/node/blob/bff5d5b8f0c462880ef63a396d8912d5188bbd31/lib/util.js#L1095-L1140 The modified parts are denoted using comments starting with original and ending with modified This could really be made an independent module. It was suggested here: https://github.com/js-n/callbackify/issues/5

Functions

addAppMetadata

  • addAppMetadata(__namedParameters: object): void
  • Appends the app metadata into the User-Agent value

    Parameters

    • __namedParameters: object
      • name: string
      • version: string

    Returns void

agentForScheme

  • agentForScheme(scheme: string, agentOption?: AgentOption): Agent | boolean | undefined
  • Returns an agent (or false or undefined) for the specific scheme and option passed in

    Parameters

    • scheme: string

      either 'http' or 'https'

    • Optional agentOption: AgentOption

    Returns Agent | boolean | undefined

awaitAndReduce

  • awaitAndReduce<T, U>(iterable: AsyncIterable<T>, callbackfn: function, initialValue: U): Promise<U>
  • Reduce an asynchronous iterable into a single value.

    Type parameters

    • T

    • U

    Parameters

    • iterable: AsyncIterable<T>

      the async iterable to be reduced

    • callbackfn: function

      a function that implements one step of the reduction

        • (previousValue: U, currentValue: T): U
        • Parameters

          • previousValue: U
          • currentValue: T

          Returns U

    • initialValue: U

      the initial value for the accumulator

    Returns Promise<U>

delay

  • delay<T>(ms: number, value?: T): Promise<T>
  • Build a Promise that will resolve after the specified number of milliseconds.

    Type parameters

    • T

    Parameters

    • ms: number

      milliseconds to wait

    • Optional value: T

      value for eventual resolution

    Returns Promise<T>

getUserAgent

  • getUserAgent(): string
  • Returns the current User-Agent value for instrumentation

    Returns string

Generated using TypeDoc