adding def for loggly

This commit is contained in:
ray 2015-03-25 13:14:20 -04:00
parent 0c2ee8583c
commit 609b043687
3 changed files with 38 additions and 0 deletions

12
loggly/loggly-tests.ts Normal file
View File

@ -0,0 +1,12 @@
/// <reference path='./loggly.d.ts' />
import loggly = require("loggly");
var options: loggly.LogglyOptions = {
token: "YOUR_TOKEN",
subdomain: "YOUR_DOMAIN",
tags: ["NodeJS"],
json: true
};
var client: loggly.Loggly = loggly.createClient(options)
client.log('hello world');

View File

@ -0,0 +1 @@
--noImplicitAny --module commonjs --target es5

25
loggly/loggly.d.ts vendored Normal file
View File

@ -0,0 +1,25 @@
// Type definitions for loggly 1.0.8
// Project: https://github.com/nodejitsu/node-loggly
// Definitions by: Ray Martone <https://github.com/rmartone>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "loggly" {
interface LogglyOptions {
token: string;
subdomain: string;
tags?: string[];
json?: boolean;
host?: string;
auth?: {
username: string;
password: string;
}
}
interface Loggly {
log(message: any, tags?: string[], callback?: (err: any, results: any) => void): void;
log(message: any, callback?: (err: any, results: any) => void): void;
}
function createClient(options: LogglyOptions): Loggly;
}