mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
Add iopipe-js type declarations
This commit is contained in:
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
// Type definitions for iopipe
|
||||
// Project: https://github.com/iopipe/iopipe-js
|
||||
|
||||
interface IOPipeConfig {
|
||||
debug?: boolean;
|
||||
token?: string;
|
||||
networkTimeout?: number;
|
||||
timeoutWindow?: number;
|
||||
}
|
||||
|
||||
interface Mark {
|
||||
start(label: string): void;
|
||||
end(label: string): void;
|
||||
}
|
||||
|
||||
declare module "@iopipe/iopipe" {
|
||||
export function label(label: string): void;
|
||||
export function metric(label: string, number: number): void;
|
||||
export let mark: Mark
|
||||
|
||||
export default function iopipe(config?: IOPipeConfig): Function;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import iopipe, { label, mark, metric } from '@iopipe/iopipe'
|
||||
|
||||
const configuredLib = iopipe({
|
||||
token: 'ABCDEFG'
|
||||
});
|
||||
|
||||
const run = () => {}
|
||||
|
||||
configuredLib(run)
|
||||
|
||||
label('a label');
|
||||
|
||||
mark.start('trace');
|
||||
mark.end('trace');
|
||||
|
||||
metric('metric-label', 42);
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"iopipe-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user