@mkbabb/value.js 0.5.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +35 -53
  3. package/dist/easing.d.ts +49 -0
  4. package/dist/index.d.ts +22 -10
  5. package/dist/math.d.ts +17 -1
  6. package/dist/parsing/animation-shorthand.d.ts +19 -0
  7. package/dist/parsing/color.d.ts +10 -3
  8. package/dist/parsing/extract.d.ts +48 -0
  9. package/dist/parsing/index.d.ts +5 -20
  10. package/dist/parsing/serialize.d.ts +24 -0
  11. package/dist/parsing/stylesheet.d.ts +44 -0
  12. package/dist/parsing/units.d.ts +24 -6
  13. package/dist/parsing/utils.d.ts +19 -0
  14. package/dist/postcss-CRluLK2m.js +6400 -0
  15. package/dist/quantize/cluster.d.ts +45 -0
  16. package/dist/quantize/index.d.ts +14 -0
  17. package/dist/quantize/types.d.ts +39 -0
  18. package/dist/standalone-Ck3UyY5I.js +3458 -0
  19. package/dist/units/color/constants.d.ts +21 -0
  20. package/dist/units/color/contrast.d.ts +35 -0
  21. package/dist/units/color/conversions/cylindrical.d.ts +13 -0
  22. package/dist/units/color/conversions/direct.d.ts +41 -0
  23. package/dist/units/color/conversions/hex.d.ts +3 -0
  24. package/dist/units/color/conversions/index.d.ts +17 -0
  25. package/dist/units/color/conversions/kelvin.d.ts +5 -0
  26. package/dist/units/color/conversions/lab.d.ts +8 -0
  27. package/dist/units/color/conversions/oklab.d.ts +11 -0
  28. package/dist/units/color/conversions/transfer.d.ts +22 -0
  29. package/dist/units/color/conversions/xyz-extended.d.ts +13 -0
  30. package/dist/units/color/dispatch.d.ts +25 -0
  31. package/dist/units/color/gamut.d.ts +6 -0
  32. package/dist/units/color/index.d.ts +221 -116
  33. package/dist/units/color/mix.d.ts +16 -0
  34. package/dist/units/color/normalize.d.ts +3 -3
  35. package/dist/units/index.d.ts +71 -1
  36. package/dist/units/interpolate.d.ts +70 -0
  37. package/dist/units/normalize.d.ts +57 -7
  38. package/dist/units/utils.d.ts +1 -1
  39. package/dist/utils.d.ts +3 -2
  40. package/dist/value.js +4323 -4392
  41. package/package.json +52 -28
  42. package/dist/units/color/utils.d.ts +0 -77
@@ -0,0 +1,16 @@
1
+ import { Color } from '.';
2
+ import { ColorSpace } from './constants';
3
+ import { HueInterpolationMethod } from './dispatch';
4
+ /**
5
+ * Mix N colors with optional per-color weights.
6
+ *
7
+ * @param colors Array of Color objects (must be ≥ 1). All should be
8
+ * normalized (components in [0, 1]).
9
+ * @param weights Optional per-color weights (same length as `colors`).
10
+ * Defaults to equal weighting. Values need not sum to 1 —
11
+ * they are normalized internally.
12
+ * @param space Interpolation color space (default "oklab").
13
+ * @param hueMethod Hue interpolation for cylindrical spaces (default "shorter").
14
+ * @returns A single Color in the interpolation space.
15
+ */
16
+ export declare function mixColorsN(colors: Color[], weights?: number[], space?: ColorSpace, hueMethod?: HueInterpolationMethod): Color;
@@ -1,10 +1,10 @@
1
1
  import { Color, ColorSpaceMap } from '.';
2
2
  import { ValueUnit } from '..';
3
3
  import { ColorSpace } from './constants';
4
- import { HueInterpolationMethod } from './utils';
4
+ import { HueInterpolationMethod } from './dispatch';
5
5
  export type { HueInterpolationMethod };
6
- export declare const normalizeColorUnitComponent: (v: number, unit: string, colorSpace: ColorSpace, component: string, inverse?: boolean) => ValueUnit<number, string>;
6
+ export declare const normalizeColorUnitComponent: (v: number, unit: string | undefined, colorSpace: ColorSpace, component: string, inverse?: boolean) => ValueUnit<number, string>;
7
7
  export declare const normalizeColor: (color: Color<ValueUnit<number> | number>, inverse?: boolean) => Color<ValueUnit<number>>;
