-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Closed
Labels
bugSomething isn't workingSomething isn't workingnode.jsCompatibility with Node.js APIsCompatibility with Node.js APIstypesAn issue with TypeScript typesAn issue with TypeScript types
Description
tldr: temporary safe(ish) workaround:
declare module 'perf_hooks' {
interface CreateHistogramOptions {
/**
* The minimum recordable value. Must be an integer value greater than 0.
* @default 1
*/
lowest?: bigint | number;
/**
* The maximum recordable value. Must be an integer value greater than min.
* @default Number.MAX_SAFE_INTEGER
*/
highest?: bigint | number;
}
}
const responseTimeHistogram = createHistogram({
lowest: 20, // works :D
});This issue exists here on the Bun repo as reference for those trying to use the createHistogram() api. The options object should accept lowest/highest instead of min/max
The real problem exists in Node's types, so I've opened a PR in @types/node to fix it: DefinitelyTyped/DefinitelyTyped#72876
We can close this issue here once that PR merges
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingnode.jsCompatibility with Node.js APIsCompatibility with Node.js APIstypesAn issue with TypeScript typesAn issue with TypeScript types