From e05d0622a161160d1f59312b7bb7defd0201d066 Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Tue, 13 Sep 2022 01:02:22 -0500 Subject: [PATCH] feat: including typesript types. --- index.d.ts | 15 +++++++++++++++ package.json | 31 ++++++++++++++++--------------- 2 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 index.d.ts diff --git a/index.d.ts b/index.d.ts new file mode 100644 index 0000000..de3cd13 --- /dev/null +++ b/index.d.ts @@ -0,0 +1,15 @@ +declare type BunyanLogFunction = (formatMessage?: string, ...interpolationArg?: unknown) => void; +declare type DebugLogFunction = (formatMessage?: string, ...interpolationArg?: unknown) => void; +declare type PinoLogFunction = (merginObject?: unknown, formatMessage?: string, ...interpolationArg?: unknown) => void; +declare type LlogFunction = BunyanLogFunction | DebugLogFunction | PinoLogFunction; + +declare module "llog" { + export default { + trace: LlogFunction, + debug: LlogFunction, + info: LlogFunction, + warn: LlogFunction, + error: LlogFunction, + fatal: LlogFunction, + } +} \ No newline at end of file diff --git a/package.json b/package.json index 8a15d3b..38a42f3 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,24 @@ { - "name": "llog", - "version": "0.0.0-development", + "author": "mattwalters5@gmail.com", + "dependencies": { + "debug": "^4.3.4" + }, "description": "simple multi-level application logging module", - "main": "index.js", - "scripts": { - "perf-test": "time node ./test/load-test.js >> /dev/null", - "pre-test": "npm install bunyan pino --no-save", - "test": "make test" + "devDependencies": { + "mocha": "10.0.0" }, + "license": "BSD-2-Clause", + "main": "index.js", + "name": "llog", "repository": { "type": "git", "url": "git@github.com:mateodelnorte/llog.git" }, - "author": "mattwalters5@gmail.com", - "license": "BSD-2-Clause", - "dependencies": { - "debug": "^4.3.4" + "scripts": { + "perf-test": "time node ./test/load-test.js >> /dev/null", + "pre-test": "npm install bunyan pino --no-save", + "test": "make test" }, - "devDependencies": { - "mocha": "10.0.0" - } -} + "types": "index.d.ts", + "version": "0.0.0-development" +} \ No newline at end of file