• Version 4.3.8
  • Published
  • 4.92 kB
  • 1 dependency
  • MIT license


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


TypeScript definitions for cls-hooked



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;


          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.


                                  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
                                  • 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>