diff --git a/flow-typed/npm/debug_v2.x.x.js b/flow-typed/npm/debug_v2.x.x.js deleted file mode 100644 index 675c2fe6fce..00000000000 --- a/flow-typed/npm/debug_v2.x.x.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow - * @format - */ - -// https://github.com/visionmedia/debug -// https://www.npmjs.com/package/debug - -interface DebugFN { - (...args: Array): void; - enable(match: string): void; - disable(): void; - enabled: () => boolean; -} - -declare module 'debug' { - declare module.exports: { - (namespace: string): DebugFN, - enable(match: string): void, - disable(): void, - enabled: () => boolean, - }; -} diff --git a/flow-typed/npm/debug_v4.4.x.js b/flow-typed/npm/debug_v4.4.x.js new file mode 100644 index 00000000000..fea4ad05c4d --- /dev/null +++ b/flow-typed/npm/debug_v4.4.x.js @@ -0,0 +1,54 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + * @format + */ + +// stubbed from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/451dc8fc19383bc12af59522020e571957f1684e/types/debug/index.d.ts + +declare module 'debug' { + declare interface Formatters { + [formatter: string]: (v: mixed) => string; + } + + declare type Debugger = {| + (format: mixed, ...args: Array): void, + color: string, + diff: number, + enabled: boolean, + log: (format: mixed, ...args: Array) => mixed, + namespace: string, + destroy: () => boolean, + extend: (namespace: string, delimiter?: string) => Debugger, + |}; + + declare type Debug = {| + (namespace: string): Debugger, + coerce: (val: mixed) => mixed, + disable: () => string, + enable: (namespaces: string) => void, + enabled: (namespaces: string) => boolean, + formatArgs: (args: Array) => void, + log: (format: mixed, ...args: Array) => mixed, + selectColor: (namespace: string) => string | number, + // this should be of type require('ms') but it doesn't play nicely with eslint + // unless we add ms to dependencies, which we don't want to do + humanize: $FlowFixMe, + names: RegExp[], + skips: RegExp[], + formatters: Formatters, + inspectOpts?: { + hideDate?: boolean | number | null, + colors?: boolean | number | null, + depth?: boolean | number | null, + showHidden?: boolean | number | null, + ... + }, + |}; + + declare module.exports: Debug; +}