Use export = syntax

This commit is contained in:
Javon Harper
2019-01-16 14:43:07 -05:00
parent 8375a616cb
commit c62fd26609
3 changed files with 15 additions and 11 deletions
+12 -8
View File
@@ -3,22 +3,26 @@
// Definitions by: Javon Harper <https://github.com/javonharper>
// 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;
+2 -2
View File
@@ -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"
};
+1 -1
View File
@@ -8,7 +8,7 @@
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"baseUrl": "../",
"typeRoots": [
"../"