Skip to content

Commit

Permalink
WIP: createLogger typings
Browse files Browse the repository at this point in the history
  • Loading branch information
Mitsunee committed Nov 16, 2024
1 parent dd4e8a5 commit 98d715c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@

import type { LogLevelOpts } from "./LogLevel";

function createLogger<TKey extends string>(
levels: Array<LogLevelOpts & { name: TKey }>
) {
interface LogLevelSettings<TKey extends string>
extends Omit<LogLevelOpts, "padLen"> {
name: TKey;
}

interface CreateLoggerOpts<TKey extends string> {
levels: Array<LogLevelSettings<TKey>>;
defaultLevel: TKey;
}

function createLogger<TKey extends string>({
levels,
defaultLevel
}: CreateLoggerOpts<TKey>) {
return {} as Record<Lowercase<TKey>, () => void>;
}

0 comments on commit 98d715c

Please sign in to comment.