@types/cls-hooked

  • Version 4.3.9
  • Published
  • 5.02 kB
  • 1 dependency
  • MIT license

Install

npm i @types/cls-hooked
yarn add @types/cls-hooked
pnpm add @types/cls-hooked

Overview

TypeScript definitions for cls-hooked

Index

Functions

function createNamespace

createNamespace: <N = Record<string, any>>(name: string) => Namespace<N>;

    function destroyNamespace

    destroyNamespace: (name: string) => void;

      function getNamespace

      getNamespace: <N = Record<string, any>>(
      name: string
      ) => Namespace<N> | undefined;

        function reset

        reset: () => void;

          Interfaces

          interface Namespace

          interface Namespace<N = Record<string, any>> {}

            property active

            active: any;

              method bind

              bind: <F extends Function>(fn: F, context?: any) => F;

                method bindEmitter

                bindEmitter: (emitter: EventEmitter) => void;

                  method createContext

                  createContext: () => any;

                    method enter

                    enter: (context: any) => void;

                      method exit

                      exit: (context: any) => void;

                        method get

                        get: <K extends keyof N = keyof N>(key: K) => N[K];

                          method run

                          run: (fn: (...args: any[]) => void) => void;

                            method runAndReturn

                            runAndReturn: <T>(fn: (...args: any[]) => T) => T;

                              method runPromise

                              runPromise: <T>(fn: (...args: any[]) => Promise<T>) => Promise<T>;

                                method set

                                set: <K extends keyof N = keyof N>(key: K, value: N[K]) => N[K];

                                  Package Files (1)

                                  Dependencies (1)

                                  Dev Dependencies (0)

                                  No dev dependencies.

                                  Peer Dependencies (0)

                                  No peer dependencies.

                                  Badge

                                  To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                  You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/cls-hooked.

                                  • Markdown
                                    [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/cls-hooked)
                                  • HTML
                                    <a href="https://www.jsdocs.io/package/@types/cls-hooked"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>