8
8
  export declare const normalizeColorUnit: (color: ValueUnit<Color<ValueUnit<number>>, "color">, inverse?: boolean, inplace?: boolean) => ValueUnit<Color<ValueUnit<number>>, "color">;
9
9
  export declare const colorUnit2: <C extends ColorSpace>(color: ValueUnit<Color<ValueUnit<number>>, "color">, to?: C | null, normalized?: boolean, inverse?: boolean, inplace?: boolean) => ValueUnit<ColorSpaceMap<ValueUnit<number>>[C], "color">;
10
- export declare const normalizeColorUnits: (a: ValueUnit<Color<ValueUnit<number>>, "color">, b: ValueUnit<Color<ValueUnit<number>>, "color">, to?: ColorSpace, normalized?: boolean, inverse?: boolean, inplace?: boolean, hueMethod?: HueInterpolationMethod) => readonly [ValueUnit<import('.').RGBColor<ValueUnit<number, string | undefined>> | import('.').HSLColor<ValueUnit<number, string | undefined>> | import('.').HSVColor<ValueUnit<number, string | undefined>> | import('.').HWBColor<ValueUnit<number, string | undefined>> | import('.').LABColor<ValueUnit<number, string | undefined>> | import('.').LCHColor<ValueUnit<number, string | undefined>> | import('.').OKLABColor<ValueUnit<number, string | undefined>> | import('.').OKLCHColor<ValueUnit<number, string | undefined>> | import('.').XYZColor<ValueUnit<number, string | undefined>> | import('.').KelvinColor<ValueUnit<number, string | undefined>> | import('.').LinearSRGBColor<ValueUnit<number, string | undefined>> | import('.').DisplayP3Color<ValueUnit<number, string | undefined>> | import('.').AdobeRGBColor<ValueUnit<number, string | undefined>> | import('.').ProPhotoRGBColor<ValueUnit<number, string | undefined>> | import('.').Rec2020Color<ValueUnit<number, string | undefined>>, "color">, ValueUnit<import('.').RGBColor<ValueUnit<number, string | undefined>> | import('.').HSLColor<ValueUnit<number, string | undefined>> | import('.').HSVColor<ValueUnit<number, string | undefined>> | import('.').HWBColor<ValueUnit<number, string | undefined>> | import('.').LABColor<ValueUnit<number, string | undefined>> | import('.').LCHColor<ValueUnit<number, string | undefined>> | import('.').OKLABColor<ValueUnit<number, string | undefined>> | import('.').OKLCHColor<ValueUnit<number, string | undefined>> | import('.').XYZColor<ValueUnit<number, string | undefined>> | import('.').KelvinColor<ValueUnit<number, string | undefined>> | import('.').LinearSRGBColor<ValueUnit<number, string | undefined>> | import('.').DisplayP3Color<ValueUnit<number, string | undefined>> | import('.').AdobeRGBColor<ValueUnit<number, string | undefined>> | import('.').ProPhotoRGBColor<ValueUnit<number, string | undefined>> | import('.').Rec2020Color<ValueUnit<number, string | undefined>>, "color">, HueInterpolationMethod | undefined];
10
+ export declare const normalizeColorUnits: (a: ValueUnit<Color<ValueUnit<number>>, "color">, b: ValueUnit<Color<ValueUnit<number>>, "color">, to?: ColorSpace, normalized?: boolean, inverse?: boolean, inplace?: boolean, hueMethod?: HueInterpolationMethod) => readonly [ValueUnit<import('.').RGBColor<ValueUnit<number, string>> | import('.').HSLColor<ValueUnit<number, string>> | import('.').HSVColor<ValueUnit<number, string>> | import('.').HWBColor<ValueUnit<number, string>> | import('.').LABColor<ValueUnit<number, string>> | import('.').LCHColor<ValueUnit<number, string>> | import('.').OKLABColor<ValueUnit<number, string>> | import('.').OKLCHColor<ValueUnit<number, string>> | import('.').XYZColor<ValueUnit<number, string>> | import('.').KelvinColor<ValueUnit<number, string>> | import('.').LinearSRGBColor<ValueUnit<number, string>> | import('.').DisplayP3Color<ValueUnit<number, string>> | import('.').AdobeRGBColor<ValueUnit<number, string>> | import('.').ProPhotoRGBColor<ValueUnit<number, string>> | import('.').Rec2020Color<ValueUnit<number, string>>, "color">, ValueUnit<import('.').RGBColor<ValueUnit<number, string>> | import('.').HSLColor<ValueUnit<number, string>> | import('.').HSVColor<ValueUnit<number, string>> | import('.').HWBColor<ValueUnit<number, string>> | import('.').LABColor<ValueUnit<number, string>> | import('.').LCHColor<ValueUnit<number, string>> | import('.').OKLABColor<ValueUnit<number, string>> | import('.').OKLCHColor<ValueUnit<number, string>> | import('.').XYZColor<ValueUnit<number, string>> | import('.').KelvinColor<ValueUnit<number, string>> | import('.').LinearSRGBColor<ValueUnit<number, string>> | import('.').DisplayP3Color<ValueUnit<number, string>> | import('.').AdobeRGBColor<ValueUnit<number, string>> | import('.').ProPhotoRGBColor<ValueUnit<number, string>> | import('.').Rec2020Color<ValueUnit<number, string>>, "color">, HueInterpolationMethod | undefined];
@@ -1,6 +1,9 @@
1
1
  import { UNITS } from './constants';
