chartist 1.5.0 → 2.0.0-rc.2

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 (138) hide show
  1. package/README.md +45 -101
  2. package/dist/_settings.scss +1 -89
  3. package/dist/chartist.min.css +2 -0
  4. package/dist/chartist.min.js +2 -0
  5. package/dist/compat.cjs +624 -0
  6. package/dist/compat.cjs.map +1 -0
  7. package/dist/compat.d.cts +202 -0
  8. package/dist/compat.d.ts +201 -0
  9. package/dist/compat.js +603 -0
  10. package/dist/compat.js.map +1 -0
  11. package/dist/compat.min.js +2 -0
  12. package/dist/compat.min.js.map +1 -0
  13. package/dist/compat.umd.js +2 -0
  14. package/dist/compat.umd.js.map +1 -0
  15. package/dist/index.cjs +5970 -3489
  16. package/dist/index.cjs.map +1 -1
  17. package/dist/index.css +903 -2
  18. package/dist/index.css.map +1 -1
  19. package/dist/index.d.cts +5167 -0
  20. package/dist/index.d.ts +5166 -8
  21. package/dist/index.js +5935 -3484
  22. package/dist/index.js.map +1 -1
  23. package/dist/index.min.css +2 -0
  24. package/dist/index.min.css.map +1 -0
  25. package/dist/index.min.js +2 -0
  26. package/dist/index.min.js.map +1 -0
  27. package/dist/index.scss +1 -204
  28. package/dist/index.umd.js +2 -2
  29. package/dist/index.umd.js.map +1 -1
  30. package/dist/scss/_settings.scss +155 -0
  31. package/dist/scss/index.scss +262 -0
  32. package/dist/scss/themes/accessible.scss +53 -0
  33. package/dist/themes/accessible.css +34 -0
  34. package/dist/themes/accessible.min.css +1 -0
  35. package/package.json +238 -12
  36. package/dist/axes/AutoScaleAxis.d.ts +0 -12
  37. package/dist/axes/AutoScaleAxis.d.ts.map +0 -1
  38. package/dist/axes/Axis.d.ts +0 -40
  39. package/dist/axes/Axis.d.ts.map +0 -1
  40. package/dist/axes/FixedScaleAxis.d.ts +0 -11
  41. package/dist/axes/FixedScaleAxis.d.ts.map +0 -1
  42. package/dist/axes/StepAxis.d.ts +0 -9
  43. package/dist/axes/StepAxis.d.ts.map +0 -1
  44. package/dist/axes/index.d.ts +0 -6
  45. package/dist/axes/index.d.ts.map +0 -1
  46. package/dist/axes/types.d.ts +0 -5
  47. package/dist/axes/types.d.ts.map +0 -1
  48. package/dist/charts/BarChart/BarChart.d.ts +0 -50
  49. package/dist/charts/BarChart/BarChart.d.ts.map +0 -1
  50. package/dist/charts/BarChart/BarChart.types.d.ts +0 -66
  51. package/dist/charts/BarChart/BarChart.types.d.ts.map +0 -1
  52. package/dist/charts/BarChart/index.d.ts +0 -3
  53. package/dist/charts/BarChart/index.d.ts.map +0 -1
  54. package/dist/charts/BaseChart.d.ts +0 -47
  55. package/dist/charts/BaseChart.d.ts.map +0 -1
  56. package/dist/charts/LineChart/LineChart.d.ts +0 -97
  57. package/dist/charts/LineChart/LineChart.d.ts.map +0 -1
  58. package/dist/charts/LineChart/LineChart.types.d.ts +0 -83
  59. package/dist/charts/LineChart/LineChart.types.d.ts.map +0 -1
  60. package/dist/charts/LineChart/index.d.ts +0 -3
  61. package/dist/charts/LineChart/index.d.ts.map +0 -1
  62. package/dist/charts/PieChart/PieChart.d.ts +0 -101
  63. package/dist/charts/PieChart/PieChart.d.ts.map +0 -1
  64. package/dist/charts/PieChart/PieChart.types.d.ts +0 -95
  65. package/dist/charts/PieChart/PieChart.types.d.ts.map +0 -1
  66. package/dist/charts/PieChart/index.d.ts +0 -3
  67. package/dist/charts/PieChart/index.d.ts.map +0 -1
  68. package/dist/charts/index.d.ts +0 -6
  69. package/dist/charts/index.d.ts.map +0 -1
  70. package/dist/charts/types.d.ts +0 -11
  71. package/dist/charts/types.d.ts.map +0 -1
  72. package/dist/core/constants.d.ts +0 -13
  73. package/dist/core/constants.d.ts.map +0 -1
  74. package/dist/core/creation.d.ts +0 -61
  75. package/dist/core/creation.d.ts.map +0 -1
  76. package/dist/core/data/bounds.d.ts +0 -14
  77. package/dist/core/data/bounds.d.ts.map +0 -1
  78. package/dist/core/data/data.d.ts +0 -23
  79. package/dist/core/data/data.d.ts.map +0 -1
  80. package/dist/core/data/highLow.d.ts +0 -13
  81. package/dist/core/data/highLow.d.ts.map +0 -1
  82. package/dist/core/data/index.d.ts +0 -7
  83. package/dist/core/data/index.d.ts.map +0 -1
  84. package/dist/core/data/normalize.d.ts +0 -11
  85. package/dist/core/data/normalize.d.ts.map +0 -1
  86. package/dist/core/data/segments.d.ts +0 -29
  87. package/dist/core/data/segments.d.ts.map +0 -1
  88. package/dist/core/data/serialize.d.ts +0 -12
  89. package/dist/core/data/serialize.d.ts.map +0 -1
  90. package/dist/core/index.d.ts +0 -8
  91. package/dist/core/index.d.ts.map +0 -1
  92. package/dist/core/lang.d.ts +0 -23
  93. package/dist/core/lang.d.ts.map +0 -1
  94. package/dist/core/math.d.ts +0 -42
  95. package/dist/core/math.d.ts.map +0 -1
  96. package/dist/core/optionsProvider.d.ts +0 -15
  97. package/dist/core/optionsProvider.d.ts.map +0 -1
  98. package/dist/core/types.d.ts +0 -274
  99. package/dist/core/types.d.ts.map +0 -1
  100. package/dist/event/EventEmitter.d.ts +0 -27
  101. package/dist/event/EventEmitter.d.ts.map +0 -1
  102. package/dist/event/index.d.ts +0 -2
  103. package/dist/event/index.d.ts.map +0 -1
  104. package/dist/index.d.ts.map +0 -1
  105. package/dist/interpolation/cardinal.d.ts +0 -30
  106. package/dist/interpolation/cardinal.d.ts.map +0 -1
  107. package/dist/interpolation/index.d.ts +0 -6
  108. package/dist/interpolation/index.d.ts.map +0 -1
  109. package/dist/interpolation/monotoneCubic.d.ts +0 -30
  110. package/dist/interpolation/monotoneCubic.d.ts.map +0 -1
  111. package/dist/interpolation/none.d.ts +0 -22
  112. package/dist/interpolation/none.d.ts.map +0 -1
  113. package/dist/interpolation/simple.d.ts +0 -30
  114. package/dist/interpolation/simple.d.ts.map +0 -1
  115. package/dist/interpolation/step.d.ts +0 -26
  116. package/dist/interpolation/step.d.ts.map +0 -1
  117. package/dist/svg/Svg.d.ts +0 -201
  118. package/dist/svg/Svg.d.ts.map +0 -1
  119. package/dist/svg/SvgList.d.ts +0 -31
  120. package/dist/svg/SvgList.d.ts.map +0 -1
  121. package/dist/svg/SvgPath.d.ts +0 -125
  122. package/dist/svg/SvgPath.d.ts.map +0 -1
  123. package/dist/svg/animation.d.ts +0 -37
  124. package/dist/svg/animation.d.ts.map +0 -1
  125. package/dist/svg/index.d.ts +0 -6
  126. package/dist/svg/index.d.ts.map +0 -1
  127. package/dist/svg/types.d.ts +0 -55
  128. package/dist/svg/types.d.ts.map +0 -1
  129. package/dist/utils/extend.d.ts +0 -10
  130. package/dist/utils/extend.d.ts.map +0 -1
  131. package/dist/utils/functional.d.ts +0 -31
  132. package/dist/utils/functional.d.ts.map +0 -1
  133. package/dist/utils/index.d.ts +0 -5
  134. package/dist/utils/index.d.ts.map +0 -1
  135. package/dist/utils/types.d.ts +0 -7
  136. package/dist/utils/types.d.ts.map +0 -1
  137. package/dist/utils/utils.d.ts +0 -31
  138. package/dist/utils/utils.d.ts.map +0 -1
