UNPKG

@rickosborne/rebound

Version:

Rick Osborne's utilities for working with bounded numbers

12 lines 849 B
import type { If } from "./guard-bounded.js"; import type { TypedCheckedBounds } from "./spec.js"; export interface ScaleExact<Input extends number, Output extends number> extends TypedCheckedBounds { (this: void, value: Input): Output; } export interface ScaleIfPresent<Input extends number, Output extends number> extends TypedCheckedBounds { (this: void, value: Input): Output; (this: void, value: null | undefined): undefined; (this: void, value: Input | null | undefined): Output | undefined; } export declare const scaleBounded: <Input extends number, Output extends number, IfPresent extends boolean>(inputBounds: TypedCheckedBounds, outputBounds: TypedCheckedBounds, ifPresent: IfPresent, fnName?: string) => If<IfPresent, ScaleIfPresent<Input, Output>, ScaleExact<Input, Output>>; //# sourceMappingURL=scale-bounded.d.ts.map