From 52d3b66bea7236bcef5804fab7115c2ed17816e2 Mon Sep 17 00:00:00 2001 From: heycalmdown Date: Wed, 23 Nov 2016 09:41:58 +0900 Subject: [PATCH] Adopt a review by @sandersn --- continuation-local-storage/index.d.ts | 36 ++++++++++++--------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/continuation-local-storage/index.d.ts b/continuation-local-storage/index.d.ts index 89f4d18b76..131f9c748c 100644 --- a/continuation-local-storage/index.d.ts +++ b/continuation-local-storage/index.d.ts @@ -5,29 +5,25 @@ /// -declare module ContinuationLocalStorage { - type Context = any; +export type Context = any; - interface Namespace { - active(): Context; - set(key: string, value: T): T; - get(key: string): any; - run(callback: any): void; - runAndReturn(callback: any): any; - bind(callback: any, context?: Context): any; - bindEmitter(emitter: NodeJS.EventEmitter): any; - createContext(): Context; - name: string; - context: Context; - } - function createNamespace(name: string): Namespace; - function getNamespace(name: string): Namespace; - function destroyNamespace(name: string): void; - function reset(): void; +export interface Namespace { + active(): Context; + set(key: string, value: T): T; + get(key: string): any; + run(callback: any): void; + runAndReturn(callback: any): any; + bind(callback: any, context?: Context): any; + bindEmitter(emitter: NodeJS.EventEmitter): any; + createContext(): Context; + name: string; + context: Context; } +export function createNamespace(name: string): Namespace; +export function getNamespace(name: string): Namespace; +export function destroyNamespace(name: string): void; +export function reset(): void; // declare namespace process { // var namespaces: ContinuationLocalStorage.Namespace[]; // } - -export = ContinuationLocalStorage;