mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
// Type definitions for iopipe__iopipe 1.12
|
||||
// Project: https://github.com/iopipe/iopipe (Does not have to be to GitHub, but prefer linking to a source code repository rather than to a project website.)
|
||||
// Definitions by: Javon Harper <https://github.com/javonharper>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare function iopipe(config?: iopipe.LibraryConfig): iopipe.FunctionWrapper;
|
||||
|
||||
declare namespace iopipe {
|
||||
function label(label: string): void;
|
||||
|
||||
function metric(label: string, value: number): void;
|
||||
|
||||
namespace mark {
|
||||
function start(label: string): void;
|
||||
function end(label: string): void;
|
||||
}
|
||||
|
||||
interface LibraryConfig {
|
||||
debug?: boolean;
|
||||
token?: string;
|
||||
networkTimeout?: number;
|
||||
timeoutWindow?: number;
|
||||
}
|
||||
|
||||
type FunctionWrapper = (handler: any) => void;
|
||||
}
|
||||
|
||||
export = iopipe;
|
||||
@@ -0,0 +1,17 @@
|
||||
import iopipe = require('iopipe__iopipe');
|
||||
|
||||
const config = {
|
||||
token: "ABCDEFG"
|
||||
};
|
||||
|
||||
function run(event: any, context: any, callback?: any) {
|
||||
iopipe.label('my label');
|
||||
|
||||
iopipe.metric("magic number", 42);
|
||||
|
||||
iopipe.mark.start("my-db-call");
|
||||
// an expensive database query
|
||||
iopipe.mark.end("my-db-call");
|
||||
}
|
||||
|
||||
iopipe(config)(run);
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"iopipe__iopipe-tests.ts"
|
||||
],
|
||||
"paths": {
|
||||
"@iopipe/iopipe": ["iopipe__iopipe"]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user