Skip to content

Instantly share code, notes, and snippets.

@milesj
Created October 9, 2020 22:43
Show Gist options
  • Save milesj/4a96771a6f11ef2d3c00ab96d570d781 to your computer and use it in GitHub Desktop.
Save milesj/4a96771a6f11ef2d3c00ab96d570d781 to your computer and use it in GitHub Desktop.
/// <reference types="debug" />
declare module "color" {
export interface ColorFormatter {
(message: string | {
toString: () => string;
}): string;
}
const _default: {
fail: ColorFormatter;
mute: ColorFormatter;
pass: ColorFormatter;
filePath: ColorFormatter;
moduleName: ColorFormatter;
projectName: ColorFormatter;
symbol: ColorFormatter;
};
export default _default;
}
declare module "createInternalDebugger" {
import { Debugger } from 'debug';
export function sentenceCase(value: unknown): string;
export default function createInternalDebugger(namespace: string): Debugger;
}
declare module "createScopedError" {
export interface Errors {
[code: string]: string;
}
export interface ScopedError<Code extends string = string> {
code: Code | 'UNKNOWN_ERROR';
scope: string;
}
export default function createScopedError<Code extends string = string>(scope: string, name: string, errors: Errors): new (code: Code, params?: unknown[]) => Error & ScopedError<Code>;
}
declare module "env" {
export default function env<T extends string = string>(key: string, value?: T | null): T | undefined;
}
declare module "index" {
/**
* @copyright 2020, Miles Johnson
* @license https://opensource.org/licenses/MIT
*/
import color from "color";
import createInternalDebugger from "createInternalDebugger";
import createScopedError from "createScopedError";
import env from "env";
export { color, createInternalDebugger, createScopedError, env };
}
//# sourceMappingURL=index.d.ts.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment