@mkbabb/value.js 0.2.0 → 0.3.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.
package/dist/value.d.ts CHANGED
@@ -33,8 +33,28 @@ export declare const ANGLE_UNITS: readonly ["deg", "rad", "grad", "turn"];
33
33
 
34
34
  export declare const arrayEquals: (a: any[], b: any[]) => boolean;
35
35
 
36
+ export declare const bezierPresets: {
37
+ readonly ease: readonly [0.25, 0.1, 0.25, 1];
38
+ readonly "ease-in": readonly [0.42, 0, 1, 1];
39
+ readonly "ease-out": readonly [0, 0, 0.58, 1];
40
+ readonly "ease-in-out": readonly [0.42, 0, 0.58, 1];
41
+ readonly "ease-in-back": readonly [0.6, -0.28, 0.735, 0.045];
42
+ readonly "ease-out-back": readonly [0.175, 0.885, 0.32, 1.275];
43
+ readonly "ease-in-out-back": readonly [0.68, -0.55, 0.265, 1.55];
44
+ };
45
+
36
46
  export declare const BLACKLISTED_COALESCE_UNITS: readonly ["string", "var", "calc"];
37
47
 
48
+ export declare function bounceInEase(t: number): number;
49
+
50
+ export declare function bounceInEaseHalf(t: number): number;
51
+
52
+ export declare function bounceInOutEase(t: number): number;
53
+
54
+ export declare function bounceOutEase(t: number): number;
55
+
56
+ export declare function bounceOutEaseHalf(t: number): number;
57
+
38
58
  export declare function camelCaseToHyphen(str: string): string;
39
59
 
40
60
  declare function cancelAnimationFrame_2(handle: number | undefined | null | any): void;
@@ -1027,6 +1047,10 @@ export declare const CSSColor: {
1027
1047
  div: Parser<string>;
1028
1048
  };
1029
1049
 
