@types/cls-hooked
Advanced tools
Comparing version 4.3.3 to 4.3.4
// Type definitions for cls-hooked 4.3 | ||
// Project: https://github.com/jeff-lewis/cls-hooked | ||
// Definitions by: Leo Liang <https://github.com/aleung> | ||
// Lucian Buzzo <https://github.com/LucianBuzzo> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -10,7 +11,7 @@ | ||
export interface Namespace { | ||
export interface Namespace<N = Record<string, any>> { | ||
active: any; | ||
set<T>(key: string, value: T): T; | ||
get(key: string): any; | ||
set<K extends keyof N = keyof N>(key: K, value: N[K]): N[K]; | ||
get<K extends keyof N = keyof N>(key: K): N[K]; | ||
run(fn: (...args: any[]) => void): void; | ||
@@ -26,5 +27,7 @@ runAndReturn<T>(fn: (...args: any[]) => T): T; | ||
export function createNamespace(name: string): Namespace; | ||
export function getNamespace(name: string): Namespace | undefined; | ||
// eslint-disable-next-line no-unnecessary-generics | ||
export function createNamespace<N = Record<string, any>>(name: string): Namespace<N>; | ||
// eslint-disable-next-line no-unnecessary-generics | ||
export function getNamespace<N = Record<string, any>>(name: string): Namespace<N> | undefined; | ||
export function destroyNamespace(name: string): void; | ||
export function reset(): void; |
{ | ||
"name": "@types/cls-hooked", | ||
"version": "4.3.3", | ||
"version": "4.3.4", | ||
"description": "TypeScript definitions for cls-hooked", | ||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cls-hooked", | ||
"license": "MIT", | ||
@@ -11,2 +12,7 @@ "contributors": [ | ||
"githubUsername": "aleung" | ||
}, | ||
{ | ||
"name": "Lucian Buzzo", | ||
"url": "https://github.com/LucianBuzzo", | ||
"githubUsername": "LucianBuzzo" | ||
} | ||
@@ -25,4 +31,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "f03f88fdc3a8d63eb66171f29a2ac94c4c3aaf749b6bca864b597a0a3345b83a", | ||
"typeScriptVersion": "3.4" | ||
"typesPublisherContentHash": "a1159d92eb0f44a50ec32920cdfc689675acc4b75bb846f228c38dc79b52edc9", | ||
"typeScriptVersion": "4.3" | ||
} |
@@ -9,5 +9,40 @@ # Installation | ||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cls-hooked. | ||
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/cls-hooked/index.d.ts) | ||
````ts | ||
// Type definitions for cls-hooked 4.3 | ||
// Project: https://github.com/jeff-lewis/cls-hooked | ||
// Definitions by: Leo Liang <https://github.com/aleung> | ||
// Lucian Buzzo <https://github.com/LucianBuzzo> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
/// <reference types="node" /> | ||
import { EventEmitter } from 'events'; | ||
export interface Namespace<N = Record<string, any>> { | ||
active: any; | ||
set<K extends keyof N = keyof N>(key: K, value: N[K]): N[K]; | ||
get<K extends keyof N = keyof N>(key: K): N[K]; | ||
run(fn: (...args: any[]) => void): void; | ||
runAndReturn<T>(fn: (...args: any[]) => T): T; | ||
runPromise<T>(fn: (...args: any[]) => Promise<T>): Promise<T>; | ||
bind<F extends Function>(fn: F, context?: any): F; // tslint:disable-line: ban-types | ||
bindEmitter(emitter: EventEmitter): void; | ||
createContext(): any; | ||
enter(context: any): void; | ||
exit(context: any): void; | ||
} | ||
// eslint-disable-next-line no-unnecessary-generics | ||
export function createNamespace<N = Record<string, any>>(name: string): Namespace<N>; | ||
// eslint-disable-next-line no-unnecessary-generics | ||
export function getNamespace<N = Record<string, any>>(name: string): Namespace<N> | undefined; | ||
export function destroyNamespace(name: string): void; | ||
export function reset(): void; | ||
```` | ||
### Additional Details | ||
* Last updated: Fri, 05 Feb 2021 05:00:40 GMT | ||
* Last updated: Wed, 14 Jun 2023 14:02:48 GMT | ||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node) | ||
@@ -17,2 +52,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by [Leo Liang](https://github.com/aleung). | ||
These definitions were written by [Leo Liang](https://github.com/aleung), and [Lucian Buzzo](https://github.com/LucianBuzzo). |
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
5444
26
0
52