Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions flow-typed/npm/debug_v2.x.x.js

This file was deleted.

54 changes: 54 additions & 0 deletions flow-typed/npm/debug_v4.4.x.js
Original file line number Diff line number Diff line change
@@ -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;
}
Loading