2
+ import { ColorSpace } from './color/constants';
3
+ import { HueInterpolationMethod } from './color/dispatch';
4
+ import { ColorChannelPlan } from './interpolate';
2
5
  export { registerColorNames, clearCustomColorNames, getCustomColorNames } from '../parsing/color';
3
- export declare class ValueUnit<T = any, U = (typeof UNITS)[number] | string> {
6
+ export declare class ValueUnit<T = any, U extends string = Exclude<(typeof UNITS)[number], undefined> | string> {
4
7
  value: T;
5
8
  unit?: U | undefined;
6
9
  superType?: string[] | undefined;
@@ -8,6 +11,23 @@ export declare class ValueUnit<T = any, U = (typeof UNITS)[number] | string> {
8
11
  property?: string | undefined;
9
12
  targets?: HTMLElement[] | undefined;
10
13
  constructor(value: T, unit?: U | undefined, superType?: string[] | undefined, subProperty?: string | undefined, property?: string | undefined, targets?: HTMLElement[] | undefined);
14
+ /**
15
+ * Fully unwrap a (possibly nested) `ValueUnit`, returning the innermost
16
+ * non-`ValueUnit` value.
17
+ *
18
+ * **G.W2 Lane D (G-OPP-5)** — codifies the Mar 2026 iOS Safari
19
+ * stack-overflow fix as a first-class `ValueUnit` primitive. The
20
+ * `while (raw instanceof ValueUnit) raw = raw.value` idiom was inlined
21
+ * across the color pipeline + the parser; each inline copy was a place the
22
+ * `VU<VU<…>>` accumulation guard could silently drift. This static is the
23
+ * single source of truth — see `test/recursion-guard.test.ts`.
24
+ *
25
+ * The conditional return type peels exactly one `ValueUnit` layer at the
26
+ * type level (`ValueUnit` payloads can themselves be `ValueUnit` only via
27
+ * the bug class this guards against, so one peel is the honest static
28
+ * type); at runtime the `while` loop peels every layer.
29
+ */
30
+ static unwrapDeep<T>(x: T): T extends ValueUnit<infer V> ? V : T;
11
31
  setSubProperty(subProperty: any): void;
12
32
  setProperty(property: any): void;
13
33
  setTargets(targets: HTMLElement[]): void;
@@ -48,4 +68,54 @@ export type InterpolatedVar<T> = {
48
68
  stop: ValueUnit<T>;
49
69
  value: ValueUnit<T>;
50
70
  computed: boolean;
71
+ /**
72
+ * For color interpolation in cylindrical spaces (hsl/hsv/hwb/lch/oklch):
73
+ * which hue-direction method to use. Defaults to `"shorter"` per CSS
74
+ * Color 4 §12.4 when omitted.
75
+ */
76
+ hueMethod?: HueInterpolationMethod;
77
+ /**
78
+ * For color interpolation: the color space the start/stop endpoints have
79
+ * been normalised into. Drives the choice of which component is the hue
80
+ * channel in `lerpColorValue`.
81
+ */
82
+ colorSpace?: ColorSpace;
83
+ /**
84
+ * Pre-resolved dispatch function set by `prepareInterpVar`. Avoids three
85
+ * sequential type checks per `lerpValue` call in hot paths. Optional —
86
+ * external callers can construct an `InterpolatedVar` without it and the
87
+ * runtime dispatch in `lerpValue` will resolve at call time.
88
+ */
89
+ _lerp?: (t: number, iv: InterpolatedVar<any>) => ValueUnit<any>;
90
+ /**
91
+ * Frozen color-channel plan set by `prepareInterpVar` for color ivs (B3).
92
+ * Drives the closure-free per-frame loop in `lerpColorValue`; absent for
93
+ * non-color ivs and externally constructed colors (which take the fallback
94
+ * walk). Typed loosely here to avoid a cycle with `interpolate.ts`.
95
+ */
96
+ _colorPlan?: ColorChannelPlan;
97
+ /**
98
+ * Resolved computed-endpoint cache set by `lerpComputedValue` for computed
99
+ * ivs (C1, tranche-F Wave C). A computed leaf (`var`/`calc`) re-resolves
100
+ * BOTH endpoints against the live box every frame — but the resolved pair
101
+ * is invariant while the layout epoch is stable, so the first frame after a
102
+ * (re)resolve stamps `(startN, stopN, unit, target, epoch)` here and every
103
+ * later frame collapses to a bare `lerp(startN, stopN, t)`. Invalidated
104
+ * when the target changes or the layout epoch advances (resize). Absent for
105
+ * non-computed ivs. Typed loosely to avoid a cycle with `interpolate.ts`.
106
+ */
107
+ _computedCache?: ComputedEndpointCache;
108
+ };
109
+ /**
110
+ * The resolved-endpoint cache stamped on a computed `InterpolatedVar` (C1).
111
+ * `target` and `epoch` are the invalidation keys: a steady frame whose live
112
+ * target and layout epoch both match the stamp serves `startN`/`stopN`/`unit`
113
+ * directly; any mismatch re-resolves both endpoints and re-stamps.
114
+ */
115
+ export type ComputedEndpointCache = {
116
+ startN: number;
117
+ stopN: number;
118
+ unit: string | undefined;
119
+ target: HTMLElement;
120
+ epoch: number;
51
121
  };
@@ -0,0 +1,70 @@
1
+ import { Color } from './color';
2
+ import { ValueUnit, InterpolatedVar } from './index';
3
+ /**
4
+ * Interpolate a `ValueUnit` whose unit is *computed* (`var`, `calc`,
5
+ * `vh`, `vw`, etc.) by resolving both endpoints against a target
6
+ * element's live computed style and lerping the resulting numeric
7
+ * values.
8
+ *
9
+ * C1 (tranche-F Wave C) — the endpoint cache. The resolved
10
+ * `(startN, stopN, unit)` pair is invariant while the layout epoch is
11
+ * stable, so it is cached on the iv (`_computedCache`) the first frame
12
+ * and every later steady frame collapses to a bare
13
+ * `lerp(startN, stopN, t)` — no `getComputedValue` memo call, no
14
+ * `value.toString()`, no forced reflow. The cache busts when the live
15
+ * target changes or the layout epoch advances (resize → `bumpLayoutEpoch`).
16
+ * Pixel-identical while the epoch is stable.
17
+ *
18
+ * Mutates and returns the `value` field of the InterpolatedVar.
19
+ */
20
+ export declare function lerpComputedValue(t: number, iv: InterpolatedVar<any>): ValueUnit<any>;
21
+ /**
22
+ * A `Color` at interpolation time: its channels may be raw `number`s (numeric
23
+ * pipeline) or `ValueUnit<number>` wrappers (parser-produced colors). Both
24
+ * shapes flow through `lerpColorValue`; the per-channel `instanceof ValueUnit`
25
+ * branch dispatches between them.
26
+ */
27
+ type InterpColor = Color<ValueUnit<number> | number>;
28
+ /**
29
+ * Frozen per-frame color-channel plan (B3). Built once at `prepareInterpVar`;
30
+ * drives `lerpColorValue`'s closure-free hot loop. Parallel arrays (a light SoA)
31
+ * indexed by channel position: the unwrapped start/stop numbers, the hue
32
+ * channel index (or -1), the destination ValueUnit ref per channel (or null
33
+ * when the destination slot is a raw number written via `setChannel`).
34
+ */
35
+ export type ColorChannelPlan = {
36
+ keys: readonly string[];
37
+ startN: Float64Array;
38
+ stopN: Float64Array;
39
+ hueIndex: number;
40
+ dstVU: (ValueUnit<number> | null)[];
41
+ };
42
+ /**
43
+ * Interpolate a colour `ValueUnit` (`unit === "color"`). Walks each
44
+ * channel of the parsed `Color` instance and lerps independently. The
45
+ * surrounding `normalizeColorUnits` step is responsible for putting
46
+ * `start` / `stop` in the same colour space (oklab, oklch, etc.) and
47
+ * for hue handling.
48
+ */
49
+ export declare function lerpColorValue(t: number, iv: InterpolatedVar<InterpColor>): ValueUnit<InterpColor>;
50
+ /** Lerp a simple numeric InterpolatedVar in-place. */
51
+ export declare function lerpNumericValue(t: number, { start, stop, value }: InterpolatedVar<number>): ValueUnit<number>;
52
+ /**
53
+ * Interpolate any `InterpolatedVar` at progress `t`.
54
+ *
55
+ * Uses a pre-resolved dispatch function (`_lerp`) when the
56
+ * InterpolatedVar was created via `prepareInterpVar` — avoids three
57
+ * sequential type checks per call in hot paths. Falls back to
58
+ * runtime dispatch for externally constructed values.
59
+ */
60
+ export declare function lerpValue(t: number, iv: InterpolatedVar<any>): ValueUnit<any> | undefined;
61
+ /**
62
+ * Pre-resolve the interpolation dispatch function on an
63
+ * `InterpolatedVar`. Sets a hidden `_lerp` property used by
64
+ * `lerpValue`'s fast path.
65
+ *
66
+ * Call once per InterpolatedVar after `normalizeValueUnits`; the
67
+ * dispatch is invariant for the lifetime of the InterpolatedVar.
68
+ */
69
+ export declare function prepareInterpVar(iv: InterpolatedVar<any>): InterpolatedVar<any>;
70
+ export {};
@@ -1,9 +1,59 @@
1
1
  import { ValueUnit, InterpolatedVar } from '.';
2
- export declare const getComputedValue: ((value: ValueUnit, target: HTMLElement) => ValueUnit<any, any>) & {
3
- cache: Map<string, {
4
- value: ValueUnit<any, any>;
5
- timestamp: number;
6
- }>;
7
- };
2
+ import { ColorSpace } from './color/constants';
3
+ import { HueInterpolationMethod } from './color/dispatch';
4
+ import { isColorUnit } from './utils';
5
+ /** The current layout-epoch generation. Bumped on resize. */
6
+ export declare const getLayoutEpoch: () => number;
7
+ /**
8
+ * Invalidate every layout-epoch-stamped cache (the C1 endpoint cache and the
9
+ * `getComputedValue` memo) by advancing the generation counter. Call on any
10
+ * event that changes a computed-unit resolution — a viewport `resize`, a
11
+ * container `ResizeObserver` callback, a writing-mode flip, etc. Cheap (one
12
+ * integer increment + one memo clear); the next computed frame re-resolves.
13
+ */
14
+ export declare const bumpLayoutEpoch: () => number;
15
+ /**
16
+ * Resolve a computed CSS value (`var()`, `calc()`, or other
17
+ * deferred-evaluation unit) against a target element by writing it
18
+ * into the target's inline style and reading back the computed
19
+ * style. Memoised by `(value.toString(), element-id)`.
20
+ *
21
+ * For `calc()` values whose `subProperty` names a transform axis
22
+ * (`translateX`, `scaleY`, etc.), the round-trip yields a `matrix()`
23
+ * or `matrix3d()`; this function decomposes the matrix to recover
24
+ * the resolved numeric value for that single axis.
25
+ *
26
+ * Caching is suppressed when the target is disconnected — layout
27
+ * units (`vh`, `cqw`, etc.) resolve to 0 outside the live tree, so
28
+ * caching that value would poison later reads.
29
+ */
30
+ export declare const getComputedValue: import('../utils').Memoized<(value: ValueUnit, target?: HTMLElement) => ValueUnit<any, any>>;
31
+ /**
32
+ * Convert two `ValueUnit`s of the same superType to a common base
33
+ * unit: length → px, angle → deg, time → ms, resolution → dpi.
34
+ *
35
+ * Throws if either input has a unit that isn't recognised for its
36
+ * superType — silent passthrough hides bugs upstream.
37
+ */
8
38
  export declare const normalizeNumericUnits: (a: ValueUnit, b: ValueUnit, inplace?: boolean) => [ValueUnit, ValueUnit];
9
- export declare function normalizeValueUnits(left: ValueUnit, right: ValueUnit): InterpolatedVar<any>;
39
+ export type NormalizeValueUnitsOptions = {
40
+ /** Color space for color interpolation. Default: `"oklab"`. */
41
+ colorSpace?: ColorSpace;
42
+ /** Hue interpolation method for cylindrical color spaces. */
43
+ hueMethod?: HueInterpolationMethod;
44
+ };
45
+ /**
46
+ * Compute an `InterpolatedVar` from two endpoint `ValueUnit`s,
47
+ * preparing them for later `lerpValue` calls.
48
+ *
49
+ * - Colors: collapsed to a common space via `normalizeColorUnits`.
50
+ * `colorSpace` defaults to `oklab` (perceptually uniform); `hueMethod`
51
+ * selects the cylindrical hue interpolation strategy.
52
+ * - Mixed units (e.g. `10px` ↔ `1em`): collapsed via
53
+ * `normalizeNumericUnits` to a common base unit.
54
+ * - Computed units (`var`, `calc`, `vh`, `cqw`, etc.): left as-is and
55
+ * marked `computed: true`. The actual numeric resolution happens
56
+ * later in `lerpComputedValue` against a live target.
57
+ */
58
+ export declare function normalizeValueUnits(left: ValueUnit, right: ValueUnit, options?: NormalizeValueUnitsOptions): InterpolatedVar<unknown>;
59
+ export { isColorUnit };
@@ -1,7 +1,7 @@
1
1
  import { FunctionValue, ValueUnit } from '.';
2
2
  import { Color } from './color';
3
3
  import { ABSOLUTE_LENGTH_UNITS, ANGLE_UNITS, FREQUENCY_UNITS, PERCENTAGE_UNITS, RELATIVE_LENGTH_UNITS, RESOLUTION_UNITS, STYLE_NAMES, TIME_UNITS, UNITS, MatrixValues } from './constants';
4
- export declare function isColorUnit(value: ValueUnit<Color<ValueUnit>>): value is ValueUnit<Color<ValueUnit>>;
4
+ export declare function isColorUnit(value: ValueUnit): value is ValueUnit<Color<ValueUnit>>;
5
5
  export declare const flattenObject: (obj: any) => Record<string, any>;
6
6
  export declare const unflattenObject: (flatObj: Record<string, any[]>) => any;
7
7
  export declare const unflattenObjectToString: (flatObj: Record<string, any[]>) => Record<string, string>;
package/dist/utils.d.ts CHANGED
@@ -15,14 +15,15 @@ export interface MemoizeOptions<T extends (...args: any[]) => any = (...args: an
15
15
  /** When provided, the result is only cached if this returns true. */
16
16
  shouldCache?: (result: ReturnType<T>, ...args: Parameters<T>) => boolean;
17
17
  }
18
- export declare function memoize<T extends (...args: any[]) => any>(func: T, options?: MemoizeOptions<T>): T & {
18
+ export type Memoized<T extends (...args: any[]) => any> = T & {
19
19
  cache: Map<string, {
20
20
  value: ReturnType<T>;
21
21
  timestamp: number;
22
22
  }>;
23
23
  };
24
+ export declare function memoize<T extends (...args: any[]) => any>(func: T, options?: MemoizeOptions<T>): Memoized<T>;
24
25
  export declare const hyphenToCamelCase: (str: string) => string;
25
26
  export declare function camelCaseToHyphen(str: string): string;
26
27
  export declare function seekPreviousValue<T>(ix: number, values: T[], pred: (f: T) => boolean): number | undefined;
27
- export declare function requestAnimationFrame(callback: FrameRequestCallback): number | NodeJS.Timeout;
28
+ export declare function requestAnimationFrame(callback: FrameRequestCallback): number;
28
29
  export declare function cancelAnimationFrame(handle: number | undefined | null | any): void;