1050
+ export declare const CSSCubicBezier: (x1: number, y1: number, x2: number, y2: number) => (t: number) => number;
1051
+
1052
+ export declare function cssFiltersToString(filters: number[]): string;
1053
+
1030
1054
  export declare const CSSFunction: {
1031
1055
  Function: Parser<any>;
1032
1056
  Value: Parser<any>;
@@ -1094,6 +1118,38 @@ export declare class DisplayP3Color<T = number> extends Color<T> {
1094
1118
  set b(value: T);
1095
1119
  }
1096
1120
 
1121
+ export declare function easeInBounce(t: number): number;
1122
+
1123
+ export declare function easeInCirc(t: number): number;
1124
+
1125
+ export declare function easeInCubic(t: number): number;
1126
+
1127
+ export declare function easeInExpo(t: number): number;
1128
+
1129
+ export declare function easeInOutCirc(t: number): number;
1130
+
1131
+ export declare function easeInOutCubic(t: number): number;
1132
+
1133
+ export declare function easeInOutExpo(t: number): number;
1134
+
1135
+ export declare function easeInOutQuad(t: number): number;
1136
+
1137
+ export declare function easeInOutSine(t: number): number;
1138
+
1139
+ export declare function easeInQuad(t: number): number;
1140
+
1141
+ export declare function easeInSine(t: number): number;
1142
+
1143
+ export declare function easeOutCirc(t: number): number;
1144
+
1145
+ export declare function easeOutCubic(t: number): number;
1146
+
1147
+ export declare function easeOutExpo(t: number): number;
1148
+
1149
+ export declare function easeOutQuad(t: number): number;
1150
+
1151
+ export declare function easeOutSine(t: number): number;
1152
+
1097
1153
  /** Parser that always fails with the given message. */
1098
1154
  export declare function fail(message: string): Parser<never>;
1099
1155
 
@@ -1298,6 +1354,8 @@ export declare const isObject: (value: any) => boolean;
1298
1354
  /** Case-insensitive string match. Returns the matched portion of the input. */
1299
1355
  export declare const istring: (str: string) => Parser<string>;
1300
1356
 
1357
+ export declare const jumpTerms: readonly ["jump-start", "jump-end", "jump-none", "jump-both", "start", "end", "both"];
1358
+
1301
1359
  export declare const kelvin2rgb: ({ kelvin, alpha }: KelvinColor) => RGBColor;
1302
1360
 
1303
1361
  export declare function kelvin2xyz(kelvin: KelvinColor): XYZColor;
@@ -1344,6 +1402,8 @@ export declare const LENGTH_UNITS: readonly ["px", "cm", "mm", "Q", "in", "pc",
1344
1402
 
1345
1403
  export declare function lerp(t: number, start: number, end: number): number;
1346
1404
 
1405
+ export declare function linear(t: number): number;
1406
+
1347
1407
  export declare const LINEAR_SRGB_TO_LMS: Mat3;
1348
1408
 
1349
1409
  export declare function linearSrgb2xyz({ r, g, b, alpha }: LinearSRGBColor): XYZColor;
@@ -1561,6 +1621,12 @@ export { requestAnimationFrame_2 as requestAnimationFrame }
1561
1621
 
1562
1622
  export declare const RESOLUTION_UNITS: readonly ["dpi", "dpcm", "dppx", "cqw"];
1563
1623
 
1624
+ export declare function rgb2ColorFilter(color: RGBColor<number>): {
1625
+ values: number[];
1626
+ loss: number;
1627
+ filter: string;
1628
+ };
1629
+
1564
1630
  export declare const rgb2hex: ({ r, g, b, alpha }: RGBColor) => string;
1565
1631
 
1566
1632
  export declare const rgb2hsl: ({ r, g, b, alpha }: RGBColor) => HSLColor;
@@ -1598,6 +1664,8 @@ export declare function seekPreviousValue<T>(ix: number, values: T[], pred: (f:
1598
1664
 
1599
1665
  export declare function sleep(ms: number): Promise<unknown>;
1600
1666
 
1667
+ export declare function smoothStep3(t: number): number;
1668
+
1601
1669
  export declare function srgbToLinear(channel: number): number;
1602
1670
 
1603
1671
  /**
@@ -1606,6 +1674,12 @@ export declare function srgbToLinear(channel: number): number;
1606
1674
  */
1607
1675
  export declare function srgbToOKLab(r: number, g: number, b: number): [number, number, number];
1608
1676
 
1677
+ export declare function stepEnd(): (t: number) => number;
1678
+
1679
+ export declare function steppedEase(steps: number, jumpTerm?: (typeof jumpTerms)[number]): (t: number) => number;
1680
+
1681
+ export declare function stepStart(): (t: number) => number;
1682
+
1609
1683
  export declare const STRING_UNITS: readonly ["string"];
1610
1684
 
1611
1685
  export declare const STYLE_NAMES: readonly ["accentColor", "additiveSymbols", "alignContent", "alignItems", "alignSelf", "alignmentBaseline", "all", "anchorName", "animation", "animationComposition", "animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationRange", "animationRangeEnd", "animationRangeStart", "animationTimeline", "animationTimingFunction", "appRegion", "appearance", "ascentOverride", "aspectRatio", "backdropFilter", "backfaceVisibility", "background", "backgroundAttachment", "backgroundBlendMode", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPosition", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize", "basePalette", "baselineShift", "baselineSource", "blockSize", "border", "borderBlock", "borderBlockColor", "borderBlockEnd", "borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth", "borderBlockStart", "borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth", "borderBlockStyle", "borderBlockWidth", "borderBottom", "borderBottomColor", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStyle", "borderBottomWidth", "borderCollapse", "borderColor", "borderEndEndRadius", "borderEndStartRadius", "borderImage", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderInline", "borderInlineColor", "borderInlineEnd", "borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth", "borderInlineStart", "borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth", "borderInlineStyle", "borderInlineWidth", "borderLeft", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRadius", "borderRight", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderSpacing", "borderStartEndRadius", "borderStartStartRadius", "borderStyle", "borderTop", "borderTopColor", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStyle", "borderTopWidth", "borderWidth", "bottom", "boxShadow", "boxSizing", "breakAfter", "breakBefore", "breakInside", "bufferedRendering", "captionSide", "caretColor", "clear", "clip", "clipPath", "clipRule", "color", "colorInterpolation", "colorInterpolationFilters", "colorRendering", "colorScheme", "columnCount", "columnFill", "columnGap", "columnRule", "columnRuleColor", "columnRuleStyle", "columnRuleWidth", "columnSpan", "columnWidth", "columns", "contain", "containIntrinsicBlockSize", "containIntrinsicHeight", "containIntrinsicInlineSize", "containIntrinsicSize", "containIntrinsicWidth", "container", "containerName", "containerType", "content", "contentVisibility", "counterIncrement", "counterReset", "counterSet", "cursor", "cx", "cy", "d", "descentOverride", "direction", "display", "dominantBaseline", "emptyCells", "fallback", "fieldSizing", "fill", "fillOpacity", "fillRule", "filter", "flex", "flexBasis", "flexDirection", "flexFlow", "flexGrow", "flexShrink", "flexWrap", "float", "floodColor", "floodOpacity", "font", "fontDisplay", "fontFamily", "fontFeatureSettings", "fontKerning", "fontOpticalSizing", "fontPalette", "fontSize", "fontStretch", "fontStyle", "fontSynthesis", "fontSynthesisSmallCaps", "fontSynthesisStyle", "fontSynthesisWeight", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontVariationSettings", "fontWeight", "forcedColorAdjust", "gap", "grid", "gridArea", "gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridColumn", "gridColumnEnd", "gridColumnGap", "gridColumnStart", "gridGap", "gridRow", "gridRowEnd", "gridRowGap", "gridRowStart", "gridTemplate", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows", "height", "hyphenateCharacter", "hyphenateLimitChars", "hyphens", "imageOrientation", "imageRendering", "inherits", "initialLetter", "initialValue", "inlineSize", "inset", "insetArea", "insetBlock", "insetBlockEnd", "insetBlockStart", "insetInline", "insetInlineEnd", "insetInlineStart", "isolation", "justifyContent", "justifyItems", "justifySelf", "left", "letterSpacing", "lightingColor", "lineBreak", "lineGapOverride", "lineHeight", "listStyle", "listStyleImage", "listStylePosition", "listStyleType", "margin", "marginBlock", "marginBlockEnd", "marginBlockStart", "marginBottom", "marginInline", "marginInlineEnd", "marginInlineStart", "marginLeft", "marginRight", "marginTop", "marker", "markerEnd", "markerMid", "markerStart", "mask", "maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPosition", "maskRepeat", "maskSize", "maskType", "mathDepth", "mathShift", "mathStyle", "maxBlockSize", "maxHeight", "maxInlineSize", "maxWidth", "minBlockSize", "minHeight", "minInlineSize", "minWidth", "mixBlendMode", "navigation", "negative", "objectFit", "objectPosition", "objectViewBox", "offset", "offsetAnchor", "offsetDistance", "offsetPath", "offsetPosition", "offsetRotate", "opacity", "order", "orphans", "outline", "outlineColor", "outlineOffset", "outlineStyle", "outlineWidth", "overflow", "overflowAnchor", "overflowClipMargin", "overflowWrap", "overflowX", "overflowY", "overlay", "overrideColors", "overscrollBehavior", "overscrollBehaviorBlock", "overscrollBehaviorInline", "overscrollBehaviorX", "overscrollBehaviorY", "pad", "padding", "paddingBlock", "paddingBlockEnd", "paddingBlockStart", "paddingBottom", "paddingInline", "paddingInlineEnd", "paddingInlineStart", "paddingLeft", "paddingRight", "paddingTop", "page", "pageBreakAfter", "pageBreakBefore", "pageBreakInside", "pageOrientation", "paintOrder", "perspective", "perspectiveOrigin", "placeContent", "placeItems", "placeSelf", "pointerEvents", "position", "positionAnchor", "positionTry", "positionTryOptions", "positionTryOrder", "positionVisibility", "prefix", "quotes", "r", "range", "resize", "right", "rotate", "rowGap", "rubyPosition", "rx", "ry", "scale", "scrollBehavior", "scrollMargin", "scrollMarginBlock", "scrollMarginBlockEnd", "scrollMarginBlockStart", "scrollMarginBottom", "scrollMarginInline", "scrollMarginInlineEnd", "scrollMarginInlineStart", "scrollMarginLeft", "scrollMarginRight", "scrollMarginTop", "scrollPadding", "scrollPaddingBlock", "scrollPaddingBlockEnd", "scrollPaddingBlockStart", "scrollPaddingBottom", "scrollPaddingInline", "scrollPaddingInlineEnd", "scrollPaddingInlineStart", "scrollPaddingLeft", "scrollPaddingRight", "scrollPaddingTop", "scrollSnapAlign", "scrollSnapStop", "scrollSnapType", "scrollTimeline", "scrollTimelineAxis", "scrollTimelineName", "scrollbarColor", "scrollbarGutter", "scrollbarWidth", "shapeImageThreshold", "shapeMargin", "shapeOutside", "shapeRendering", "size", "sizeAdjust", "speak", "speakAs", "src", "stopColor", "stopOpacity", "stroke", "strokeDasharray", "strokeDashoffset", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeOpacity", "strokeWidth", "suffix", "symbols", "syntax", "system", "tabSize", "tableLayout", "textAlign", "textAlignLast", "textAnchor", "textCombineUpright", "textDecoration", "textDecorationColor", "textDecorationLine", "textDecorationSkipInk", "textDecorationStyle", "textDecorationThickness", "textEmphasis", "textEmphasisColor", "textEmphasisPosition", "textEmphasisStyle", "textIndent", "textOrientation", "textOverflow", "textRendering", "textShadow", "textSizeAdjust", "textSpacingTrim", "textTransform", "textUnderlineOffset", "textUnderlinePosition", "textWrap", "timelineScope", "top", "touchAction", "transform", "transformBox", "transformOrigin", "transformStyle", "transition", "transitionBehavior", "transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction", "translate", "types", "unicodeBidi", "unicodeRange", "userSelect", "vectorEffect", "verticalAlign", "viewTimeline", "viewTimelineAxis", "viewTimelineInset", "viewTimelineName", "viewTransitionClass", "viewTransitionName", "visibility", "webkitAlignContent", "webkitAlignItems", "webkitAlignSelf", "webkitAnimation", "webkitAnimationDelay", "webkitAnimationDirection", "webkitAnimationDuration", "webkitAnimationFillMode", "webkitAnimationIterationCount", "webkitAnimationName", "webkitAnimationPlayState", "webkitAnimationTimingFunction", "webkitAppRegion", "webkitAppearance", "webkitBackfaceVisibility", "webkitBackgroundClip", "webkitBackgroundOrigin", "webkitBackgroundSize", "webkitBorderAfter", "webkitBorderAfterColor", "webkitBorderAfterStyle", "webkitBorderAfterWidth", "webkitBorderBefore", "webkitBorderBeforeColor", "webkitBorderBeforeStyle", "webkitBorderBeforeWidth", "webkitBorderBottomLeftRadius", "webkitBorderBottomRightRadius", "webkitBorderEnd", "webkitBorderEndColor", "webkitBorderEndStyle", "webkitBorderEndWidth", "webkitBorderHorizontalSpacing", "webkitBorderImage", "webkitBorderRadius", "webkitBorderStart", "webkitBorderStartColor", "webkitBorderStartStyle", "webkitBorderStartWidth", "webkitBorderTopLeftRadius", "webkitBorderTopRightRadius", "webkitBorderVerticalSpacing", "webkitBoxAlign", "webkitBoxDecorationBreak", "webkitBoxDirection", "webkitBoxFlex", "webkitBoxOrdinalGroup", "webkitBoxOrient", "webkitBoxPack", "webkitBoxReflect", "webkitBoxShadow", "webkitBoxSizing", "webkitClipPath", "webkitColumnBreakAfter", "webkitColumnBreakBefore", "webkitColumnBreakInside", "webkitColumnCount", "webkitColumnGap", "webkitColumnRule", "webkitColumnRuleColor", "webkitColumnRuleStyle", "webkitColumnRuleWidth", "webkitColumnSpan", "webkitColumnWidth", "webkitColumns", "webkitFilter", "webkitFlex", "webkitFlexBasis", "webkitFlexDirection", "webkitFlexFlow", "webkitFlexGrow", "webkitFlexShrink", "webkitFlexWrap", "webkitFontFeatureSettings", "webkitFontSmoothing", "webkitHyphenateCharacter", "webkitJustifyContent", "webkitLineBreak", "webkitLineClamp", "webkitLocale", "webkitLogicalHeight", "webkitLogicalWidth", "webkitMarginAfter", "webkitMarginBefore", "webkitMarginEnd", "webkitMarginStart", "webkitMask", "webkitMaskBoxImage", "webkitMaskBoxImageOutset", "webkitMaskBoxImageRepeat", "webkitMaskBoxImageSlice", "webkitMaskBoxImageSource", "webkitMaskBoxImageWidth", "webkitMaskClip", "webkitMaskComposite", "webkitMaskImage", "webkitMaskOrigin", "webkitMaskPosition", "webkitMaskPositionX", "webkitMaskPositionY", "webkitMaskRepeat", "webkitMaskSize", "webkitMaxLogicalHeight", "webkitMaxLogicalWidth", "webkitMinLogicalHeight", "webkitMinLogicalWidth", "webkitOpacity", "webkitOrder", "webkitPaddingAfter", "webkitPaddingBefore", "webkitPaddingEnd", "webkitPaddingStart", "webkitPerspective", "webkitPerspectiveOrigin", "webkitPerspectiveOriginX", "webkitPerspectiveOriginY", "webkitPrintColorAdjust", "webkitRtlOrdering", "webkitRubyPosition", "webkitShapeImageThreshold", "webkitShapeMargin", "webkitShapeOutside", "webkitTapHighlightColor", "webkitTextCombine", "webkitTextDecorationsInEffect", "webkitTextEmphasis", "webkitTextEmphasisColor", "webkitTextEmphasisPosition", "webkitTextEmphasisStyle", "webkitTextFillColor", "webkitTextOrientation", "webkitTextSecurity", "webkitTextSizeAdjust", "webkitTextStroke", "webkitTextStrokeColor", "webkitTextStrokeWidth", "webkitTransform", "webkitTransformOrigin", "webkitTransformOriginX", "webkitTransformOriginY", "webkitTransformOriginZ", "webkitTransformStyle", "webkitTransition", "webkitTransitionDelay", "webkitTransitionDuration", "webkitTransitionProperty", "webkitTransitionTimingFunction", "webkitUserDrag", "webkitUserModify", "webkitUserSelect", "webkitWritingMode", "whiteSpace", "whiteSpaceCollapse", "widows", "width", "willChange", "wordBreak", "wordSpacing", "wordWrap", "writingMode", "x", "y", "zIndex", "zoom"];
@@ -1615,6 +1689,64 @@ export declare function succeed<T>(value: T): Parser<T>;
1615
1689
 
1616
1690
  export declare const TIME_UNITS: readonly ["s", "ms"];
1617
1691
 
1692
+ export declare const timingFunctions: {
1693
+ readonly linear: typeof linear;
1694
+ readonly easeInQuad: typeof easeInQuad;
1695
+ readonly "ease-in-quad": typeof easeInQuad;
1696
+ readonly easeOutQuad: typeof easeOutQuad;
1697
+ readonly "ease-out-quad": typeof easeOutQuad;
1698
+ readonly easeInOutQuad: typeof easeInOutQuad;
1699
+ readonly "ease-in-out-quad": typeof easeInOutQuad;
1700
+ readonly easeInCubic: typeof easeInCubic;
1701
+ readonly "ease-in-cubic": typeof easeInCubic;
1702
+ readonly easeOutCubic: typeof easeOutCubic;
1703
+ readonly "ease-out-cubic": typeof easeOutCubic;
1704
+ readonly easeInOutCubic: typeof easeInOutCubic;
1705
+ readonly "ease-in-out-cubic": typeof easeInOutCubic;
1706
+ readonly easeInBounce: typeof easeInBounce;
1707
+ readonly "ease-in-bounce": typeof easeInBounce;
1708
+ readonly bounceInEase: typeof bounceInEase;
1709
+ readonly "bounce-in-ease": typeof bounceInEase;
1710
+ readonly bounceInEaseHalf: typeof bounceInEaseHalf;
1711
+ readonly "bounce-in-ease-half": typeof bounceInEaseHalf;
1712
+ readonly bounceOutEase: typeof bounceOutEase;
1713
+ readonly "bounce-out-ease": typeof bounceOutEase;
1714
+ readonly bounceOutEaseHalf: typeof bounceOutEaseHalf;
1715
+ readonly "bounce-out-ease-half": typeof bounceOutEaseHalf;
1716
+ readonly bounceInOutEase: typeof bounceInOutEase;
1717
+ readonly "bounce-in-out-ease": typeof bounceInOutEase;
1718
+ readonly easeInSine: typeof easeInSine;
1719
+ readonly "ease-in-sine": typeof easeInSine;
1720
+ readonly easeOutSine: typeof easeOutSine;
1721
+ readonly "ease-out-sine": typeof easeOutSine;
1722
+ readonly easeInOutSine: typeof easeInOutSine;
1723
+ readonly "ease-in-out-sine": typeof easeInOutSine;
1724
+ readonly easeInCirc: typeof easeInCirc;
1725
+ readonly "ease-in-circ": typeof easeInCirc;
1726
+ readonly easeOutCirc: typeof easeOutCirc;
1727
+ readonly "ease-out-circ": typeof easeOutCirc;
1728
+ readonly easeInOutCirc: typeof easeInOutCirc;
1729
+ readonly "ease-in-out-circ": typeof easeInOutCirc;
1730
+ readonly easeInExpo: typeof easeInExpo;
1731
+ readonly "ease-in-expo": typeof easeInExpo;
1732
+ readonly easeOutExpo: typeof easeOutExpo;
1733
+ readonly "ease-out-expo": typeof easeOutExpo;
1734
+ readonly easeInOutExpo: typeof easeInOutExpo;
1735
+ readonly "ease-in-out-expo": typeof easeInOutExpo;
1736
+ readonly smoothStep3: typeof smoothStep3;
1737
+ readonly "smooth-step-3": typeof smoothStep3;
1738
+ readonly ease: (t: number) => number;
1739
+ readonly "ease-in": (t: number) => number;
1740
+ readonly "ease-out": (t: number) => number;
1741
+ readonly "ease-in-out": (t: number) => number;
1742
+ readonly "ease-in-back": (t: number) => number;
1743
+ readonly "ease-out-back": (t: number) => number;
1744
+ readonly "ease-in-out-back": (t: number) => number;
1745
+ readonly steps: typeof steppedEase;
1746
+ readonly "step-start": typeof stepStart;
1747
+ readonly "step-end": typeof stepEnd;
1748
+ };
1749
+
1618
1750
  /** Multiply a Mat3 (row-major) by a Vec3: result = M * v */
1619
1751
  export declare function transformMat3(v: Vec3, m: Mat3): Vec3;
1620
1752