@types/loglevel
Advanced tools
+57
-69
@@ -1,39 +0,48 @@ | ||
| // Type definitions for loglevel 1.4.0 | ||
| // Type definitions for loglevel 1.5 | ||
| // Project: https://github.com/pimterry/loglevel | ||
| // Definitions by: Stefan Profanter <https://github.com/Pro>, Florian Wagner <https://github.com/flqw>, Gabor Szmetanko <https://github.com/szmeti> | ||
| // Definitions by: Stefan Profanter <https://github.com/Pro> | ||
| // Florian Wagner <https://github.com/flqw> | ||
| // Gabor Szmetanko <https://github.com/szmeti> | ||
| // Christian Rackerseder <https://github.com/screendriver> | ||
| // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
| // TypeScript Version: 2.1 | ||
| declare var log: Logger; | ||
| export as namespace log; | ||
| export = log; | ||
| /** | ||
| * Log levels | ||
| */ | ||
| declare const enum LogLevel { | ||
| TRACE = 0, | ||
| DEBUG = 1, | ||
| INFO = 2, | ||
| WARN = 3, | ||
| ERROR = 4, | ||
| SILENT = 5 | ||
| interface LogLevel { | ||
| TRACE: 0; | ||
| DEBUG: 1; | ||
| INFO: 2; | ||
| WARN: 3; | ||
| ERROR: 4; | ||
| SILENT: 5; | ||
| } | ||
| interface LoggingMethod { | ||
| /** | ||
| * Possible log level numbers. | ||
| */ | ||
| type LogLevelNumbers = LogLevel[keyof LogLevel]; | ||
| (...message : any[]):void; | ||
| type LoggingMethod = (...message: any[]) => void; | ||
| } | ||
| type MethodFactory = (methodName: string, level: LogLevelNumbers, loggerName: string) => LoggingMethod; | ||
| interface MethodFactory { | ||
| interface Logger { | ||
| /** | ||
| * Available log levels. | ||
| */ | ||
| readonly levels: LogLevel; | ||
| (methodName : string, level : LogLevel, loggerName : string):LoggingMethod; | ||
| } | ||
| interface Log { | ||
| /** | ||
| * Plugin API entry point. This will be called for each enabled method each time the level is set | ||
| * (including initially), and should return a MethodFactory to be used for the given log method, at the given level, | ||
| * for a logger with the given name. If you'd like to retain all the reliability and features of loglevel, it's | ||
| * Plugin API entry point. This will be called for each enabled method each time the level is set | ||
| * (including initially), and should return a MethodFactory to be used for the given log method, at the given level, | ||
| * for a logger with the given name. If you'd like to retain all the reliability and features of loglevel, it's | ||
| * recommended that this wraps the initially provided value of log.methodFactory | ||
| */ | ||
| methodFactory:MethodFactory; | ||
| methodFactory: MethodFactory; | ||
@@ -46,3 +55,3 @@ /** | ||
| */ | ||
| trace(...msg : any[]):void; | ||
| trace(...msg: any[]): void; | ||
@@ -54,3 +63,3 @@ /** | ||
| */ | ||
| debug(...msg : any[]):void; | ||
| debug(...msg: any[]): void; | ||
@@ -62,3 +71,3 @@ /** | ||
| */ | ||
| info(...msg : any[]):void; | ||
| info(...msg: any[]): void; | ||
@@ -70,3 +79,3 @@ /** | ||
| */ | ||
| warn(...msg : any[]):void; | ||
| warn(...msg: any[]): void; | ||
@@ -78,5 +87,4 @@ /** | ||
| */ | ||
| error(...msg : any[]):void; | ||
| error(...msg: any[]): void; | ||
| /** | ||
@@ -86,3 +94,3 @@ * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") | ||
| * | ||
| * @param level 0=trace to 5=silent | ||
| * @param level as a string, like 'error' (case-insensitive) or as a number from 0 to 5 (or as log.levels. values) | ||
| * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling | ||
@@ -92,29 +100,16 @@ * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass | ||
| */ | ||
| setLevel(level : LogLevel, persist? : boolean):void; | ||
| setLevel( | ||
| level: | ||
| LogLevelNumbers | ||
| | 'trace' | ||
| | 'debug' | ||
| | 'info' | ||
| | 'warn' | ||
| | 'error' | ||
| | 'silent' | ||
| | keyof LogLevel, | ||
| persist?: boolean | ||
| ): void; | ||
| /** | ||
| * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") | ||
| * or log.error("something") will output messages, but log.info("something") will not. | ||
| * | ||
| * @param level as a string, like 'error' (case-insensitive) | ||
| * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling | ||
| * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass | ||
| * false as the optional 'persist' second argument, persistence will be skipped. | ||
| */ | ||
| setLevel(level : string, persist? : boolean):void; | ||
| /** | ||
| * This disables all logging below the given level, so that after a log.setLevel("warn") call log.warn("something") | ||
| * or log.error("something") will output messages, but log.info("something") will not. | ||
| * | ||
| * @param level as the value from the enum | ||
| * @param persist Where possible the log level will be persisted. LocalStorage will be used if available, falling | ||
| * back to cookies if not. If neither is available in the current environment (i.e. in Node), or if you pass | ||
| * false as the optional 'persist' second argument, persistence will be skipped. | ||
| */ | ||
| setLevel(level : LogLevel, persist? : boolean):void; | ||
| /** | ||
| * If you're using another JavaScript library that exposes a 'log' global, you can run into conflicts with loglevel. | ||
@@ -125,6 +120,6 @@ * Similarly to jQuery, you can solve this by putting loglevel into no-conflict mode immediately after it is loaded | ||
| */ | ||
| noConflict():any; | ||
| noConflict(): any; | ||
| /** | ||
| * Returns the current logging level, as a value from the enum. | ||
| * Returns the current logging level, as a value from LogLevel. | ||
| * It's very unlikely you'll need to use this for normal application logging; it's provided partly to help plugin | ||
@@ -135,3 +130,3 @@ * development, and partly to let you optimize logging code as below, where debug data is only generated if the | ||
| */ | ||
| getLevel():LogLevel; | ||
| getLevel(): LogLevel[keyof LogLevel]; | ||
@@ -151,3 +146,3 @@ /** | ||
| */ | ||
| setDefaultLevel(level : LogLevel):void; | ||
| setDefaultLevel(level: LogLevel): void; | ||
@@ -166,3 +161,3 @@ /** | ||
| */ | ||
| getLogger(name : String):Log; | ||
| getLogger(name: string): Logger; | ||
@@ -176,3 +171,3 @@ /** | ||
| */ | ||
| enableAll(persist? : boolean):void; | ||
| enableAll(persist?: boolean): void; | ||
@@ -186,10 +181,3 @@ /** | ||
| */ | ||
| disableAll(persist? : boolean):void; | ||
| disableAll(persist?: boolean): void; | ||
| } | ||
| declare var log : Log; | ||
| declare module "loglevel" { | ||
| export = log; | ||
| } |
| { | ||
| "name": "@types/loglevel", | ||
| "version": "1.4.30", | ||
| "version": "1.5.0", | ||
| "description": "TypeScript definitions for loglevel", | ||
@@ -9,11 +9,19 @@ "license": "MIT", | ||
| "name": "Stefan Profanter", | ||
| "url": "https://github.com/Pro" | ||
| "url": "https://github.com/Pro", | ||
| "githubUsername": "Pro" | ||
| }, | ||
| { | ||
| "name": "Florian Wagner", | ||
| "url": "https://github.com/flqw" | ||
| "url": "https://github.com/flqw", | ||
| "githubUsername": "flqw" | ||
| }, | ||
| { | ||
| "name": "Gabor Szmetanko", | ||
| "url": "https://github.com/szmeti" | ||
| "url": "https://github.com/szmeti", | ||
| "githubUsername": "szmeti" | ||
| }, | ||
| { | ||
| "name": "Christian Rackerseder", | ||
| "url": "https://github.com/screendriver", | ||
| "githubUsername": "screendriver" | ||
| } | ||
@@ -28,4 +36,4 @@ ], | ||
| "dependencies": {}, | ||
| "typesPublisherContentHash": "05f6533759cbc5b48725e44eede44ab9aae58a8a6af1a6d1739b0947d2f60dfc", | ||
| "typeScriptVersion": "2.0" | ||
| "typesPublisherContentHash": "40484869039644d6c9ccb5ed02439e4cc4d622276ed1f56a83999cd36aac35e4", | ||
| "typeScriptVersion": "2.1" | ||
| } |
@@ -11,7 +11,7 @@ # Installation | ||
| Additional Details | ||
| * Last updated: Mon, 21 Aug 2017 21:55:03 GMT | ||
| * Last updated: Tue, 26 Sep 2017 23:00:43 GMT | ||
| * Dependencies: none | ||
| * Global values: LogLevel, log | ||
| * Global values: log | ||
| # Credits | ||
| These definitions were written by Stefan Profanter <https://github.com/Pro>, Florian Wagner <https://github.com/flqw>, Gabor Szmetanko <https://github.com/szmeti>. | ||
| These definitions were written by Stefan Profanter <https://github.com/Pro>, Florian Wagner <https://github.com/flqw>, Gabor Szmetanko <https://github.com/szmeti>, Christian Rackerseder <https://github.com/screendriver>. |
10272
-2.52%151
-1.31%