@@ -1,26 +0,0 @@
1
- import type { SegmentData } from '../core';
2
- import { SvgPath } from '../svg';
3
- export interface StepInterpolationOptions {
4
- postpone?: boolean;
5
- fillHoles?: boolean;
6
- }
7
- /**
8
- * Step interpolation will cause the line chart to move in steps rather than diagonal or smoothed lines. This interpolation will create additional points that will also be drawn when the `showPoint` option is enabled.
9
- *
10
- * All smoothing functions within Chartist are factory functions that accept an options parameter. The step interpolation function accepts one configuration parameter `postpone`, that can be `true` or `false`. The default value is `true` and will cause the step to occur where the value actually changes. If a different behaviour is needed where the step is shifted to the left and happens before the actual value, this option can be set to `false`.
11
- *
12
- * @example
13
- * ```ts
14
- * const chart = new Chartist.Line('.ct-chart', {
15
- * labels: [1, 2, 3, 4, 5],
16
- * series: [[1, 2, 8, 1, 7]]
17
- * }, {
18
- * lineSmooth: Interpolation.step({
19
- * postpone: true,
20
- * fillHoles: false
21
- * })
22
- * });
23
- * ```
24
- */
25
- export declare function step(options?: StepInterpolationOptions): (pathCoordinates: number[], valueData: SegmentData[]) => SvgPath;
26
- //# sourceMappingURL=step.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../../src/interpolation/step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAEjC,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,OAAO,CAAC,EAAE,wBAAwB,qBAQlC,MAAM,EAAE,aACd,WAAW,EAAE,aAwC3B"}
package/dist/svg/Svg.d.ts DELETED
@@ -1,201 +0,0 @@
1
- import type { EventEmitter } from '../event';
2
- import type { Attributes, AnimationDefinition } from './types';
3
- import { SvgList } from './SvgList';
4
- /**
5
- * Svg creates a new SVG object wrapper with a starting element. You can use the wrapper to fluently create sub-elements and modify them.
6
- */
7
- export declare class Svg {
8
- /**
9
- * @todo Only there for chartist <1 compatibility. Remove after deprecation warining.
10
- * @deprecated Use the animation module export `easings` directly.
11
- */
12
- static readonly Easing: {
13
- easeInSine: number[];
14
- easeOutSine: number[];
15
- easeInOutSine: number[];
16
- easeInQuad: number[];
17
- easeOutQuad: number[];
18
- easeInOutQuad: number[];
19
- easeInCubic: number[];
20
- easeOutCubic: number[];
21
- easeInOutCubic: number[];
22
- easeInQuart: number[];
23
- easeOutQuart: number[];
24
- easeInOutQuart: number[];
25
- easeInQuint: number[];
26
- easeOutQuint: number[];
27
- easeInOutQuint: number[];
28
- easeInExpo: number[];
29
- easeOutExpo: number[];
30
- easeInOutExpo: number[];
31
- easeInCirc: number[];
32
- easeOutCirc: number[];
33
- easeInOutCirc: number[];
34
- easeInBack: number[];
35
- easeOutBack: number[];
36
- easeInOutBack: number[];
37
- };
38
- private _node;
39
- /**
40
- * @param name The name of the SVG element to create or an SVG dom element which should be wrapped into Svg
41
- * @param attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.
42
- * @param className This class or class list will be added to the SVG element
43
- * @param parent The parent SVG wrapper object where this newly created wrapper and it's element will be attached to as child
44
- * @param insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element
45
- */
46
- constructor(name: string | Element, attributes?: Attributes, className?: string, parent?: Svg, insertFirst?: boolean);
47
- /**
48
- * Set attributes on the current SVG element of the wrapper you're currently working on.
49
- * @param attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added. If this parameter is a String then the function is used as a getter and will return the attribute value.
50
- * @param ns If specified, the attribute will be obtained using getAttributeNs. In order to write namepsaced attributes you can use the namespace:attribute notation within the attributes object.
51
- * @return The current wrapper object will be returned so it can be used for chaining or the attribute value if used as getter function.
52
- */
53
- attr(attributes: string, ns?: string): string | null;
54
- attr(attributes: Attributes): this;
55
- /**
56
- * Create a new SVG element whose wrapper object will be selected for further operations. This way you can also create nested groups easily.
57
- * @param name The name of the SVG element that should be created as child element of the currently selected element wrapper
58
- * @param attributes An object with properties that will be added as attributes to the SVG element that is created. Attributes with undefined values will not be added.
59
- * @param className This class or class list will be added to the SVG element
60
- * @param insertFirst If this param is set to true in conjunction with a parent element the newly created element will be added as first child element in the parent element
61
- * @return Returns a Svg wrapper object that can be used to modify the containing SVG data
62
- */
63
- elem(name: string, attributes?: Attributes, className?: string, insertFirst?: boolean): Svg;
64
- /**
65
- * Returns the parent Chartist.SVG wrapper object
66
- * @return Returns a Svg wrapper around the parent node of the current node. If the parent node is not existing or it's not an SVG node then this function will return null.
67
- */
68
- parent(): Svg | null;
69
- /**
70
- * This method returns a Svg wrapper around the root SVG element of the current tree.
71
- * @return The root SVG element wrapped in a Svg element
72
- */
73
- root(): Svg;
74
- /**
75
- * Find the first child SVG element of the current element that matches a CSS selector. The returned object is a Svg wrapper.
76
- * @param selector A CSS selector that is used to query for child SVG elements
77
- * @return The SVG wrapper for the element found or null if no element was found
78
- */
79
- querySelector(selector: string): Svg | null;
80
- /**
81
- * Find the all child SVG elements of the current element that match a CSS selector. The returned object is a Svg.List wrapper.
82
- * @param selector A CSS selector that is used to query for child SVG elements
83
- * @return The SVG wrapper list for the element found or null if no element was found
84
- */
85
- querySelectorAll(selector: string): SvgList;
86
- /**
87
- * Returns the underlying SVG node for the current element.
88
- */
89
- getNode<T extends Element = Element>(): T;
90
- /**
91
- * This method creates a foreignObject (see https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject) that allows to embed HTML content into a SVG graphic. With the help of foreignObjects you can enable the usage of regular HTML elements inside of SVG where they are subject for SVG positioning and transformation but the Browser will use the HTML rendering capabilities for the containing DOM.
92
- * @param content The DOM Node, or HTML string that will be converted to a DOM Node, that is then placed into and wrapped by the foreignObject
93
- * @param attributes An object with properties that will be added as attributes to the foreignObject element that is created. Attributes with undefined values will not be added.
94
- * @param className This class or class list will be added to the SVG element
95
- * @param insertFirst Specifies if the foreignObject should be inserted as first child
96
- * @return New wrapper object that wraps the foreignObject element
97
- */
98
- foreignObject(content: string | Node, attributes?: Attributes, className?: string, insertFirst?: boolean): Svg;
99
- /**
100
- * This method adds a new text element to the current Svg wrapper.
101
- * @param t The text that should be added to the text element that is created
102
- * @return The same wrapper object that was used to add the newly created element
103
- */
104
- text(t: string): this;
105
- /**
106
- * This method will clear all child nodes of the current wrapper object.
107
- * @return The same wrapper object that got emptied
108
- */
109
- empty(): this;
110
- /**
111
- * This method will cause the current wrapper to remove itself from its parent wrapper. Use this method if you'd like to get rid of an element in a given DOM structure.
112
- * @return The parent wrapper object of the element that got removed
113
- */
114
- remove(): Svg | null;
115
- /**
116
- * This method will replace the element with a new element that can be created outside of the current DOM.
117
- * @param newElement The new Svg object that will be used to replace the current wrapper object
118
- * @return The wrapper of the new element
119
- */
120
- replace(newElement: Svg): Svg;
121
- /**
122
- * This method will append an element to the current element as a child.
123
- * @param element The Svg element that should be added as a child
124
- * @param insertFirst Specifies if the element should be inserted as first child
125
- * @return The wrapper of the appended object
126
- */
127
- append(element: Svg, insertFirst?: boolean): this;
128
- /**
129
- * Returns an array of class names that are attached to the current wrapper element. This method can not be chained further.
130
- * @return A list of classes or an empty array if there are no classes on the current element
131
- */
132
- classes(): string[];
133
- /**
134
- * Adds one or a space separated list of classes to the current element and ensures the classes are only existing once.
135
- * @param names A white space separated list of class names
136
- * @return The wrapper of the current element
137
- */
138
- addClass(names: string): this;
139
- /**
140
- * Removes one or a space separated list of classes from the current element.
141
- * @param names A white space separated list of class names
142
- * @return The wrapper of the current element
143
- */
144
- removeClass(names: string): this;
145
- /**
146
- * Removes all classes from the current element.
147
- * @return The wrapper of the current element
148
- */
149
- removeAllClasses(): this;
150
- /**
151
- * Get element height using `clientHeight`
152
- * @return The elements height in pixels
153
- */
154
- height(): number;
155
- /**
156
- * Get element width using `clientWidth`
157
- * @return The elements width in pixels
158
- */
159
- width(): number;
160
- /**
161
- * The animate function lets you animate the current element with SMIL animations. You can add animations for multiple attributes at the same time by using an animation definition object. This object should contain SMIL animation attributes. Please refer to http://www.w3.org/TR/SVG/animate.html for a detailed specification about the available animation attributes. Additionally an easing property can be passed in the animation definition object. This can be a string with a name of an easing function in `Svg.Easing` or an array with four numbers specifying a cubic Bézier curve.
162
- * **An animations object could look like this:**
163
- * ```javascript
164
- * element.animate({
165
- * opacity: {
166
- * dur: 1000,
167
- * from: 0,
168
- * to: 1
169
- * },
170
- * x1: {
171
- * dur: '1000ms',
172
- * from: 100,
173
- * to: 200,
174
- * easing: 'easeOutQuart'
175
- * },
176
- * y1: {
177
- * dur: '2s',
178
- * from: 0,
179
- * to: 100
180
- * }
181
- * });
182
- * ```
183
- * **Automatic unit conversion**
184
- * For the `dur` and the `begin` animate attribute you can also omit a unit by passing a number. The number will automatically be converted to milli seconds.
185
- * **Guided mode**
186
- * The default behavior of SMIL animations with offset using the `begin` attribute is that the attribute will keep it's original value until the animation starts. Mostly this behavior is not desired as you'd like to have your element attributes already initialized with the animation `from` value even before the animation starts. Also if you don't specify `fill="freeze"` on an animate element or if you delete the animation after it's done (which is done in guided mode) the attribute will switch back to the initial value. This behavior is also not desired when performing simple one-time animations. For one-time animations you'd want to trigger animations immediately instead of relative to the document begin time. That's why in guided mode Svg will also use the `begin` property to schedule a timeout and manually start the animation after the timeout. If you're using multiple SMIL definition objects for an attribute (in an array), guided mode will be disabled for this attribute, even if you explicitly enabled it.
187
- * If guided mode is enabled the following behavior is added:
188
- * - Before the animation starts (even when delayed with `begin`) the animated attribute will be set already to the `from` value of the animation
189
- * - `begin` is explicitly set to `indefinite` so it can be started manually without relying on document begin time (creation)
190
- * - The animate element will be forced to use `fill="freeze"`
191
- * - The animation will be triggered with `beginElement()` in a timeout where `begin` of the definition object is interpreted in milli seconds. If no `begin` was specified the timeout is triggered immediately.
192
- * - After the animation the element attribute value will be set to the `to` value of the animation
193
- * - The animate element is deleted from the DOM
194
- * @param animations An animations object where the property keys are the attributes you'd like to animate. The properties should be objects again that contain the SMIL animation attributes (usually begin, dur, from, and to). The property begin and dur is auto converted (see Automatic unit conversion). You can also schedule multiple animations for the same attribute by passing an Array of SMIL definition objects. Attributes that contain an array of SMIL definition objects will not be executed in guided mode.
195
- * @param guided Specify if guided mode should be activated for this animation (see Guided mode). If not otherwise specified, guided mode will be activated.
196
- * @param eventEmitter If specified, this event emitter will be notified when an animation starts or ends.
197
- * @return The current element where the animation was added
198
- */
199
- animate(animations: Record<string, AnimationDefinition | AnimationDefinition[]>, guided?: boolean, eventEmitter?: EventEmitter): this;
200
- }
201
- //# sourceMappingURL=Svg.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Svg.d.ts","sourceRoot":"","sources":["../../src/svg/Svg.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;GAEG;AACH,qBAAa,GAAG;IACd;;;OAGG;IACH,MAAM,CAAC,QAAQ,CAAC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;MAAW;IAEjC,OAAO,CAAC,KAAK,CAAU;IAEvB;;;;;;OAMG;gBAED,IAAI,EAAE,MAAM,GAAG,OAAO,EACtB,UAAU,CAAC,EAAE,UAAU,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,GAAG,EACZ,WAAW,UAAQ;IAiCrB;;;;;OAKG;IACH,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IACpD,IAAI,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI;IA+BlC;;;;;;;OAOG;IACH,IAAI,CACF,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,UAAU,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,UAAQ;IAKrB;;;OAGG;IACH,MAAM;IAMN;;;OAGG;IACH,IAAI;IAcJ;;;;OAIG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM;IAK9B;;;;OAIG;IACH,gBAAgB,CAAC,QAAQ,EAAE,MAAM;IAKjC;;OAEG;IACH,OAAO,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO;IAInC;;;;;;;OAOG;IACH,aAAa,CACX,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,UAAU,CAAC,EAAE,UAAU,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,WAAW,UAAQ;IAiCrB;;;;OAIG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM;IAKd;;;OAGG;IACH,KAAK;IAQL;;;OAGG;IACH,MAAM;IAKN;;;;OAIG;IACH,OAAO,CAAC,UAAU,EAAE,GAAG;IAKvB;;;;;OAKG;IACH,MAAM,CAAC,OAAO,EAAE,GAAG,EAAE,WAAW,UAAQ;IAUxC;;;OAGG;IACH,OAAO;IAMP;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM;IActB;;;;OAIG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM;IAazB;;;OAGG;IACH,gBAAgB;IAKhB;;;OAGG;IACH,MAAM;IAIN;;;OAGG;IACH,KAAK;IAIL;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;IACH,OAAO,CACL,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,GAAG,mBAAmB,EAAE,CAAC,EACvE,MAAM,UAAO,EACb,YAAY,CAAC,EAAE,YAAY;CA6B9B"}
@@ -1,31 +0,0 @@
1
- import { Svg } from './Svg';
2
- declare type SvgMethods = Exclude<keyof Svg, 'constructor' | 'parent' | 'querySelector' | 'querySelectorAll' | 'replace' | 'append' | 'classes' | 'height' | 'width'>;
3
- declare type SvgListMethods = {
4
- [method in SvgMethods]: (...args: Parameters<Svg[method]>) => SvgList;
5
- };
6
- /**
7
- * This helper class is to wrap multiple `Svg` elements into a list where you can call the `Svg` functions on all elements in the list with one call. This is helpful when you'd like to perform calls with `Svg` on multiple elements.
8
- * An instance of this class is also returned by `Svg.querySelectorAll`.
9
- */
10
- export declare class SvgList implements SvgListMethods {
11
- private svgElements;
12
- /**
13
- * @param nodeList An Array of SVG DOM nodes or a SVG DOM NodeList (as returned by document.querySelectorAll)
14
- */
15
- constructor(nodeList: ArrayLike<Element>);
16
- private call;
17
- attr(...args: Parameters<Svg['attr']>): this;
18
- elem(...args: Parameters<Svg['elem']>): this;
19
- root(...args: Parameters<Svg['root']>): this;
20
- getNode(...args: Parameters<Svg['getNode']>): this;
21
- foreignObject(...args: Parameters<Svg['foreignObject']>): this;
22
- text(...args: Parameters<Svg['text']>): this;
23
- empty(...args: Parameters<Svg['empty']>): this;
24
- remove(...args: Parameters<Svg['remove']>): this;
25
- addClass(...args: Parameters<Svg['addClass']>): this;
26
- removeClass(...args: Parameters<Svg['removeClass']>): this;
27
- removeAllClasses(...args: Parameters<Svg['removeAllClasses']>): this;
28
- animate(...args: Parameters<Svg['animate']>): this;
29
- }
30
- export {};
31
- //# sourceMappingURL=SvgList.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SvgList.d.ts","sourceRoot":"","sources":["../../src/svg/SvgList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAE5B,aAAK,UAAU,GAAG,OAAO,CACvB,MAAM,GAAG,EACP,aAAa,GACb,QAAQ,GACR,eAAe,GACf,kBAAkB,GAClB,SAAS,GACT,QAAQ,GACR,SAAS,GACT,QAAQ,GACR,OAAO,CACV,CAAC;AAEF,aAAK,cAAc,GAAG;KACnB,MAAM,IAAI,UAAU,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,OAAO;CACtE,CAAC;AAEF;;;GAGG;AACH,qBAAa,OAAQ,YAAW,cAAc;IAC5C,OAAO,CAAC,WAAW,CAAa;IAEhC;;OAEG;gBACS,QAAQ,EAAE,SAAS,CAAC,OAAO,CAAC;IAMxC,OAAO,CAAC,IAAI;IAOZ,IAAI,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAIrC,IAAI,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAIrC,IAAI,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAIrC,OAAO,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAI3C,aAAa,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAIvD,IAAI,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAIrC,KAAK,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAIvC,MAAM,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAIzC,QAAQ,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAI7C,WAAW,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAInD,gBAAgB,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAI7D,OAAO,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;CAG5C"}
@@ -1,125 +0,0 @@
1
- import type { SegmentData } from '../core';
2
- import type { SvgPathOptions, PathCommand, PathParams } from './types';
3
- export declare class SvgPath {
4
- private readonly close;
5
- /**
6
- * This static function on `SvgPath` is joining multiple paths together into one paths.
7
- * @param paths A list of paths to be joined together. The order is important.
8
- * @param close If the newly created path should be a closed path
9
- * @param options Path options for the newly created path.
10
- */
11
- static join(paths: SvgPath[], close?: boolean, options?: SvgPathOptions): SvgPath;
12
- pathElements: PathCommand[];
13
- private pos;
14
- private options;
15
- /**
16
- * Used to construct a new path object.
17
- * @param close If set to true then this path will be closed when stringified (with a Z at the end)
18
- * @param options Options object that overrides the default objects. See default options for more details.
19
- */
20
- constructor(close?: boolean, options?: SvgPathOptions);
21
- /**
22
- * Gets or sets the current position (cursor) inside of the path. You can move around the cursor freely but limited to 0 or the count of existing elements. All modifications with element functions will insert new elements at the position of this cursor.
23
- * @param pos If a number is passed then the cursor is set to this position in the path element array.
24
- * @return If the position parameter was passed then the return value will be the path object for easy call chaining. If no position parameter was passed then the current position is returned.
25
- */
26
- position(pos: number): this;
27
- position(): number;
28
- /**
29
- * Removes elements from the path starting at the current position.
30
- * @param count Number of path elements that should be removed from the current position.
31
- * @return The current path object for easy call chaining.
32
- */
33
- remove(count: number): this;
34
- /**
35
- * Use this function to add a new move SVG path element.
36
- * @param x The x coordinate for the move element.
37
- * @param y The y coordinate for the move element.
38
- * @param relative If set to true the move element will be created with relative coordinates (lowercase letter)
39
- * @param data Any data that should be stored with the element object that will be accessible in pathElement
40
- * @return The current path object for easy call chaining.
41
- */
42
- move(x: number, y: number, relative?: boolean, data?: SegmentData): this;
43
- /**
44
- * Use this function to add a new line SVG path element.
45
- * @param x The x coordinate for the line element.
46
- * @param y The y coordinate for the line element.
47
- * @param relative If set to true the line element will be created with relative coordinates (lowercase letter)
48
- * @param data Any data that should be stored with the element object that will be accessible in pathElement
49
- * @return The current path object for easy call chaining.
50
- */
51
- line(x: number, y: number, relative?: boolean, data?: SegmentData): this;
52
- /**
53
- * Use this function to add a new curve SVG path element.
54
- * @param x1 The x coordinate for the first control point of the bezier curve.
55
- * @param y1 The y coordinate for the first control point of the bezier curve.
56
- * @param x2 The x coordinate for the second control point of the bezier curve.
57
- * @param y2 The y coordinate for the second control point of the bezier curve.
58
- * @param x The x coordinate for the target point of the curve element.
59
- * @param y The y coordinate for the target point of the curve element.
60
- * @param relative If set to true the curve element will be created with relative coordinates (lowercase letter)
61
- * @param data Any data that should be stored with the element object that will be accessible in pathElement
62
- * @return The current path object for easy call chaining.
63
- */
64
- curve(x1: number, y1: number, x2: number, y2: number, x: number, y: number, relative?: boolean, data?: SegmentData): this;
65
- /**
66
- * Use this function to add a new non-bezier curve SVG path element.
67
- * @param rx The radius to be used for the x-axis of the arc.
68
- * @param ry The radius to be used for the y-axis of the arc.
69
- * @param xAr Defines the orientation of the arc
70
- * @param lAf Large arc flag
71
- * @param sf Sweep flag
72
- * @param x The x coordinate for the target point of the curve element.
73
- * @param y The y coordinate for the target point of the curve element.
74
- * @param relative If set to true the curve element will be created with relative coordinates (lowercase letter)
75
- * @param data Any data that should be stored with the element object that will be accessible in pathElement
76
- * @return The current path object for easy call chaining.
77
- */
78
- arc(rx: number, ry: number, xAr: number, lAf: number, sf: number, x: number, y: number, relative?: boolean, data?: SegmentData): this;
79
- /**
80
- * Parses an SVG path seen in the d attribute of path elements, and inserts the parsed elements into the existing path object at the current cursor position. Any closing path indicators (Z at the end of the path) will be ignored by the parser as this is provided by the close option in the options of the path object.
81
- * @param path Any SVG path that contains move (m), line (l) or curve (c) components.
82
- * @return The current path object for easy call chaining.
83
- */
84
- parse(path: string): this;
85
- /**
86
- * This function renders to current SVG path object into a final SVG string that can be used in the d attribute of SVG path elements. It uses the accuracy option to round big decimals. If the close parameter was set in the constructor of this path object then a path closing Z will be appended to the output string.
87
- */
88
- stringify(): string;
89
- /**
90
- * Scales all elements in the current SVG path object. There is an individual parameter for each coordinate. Scaling will also be done for control points of curves, affecting the given coordinate.
91
- * @param x The number which will be used to scale the x, x1 and x2 of all path elements.
92
- * @param y The number which will be used to scale the y, y1 and y2 of all path elements.
93
- * @return The current path object for easy call chaining.
94
- */
95
- scale(x: number, y: number): this;
96
- /**
97
- * Translates all elements in the current SVG path object. The translation is relative and there is an individual parameter for each coordinate. Translation will also be done for control points of curves, affecting the given coordinate.
98
- * @param x The number which will be used to translate the x, x1 and x2 of all path elements.
99
- * @param y The number which will be used to translate the y, y1 and y2 of all path elements.
100
- * @return The current path object for easy call chaining.
101
- */
102
- translate(x: number, y: number): this;
103
- /**
104
- * This function will run over all existing path elements and then loop over their attributes. The callback function will be called for every path element attribute that exists in the current path.
105
- * The method signature of the callback function looks like this:
106
- * ```javascript
107
- * function(pathElement, paramName, pathElementIndex, paramIndex, pathElements)
108
- * ```
109
- * If something else than undefined is returned by the callback function, this value will be used to replace the old value. This allows you to build custom transformations of path objects that can't be achieved using the basic transformation functions scale and translate.
110
- * @param transformFnc The callback function for the transformation. Check the signature in the function description.
111
- * @return The current path object for easy call chaining.
112
- */
113
- transform(transformFnc: <T extends PathParams = PathParams>(cmd: PathCommand<T>, param: keyof T, cmdIndex: number, paramIndex: number, cmds: PathCommand<T>[]) => number | void): this;
114
- /**
115
- * This function clones a whole path object with all its properties. This is a deep clone and path element objects will also be cloned.
116
- * @param close Optional option to set the new cloned path to closed. If not specified or false, the original path close option will be used.
117
- */
118
- clone(close?: boolean): SvgPath;
119
- /**
120
- * Split a Svg.Path object by a specific command in the path chain. The path chain will be split and an array of newly created paths objects will be returned. This is useful if you'd like to split an SVG path by it's move commands, for example, in order to isolate chunks of drawings.
121
- * @param command The command you'd like to use to split the path
122
- */
123
- splitByCommand(command: string): SvgPath[];
124
- }
125
- //# sourceMappingURL=SvgPath.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SvgPath.d.ts","sourceRoot":"","sources":["../../src/svg/SvgPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AA8DvE,qBAAa,OAAO;IA2BN,OAAO,CAAC,QAAQ,CAAC,KAAK;IA1BlC;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,UAAQ,EAAE,OAAO,CAAC,EAAE,cAAc;IAWrE,YAAY,EAAE,WAAW,EAAE,CAAM;IACjC,OAAO,CAAC,GAAG,CAAK;IAChB,OAAO,CAAC,OAAO,CAA2B;IAE1C;;;;OAIG;gBAC0B,KAAK,UAAQ,EAAE,OAAO,CAAC,EAAE,cAAc;IAIpE;;;;OAIG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAC3B,QAAQ,IAAI,MAAM;IAUlB;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM;IAKpB;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,UAAQ,EAAE,IAAI,CAAC,EAAE,WAAW;IAe/D;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,UAAQ,EAAE,IAAI,CAAC,EAAE,WAAW;IAe/D;;;;;;;;;;;OAWG;IACH,KAAK,CACH,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,UAAQ,EAChB,IAAI,CAAC,EAAE,WAAW;IAoBpB;;;;;;;;;;;;OAYG;IACH,GAAG,CACD,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,EACV,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,QAAQ,UAAQ,EAChB,IAAI,CAAC,EAAE,WAAW;IAqBpB;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM;IA8ClB;;OAEG;IACH,SAAS;IAoBT;;;;;OAKG;IACH,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAO1B;;;;;OAKG;IACH,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;IAO9B;;;;;;;;;OASG;IACH,SAAS,CACP,YAAY,EAAE,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EAC9C,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,EACnB,KAAK,EAAE,MAAM,CAAC,EACd,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,KACnB,MAAM,GAAG,IAAI;IAoBpB;;;OAGG;IACH,KAAK,CAAC,KAAK,UAAQ;IAUnB;;;OAGG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM;CAgB/B"}
@@ -1,37 +0,0 @@
1
- import type { EventEmitter } from '../event';
2
- import type { AnimationDefinition } from './types';
3
- import type { Svg } from './Svg';
4
- /**
5
- * This Object contains some standard easing cubic bezier curves.
6
- * Then can be used with their name in the `Svg.animate`.
7
- * You can also extend the list and use your own name in the `animate` function.
8
- * Click the show code button to see the available bezier functions.
9
- */
10
- export declare const easings: {
11
- easeInSine: number[];
12
- easeOutSine: number[];
13
- easeInOutSine: number[];
14
- easeInQuad: number[];
15
- easeOutQuad: number[];
16
- easeInOutQuad: number[];
17
- easeInCubic: number[];
18
- easeOutCubic: number[];
19
- easeInOutCubic: number[];
20
- easeInQuart: number[];
21
- easeOutQuart: number[];
22
- easeInOutQuart: number[];
23
- easeInQuint: number[];
24
- easeOutQuint: number[];
25
- easeInOutQuint: number[];
26
- easeInExpo: number[];
27
- easeOutExpo: number[];
28
- easeInOutExpo: number[];
29
- easeInCirc: number[];
30
- easeOutCirc: number[];
31
- easeInOutCirc: number[];
32
- easeInBack: number[];
33
- easeOutBack: number[];
34
- easeInOutBack: number[];
35
- };
36
- export declare function createAnimation(element: Svg, attribute: string, animationDefinition: AnimationDefinition, createGuided?: boolean, eventEmitter?: EventEmitter): void;
37
- //# sourceMappingURL=animation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"animation.d.ts","sourceRoot":"","sources":["../../src/svg/animation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,OAAO,KAAK,EAAc,mBAAmB,EAAkB,MAAM,SAAS,CAAC;AAC/E,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;CAyBnB,CAAC;AAEF,wBAAgB,eAAe,CAC7B,OAAO,EAAE,GAAG,EACZ,SAAS,EAAE,MAAM,EACjB,mBAAmB,EAAE,mBAAmB,EACxC,YAAY,UAAQ,EACpB,YAAY,CAAC,EAAE,YAAY,QA0F5B"}
@@ -1,6 +0,0 @@
1
- export { easings } from './animation';
2
- export * from './Svg';
3
- export * from './SvgPath';
4
- export * from './SvgList';
5
- export * from './types';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svg/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC"}
@@ -1,55 +0,0 @@
1
- import type { SegmentData } from '../core';
2
- import type { easings } from './animation';
3
- import type { Svg } from './Svg';
4
- export interface BasePathParams {
5
- x: number;
6
- y: number;
7
- }
8
- export declare type MoveParams = BasePathParams;
9
- export declare type LineParams = BasePathParams;
10
- export interface CurveParams extends BasePathParams {
11
- x1: number;
12
- y1: number;
13
- x2: number;
14
- y2: number;
15
- }
16
- export interface ArcParams extends BasePathParams {
17
- rx: number;
18
- ry: number;
19
- xAr: number;
20
- lAf: number;
21
- sf: number;
22
- }
23
- export declare type PathParams = MoveParams | LineParams | CurveParams | ArcParams;
24
- export declare type PathCommand<T extends PathParams = PathParams> = {
25
- command: string;
26
- data?: SegmentData;
27
- } & T;
28
- export interface SvgPathOptions {
29
- accuracy?: number;
30
- }
31
- export declare type Attributes = Record<string, number | string | undefined | null>;
32
- export interface AnimationDefinition {
33
- id?: string;
34
- easing?: number[] | keyof typeof easings;
35
- calcMode?: 'discrete' | 'linear' | 'paced' | 'spline';
36
- restart?: 'always' | 'whenNotActive' | 'never';
37
- repeatCount?: number | 'indefinite';
38
- repeatDur?: string | 'indefinite';
39
- keySplines?: string;
40
- keyTimes?: string;
41
- fill?: string;
42
- min?: number | string;
43
- max?: number | string;
44
- begin?: number | string;
45
- end?: number | string;
46
- dur: number | string;
47
- from: number | string;
48
- to: number | string;
49
- }
50
- export interface AnimationEvent {
51
- element: Svg;
52
- animate: Element;
53
- params: AnimationDefinition;
54
- }
55
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/svg/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,MAAM,WAAW,cAAc;IAC7B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,oBAAY,UAAU,GAAG,cAAc,CAAC;AAExC,oBAAY,UAAU,GAAG,cAAc,CAAC;AAExC,MAAM,WAAW,WAAY,SAAQ,cAAc;IACjD,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,SAAU,SAAQ,cAAc;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,oBAAY,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAE3E,oBAAY,WAAW,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI;IAC3D,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB,GAAG,CAAC,CAAC;AAEN,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,oBAAY,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC;AAE5E,MAAM,WAAW,mBAAmB;IAClC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,OAAO,CAAC;IACzC,QAAQ,CAAC,EAAE,UAAU,GAAG,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACtD,OAAO,CAAC,EAAE,QAAQ,GAAG,eAAe,GAAG,OAAO,CAAC;IAC/C,WAAW,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,GAAG,YAAY,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,mBAAmB,CAAC;CAC7B"}
@@ -1,10 +0,0 @@
1
- /**
2
- * Simple recursive object extend
3
- * @param target Target object where the source will be merged into
4
- * @param sources This object (objects) will be merged into target and then target is returned
5
- * @return An object that has the same reference as target but is extended and merged with the properties of source
6
- */
7
- export declare function extend<T>(target: T): T;
8
- export declare function extend<T, A>(target: T, a: A): T & A;
9
- export declare function extend<T, A, B>(target: T, a: A, b: B): T & A & B;
10
- //# sourceMappingURL=extend.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extend.d.ts","sourceRoot":"","sources":["../../src/utils/extend.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC;AACxC,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AACrD,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC"}
@@ -1,31 +0,0 @@
1
- /**
2
- * Helps to simplify functional style code
3
- * @param n This exact value will be returned by the noop function
4
- * @return The same value that was provided to the n parameter
5
- */
6
- export declare const noop: <T>(n: T) => T;
7
- /**
8
- * Functional style helper to produce array with given length initialized with undefined values
9
- */
10
- export declare function times(length: number): undefined[];
11
- export declare function times<T = unknown>(length: number, filler: (index: number) => T): T[];
12
- /**
13
- * Sum helper to be used in reduce functions
14
- */
15
- export declare const sum: (previous: number, current: number) => number;
16
- /**
17
- * Map for multi dimensional arrays where their nested arrays will be mapped in serial. The output array will have the length of the largest nested array. The callback function is called with variable arguments where each argument is the nested array value (or undefined if there are no more values).
18
- *
19
- * For example:
20
- * @example
21
- * ```ts
22
- * const data = [[1, 2], [3], []];
23
- * serialMap(data, cb);
24
- *
25
- * // where cb will be called 2 times
26
- * // 1. call arguments: (1, 3, undefined)
27
- * // 2. call arguments: (2, undefined, undefined)
28
- * ```
29
- */
30
- export declare const serialMap: <T, K>(array: T[][], callback: (...args: T[]) => K) => K[];
31
- //# sourceMappingURL=functional.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"functional.d.ts","sourceRoot":"","sources":["../../src/utils/functional.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,IAAI,gBAAiB,CAAC;AAEnC;;GAEG;AACH,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,CAAC;AACnD,wBAAgB,KAAK,CAAC,CAAC,GAAG,OAAO,EAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,CAAC,GAC3B,CAAC,EAAE,CAAC;AAQP;;GAEG;AACH,eAAO,MAAM,GAAG,aAAc,MAAM,WAAW,MAAM,WACjB,CAAC;AAErC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,SAAS,4DAGnB,CAAC"}
@@ -1,5 +0,0 @@
1
- export * from './types';
2
- export * from './extend';
3
- export * from './functional';
4
- export * from './utils';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare type FilterByKey<T, K extends string> = T extends Record<K, unknown> ? T : T extends Partial<Record<K, unknown>> ? T & {
2
- [key in K]: T[K];
3
- } : never;
4
- export declare type RequiredKeys<T, K extends keyof T, V extends keyof T = never> = T & Required<Pick<T, K | V>> & {
5
- [key in V]: Required<T[V]>;
6
- };
7
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,IAAI,CAAC,SAAS,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,GACvE,CAAC,GACD,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GACrC,CAAC,GAAG;KAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAE,GACxB,KAAK,CAAC;AAEV,oBAAY,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,GAAG,KAAK,IAAI,CAAC,GAC3E,QAAQ,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG;KAAG,GAAG,IAAI,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC"}
@@ -1,31 +0,0 @@
1
- import type { FilterByKey } from './types';
2
- /**
3
- * This function safely checks if an objects has an owned property.
4
- * @param target The object where to check for a property
5
- * @param property The property name
6
- * @returns Returns true if the object owns the specified property
7
- */
8
- export declare function safeHasProperty<T, K extends string>(target: T, property: K): target is FilterByKey<T, K>;
9
- /**
10
- * Checks if a value can be safely coerced to a number. This includes all values except null which result in finite numbers when coerced. This excludes NaN, since it's not finite.
11
- */
12
- export declare function isNumeric(value: number): true;
13
- export declare function isNumeric(value: unknown): boolean;
14
- /**
15
- * Returns true on all falsey values except the numeric value 0.
16
- */
17
- export declare function isFalseyButZero(value: unknown): value is undefined | null | false | '';
18
- /**
19
- * Returns a number if the passed parameter is a valid number or the function will return undefined. On all other values than a valid number, this function will return undefined.
20
- */
21
- export declare function getNumberOrUndefined(value: number): number;
22
- export declare function getNumberOrUndefined(value: unknown): number | undefined;
23
- /**
24
- * Checks if value is array of arrays or not.
25
- */
26
- export declare function isArrayOfArrays(data: unknown): data is unknown[][];
27
- /**
28
- * Loop over array.
29
- */
30
- export declare function each<T>(list: T[], callback: (item: T, index: number, itemIndex: number) => void, reverse?: boolean): void;
31
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE3C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,EACjD,MAAM,EAAE,CAAC,EACT,QAAQ,EAAE,CAAC,GACV,MAAM,IAAI,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAS/B;;GAEG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;AAC/C,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;AAKnD;;GAEG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,OAAO,GACb,KAAK,IAAI,SAAS,GAAG,IAAI,GAAG,KAAK,GAAG,EAAE,CAExC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;AAC5D,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAKzE;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,IAAI,OAAO,EAAE,EAAE,CAMlE;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,CAAC,EACpB,IAAI,EAAE,CAAC,EAAE,EACT,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,EAC7D,OAAO,UAAQ,QAQhB"}