update the npm package "debug" flow types to v4.4.x (#49980)

Summary:
X-link: https://github.com/facebook/metro/pull/1462

Pull Request resolved: https://github.com/facebook/react-native/pull/49980

Changelog:
[General][Internal] update the npm package "debug" flow types to v4.4.x

Reviewed By: robhogan

Differential Revision: D70976838

fbshipit-source-id: 7ca7daf5e7677721b0464c66dd482a40cea3ae61
This commit is contained in:
Vitali Zaidman
2025-03-13 04:10:38 -07:00
committed by Facebook GitHub Bot
parent 1bb7446993
commit e2eed3984e
2 changed files with 54 additions and 28 deletions
-28
View File
@@ -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<mixed>): 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,
};
}
+54
View File
@@ -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<mixed>): void,
color: string,
diff: number,
enabled: boolean,
log: (format: mixed, ...args: Array<mixed>) => 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<mixed>) => void,
log: (format: mixed, ...args: Array<mixed>) => 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;
}