diff --git a/types/iopipe__iopipe/index.d.ts b/types/iopipe__iopipe/index.d.ts index 591501c5aa..42a68f7015 100644 --- a/types/iopipe__iopipe/index.d.ts +++ b/types/iopipe__iopipe/index.d.ts @@ -3,22 +3,26 @@ // Definitions by: Javon Harper // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export interface LibraryConfig { +interface LibraryConfig { debug?: boolean; token?: string; networkTimeout?: number; timeoutWindow?: number; } -export type FunctionWrapper = (handler: any) => void; +type FunctionWrapper = (handler: any) => void; -export function label(label: string): void; +declare function iopipe(config?: LibraryConfig): FunctionWrapper; -export function metric(label: string, value: number): void; +declare namespace iopipe { + function label(label: string): void; -export namespace mark { - function start(label: string): void; - function end(label: string): void; + function metric(label: string, value: number): void; + + namespace mark { + function start(label: string): void; + function end(label: string): void; + } } -export default function iopipe(config?: LibraryConfig): FunctionWrapper; +export = iopipe; diff --git a/types/iopipe__iopipe/iopipe__iopipe-tests.ts b/types/iopipe__iopipe/iopipe__iopipe-tests.ts index a48dfe7416..8f5b9bae29 100644 --- a/types/iopipe__iopipe/iopipe__iopipe-tests.ts +++ b/types/iopipe__iopipe/iopipe__iopipe-tests.ts @@ -1,6 +1,6 @@ -import iopipe, { label, metric, mark, LibraryConfig } from "iopipe__iopipe"; +import iopipe, { label, metric, mark } from "iopipe__iopipe"; -const config: LibraryConfig = { +const config = { token: "ABCDEFG" }; diff --git a/types/iopipe__iopipe/tsconfig.json b/types/iopipe__iopipe/tsconfig.json index f0770af65c..eaab1ac3c6 100644 --- a/types/iopipe__iopipe/tsconfig.json +++ b/types/iopipe__iopipe/tsconfig.json @@ -8,7 +8,7 @@ "noImplicitThis": true, "strictNullChecks": true, "strictFunctionTypes": true, - "esModuleInterop": true, + "allowSyntheticDefaultImports": true, "baseUrl": "../", "typeRoots": [ "../"