|
| 1 | +/** |
| 2 | + * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | + * |
| 4 | + * This source code is licensed under the MIT license found in the |
| 5 | + * LICENSE file in the root directory of this source tree. |
| 6 | + * |
| 7 | + * @flow |
| 8 | + * @format |
| 9 | + */ |
| 10 | + |
| 11 | +// stubbed from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/451dc8fc19383bc12af59522020e571957f1684e/types/debug/index.d.ts |
| 12 | + |
| 13 | +declare module 'debug' { |
| 14 | + declare interface Formatters { |
| 15 | + [formatter: string]: (v: mixed) => string; |
| 16 | + } |
| 17 | + |
| 18 | + declare type Debugger = {| |
| 19 | + (format: mixed, ...args: Array<mixed>): void, |
| 20 | + color: string, |
| 21 | + diff: number, |
| 22 | + enabled: boolean, |
| 23 | + log: (format: mixed, ...args: Array<mixed>) => mixed, |
| 24 | + namespace: string, |
| 25 | + destroy: () => boolean, |
| 26 | + extend: (namespace: string, delimiter?: string) => Debugger, |
| 27 | + |}; |
| 28 | + |
| 29 | + declare type Debug = {| |
| 30 | + (namespace: string): Debugger, |
| 31 | + coerce: (val: mixed) => mixed, |
| 32 | + disable: () => string, |
| 33 | + enable: (namespaces: string) => void, |
| 34 | + enabled: (namespaces: string) => boolean, |
| 35 | + formatArgs: (args: Array<mixed>) => void, |
| 36 | + log: (format: mixed, ...args: Array<mixed>) => mixed, |
| 37 | + selectColor: (namespace: string) => string | number, |
| 38 | + // this should be of type require('ms') but it doesn't play nicely with eslint |
| 39 | + // unless we add ms to dependencies, which we don't want to do |
| 40 | + humanize: $FlowFixMe, |
| 41 | + names: RegExp[], |
| 42 | + skips: RegExp[], |
| 43 | + formatters: Formatters, |
| 44 | + inspectOpts?: { |
| 45 | + hideDate?: boolean | number | null, |
| 46 | + colors?: boolean | number | null, |
| 47 | + depth?: boolean | number | null, |
| 48 | + showHidden?: boolean | number | null, |
| 49 | + ... |
| 50 | + }, |
| 51 | + |}; |
| 52 | + |
| 53 | + declare module.exports: Debug; |
| 54 | +} |
0 commit comments