mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-06 13:11:46 +00:00
Added 'node-loggly-bulk' package support (#40798)
* Added 'node-loggly-bulk' package support * Fix LogglyBulkConstructor interface constructor
This commit is contained in:
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// Type definitions for node-loggly-bulk 2.2
|
||||
// Project: https://github.com/loggly/node-loggly-bulk#readme
|
||||
// Definitions by: Andrei Kazakou <https://github.com/akazakou>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { LogglyInstance, LogglyOptions } from 'loggly';
|
||||
|
||||
export interface LogglyBulkOptions extends LogglyOptions {
|
||||
proxy?: any;
|
||||
userAgent?: string;
|
||||
useTagHeader?: boolean;
|
||||
isBulk?: boolean;
|
||||
bufferOptions?: {
|
||||
size: number;
|
||||
retriesInMilliSeconds: number;
|
||||
};
|
||||
networkErrorsOnConsole?: boolean;
|
||||
}
|
||||
|
||||
export interface LogglyBulkConstructor {
|
||||
new (options: LogglyBulkOptions): LogglyInstance;
|
||||
}
|
||||
|
||||
export const Loggly: LogglyBulkConstructor;
|
||||
|
||||
export const version: string;
|
||||
|
||||
export function createClient(options: LogglyBulkOptions): LogglyInstance;
|
||||
|
||||
export function serialize(obj: any, key?: string): string;
|
||||
@@ -0,0 +1,32 @@
|
||||
import { createClient, Loggly, serialize } from 'node-loggly-bulk';
|
||||
|
||||
const client = createClient({
|
||||
token: 'test-token',
|
||||
subdomain: 'test-subdomain',
|
||||
});
|
||||
|
||||
client.log('Test message');
|
||||
client.log({ json: 'yes' }, ['some-tag'], () => {});
|
||||
|
||||
new Loggly({
|
||||
token: 'YOUR_TOKEN',
|
||||
subdomain: 'YOUR_DOMAIN',
|
||||
tags: ['NodeJS'],
|
||||
json: true,
|
||||
auth: {
|
||||
username: 'your-username',
|
||||
password: 'your-password',
|
||||
},
|
||||
proxy: null,
|
||||
userAgent: 'test-user-agent-header',
|
||||
useTagHeader: true,
|
||||
isBulk: true,
|
||||
bufferOptions: {
|
||||
size: 500,
|
||||
retriesInMilliSeconds: 30000,
|
||||
},
|
||||
networkErrorsOnConsole: false,
|
||||
});
|
||||
|
||||
serialize({ key: 'value' }, 'key');
|
||||
serialize({ key: 'value' });
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"node-loggly-bulk-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user