loon-bulma-react 2026.0.39 → 2026.0.41
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/components/DragDrop/DragDropList.d.ts +6 -4
- package/dist/forms/Select/Select.d.ts +1 -1
- package/dist/hooks/useClipboard.d.ts +3 -3
- package/dist/index.js +1257 -1249
- package/dist/internal_functions/createIconsInternal.d.ts +2 -1
- package/dist/lib/classes/Console.d.ts +29 -0
- package/dist/lib/classes/FetchWrapper.d.ts +124 -0
- package/dist/lib/components/AspectRatio/AspectRatio.d.ts +28 -0
- package/dist/lib/components/Block/Block.d.ts +9 -0
- package/dist/lib/components/Box/BorderBox.d.ts +29 -0
- package/dist/lib/components/Box/Box.d.ts +20 -0
- package/dist/lib/components/Button/Button.d.ts +87 -0
- package/dist/lib/components/ButtonGroup/ButtonGroup.d.ts +26 -0
- package/dist/lib/components/Calendar/CalendarItems/CalendarColoredItem.d.ts +18 -0
- package/dist/lib/components/Calendar/CalendarItems/CalendarItem.d.ts +18 -0
- package/dist/lib/components/Calendar/DayContainer.d.ts +25 -0
- package/dist/lib/components/Calendar/EventDescriptions.d.ts +33 -0
- package/dist/lib/components/Calendar/Fourweeks/FourweeksView.d.ts +23 -0
- package/dist/lib/components/Calendar/Mini/MiniView.d.ts +24 -0
- package/dist/lib/components/Calendar/Month/MonthView.d.ts +23 -0
- package/dist/lib/components/Calendar/Planning/PlanningView.d.ts +41 -0
- package/dist/lib/components/Calendar/Props.d.ts +58 -0
- package/dist/lib/components/Calendar/Week/AlldayContainer.d.ts +19 -0
- package/dist/lib/components/Calendar/Week/HourRow.d.ts +30 -0
- package/dist/lib/components/Calendar/Week/WeekView.d.ts +24 -0
- package/dist/lib/components/Calendar/calendar.functions.d.ts +10 -0
- package/dist/lib/components/Calendar/index.d.ts +15 -0
- package/dist/lib/components/CodeBlock/CodeBlock.d.ts +49 -0
- package/dist/lib/components/Columns/Column.d.ts +207 -0
- package/dist/lib/components/Columns/Columns.d.ts +35 -0
- package/dist/lib/components/Container/Container.d.ts +45 -0
- package/dist/lib/components/Content/Content.d.ts +22 -0
- package/dist/lib/components/DataTable/DataTable.d.ts +227 -0
- package/dist/lib/components/DataTable/DataTableDropdown.d.ts +39 -0
- package/dist/lib/components/Divider/Divider.d.ts +23 -0
- package/dist/lib/components/DragDrop/DragDropList.d.ts +97 -0
- package/dist/lib/components/Dropdown/Dropdown.d.ts +42 -0
- package/dist/lib/components/Footer/Footer.d.ts +22 -0
- package/dist/lib/components/Help/Help.d.ts +19 -0
- package/dist/lib/components/Hero/Hero.d.ts +104 -0
- package/dist/lib/components/Icon/Icon.d.ts +84 -0
- package/dist/lib/components/Image/Image.d.ts +28 -0
- package/dist/lib/components/Indicator/Indicator.d.ts +25 -0
- package/dist/lib/components/Kbd/Kbd.d.ts +30 -0
- package/dist/lib/components/Label/Label.d.ts +11 -0
- package/dist/lib/components/Link/Link.d.ts +44 -0
- package/dist/lib/components/Menu/Menu.d.ts +64 -0
- package/dist/lib/components/Message/Message.d.ts +49 -0
- package/dist/lib/components/Modal/Modal.d.ts +89 -0
- package/dist/lib/components/Notification/Notification.d.ts +38 -0
- package/dist/lib/components/Pagination/Pagination.d.ts +58 -0
- package/dist/lib/components/Panel/Panel.d.ts +99 -0
- package/dist/lib/components/ProgressBar/ProgressBar.d.ts +28 -0
- package/dist/lib/components/QuickView/QuickView.d.ts +61 -0
- package/dist/lib/components/ScrollArea/ScrollArea.d.ts +76 -0
- package/dist/lib/components/Section/Section.d.ts +21 -0
- package/dist/lib/components/SimpleTable/SimpleTable.d.ts +130 -0
- package/dist/lib/components/Steps/Steps.d.ts +61 -0
- package/dist/lib/components/TabBar/TabBar.d.ts +47 -0
- package/dist/lib/components/Tag/Tag.d.ts +54 -0
- package/dist/lib/components/TimeLine/TimeLine.d.ts +62 -0
- package/dist/lib/components/Titles/Titles.d.ts +71 -0
- package/dist/lib/components/ToggleBar/ToggleBar.d.ts +80 -0
- package/dist/lib/components/Tooltip/Tooltip.d.ts +50 -0
- package/dist/lib/components/TreeView/TreeView.d.ts +185 -0
- package/dist/lib/contexts/ActionSheet/ActionSheetContextProvider.d.ts +76 -0
- package/dist/lib/contexts/AppProvider/AppProviders.d.ts +17 -0
- package/dist/lib/contexts/ColorSchemeProvider/ColorSchemeProvider.d.ts +15 -0
- package/dist/lib/contexts/Confirm/ConfirmContextProvider.d.ts +60 -0
- package/dist/lib/contexts/DefaultsProvider/DefaultsProvider.d.ts +100 -0
- package/dist/lib/contexts/DialogsProvider/DialogsProvider.d.ts +4 -0
- package/dist/lib/contexts/KeysProvider/KeysProvider.d.ts +52 -0
- package/dist/lib/contexts/ModalProvider/ModalProvider.d.ts +11 -0
- package/dist/lib/contexts/ModeProvider/ModeProvider.d.ts +16 -0
- package/dist/lib/contexts/Notifier/Notifier.d.ts +81 -0
- package/dist/lib/contexts/Prompt/PromptContextProvider.d.ts +71 -0
- package/dist/lib/forms/Checkbox/Checkbox.d.ts +48 -0
- package/dist/lib/forms/ComboBox/ComboBox.d.ts +44 -0
- package/dist/lib/forms/ComboBox/MultiComboBox.d.ts +44 -0
- package/dist/lib/forms/ComboBox/useComboBoxScroll.d.ts +4 -0
- package/dist/lib/forms/Currency/CurrencyInput.d.ts +50 -0
- package/dist/lib/forms/Datetimes/DateInput.d.ts +37 -0
- package/dist/lib/forms/Datetimes/DateTimeInput.d.ts +44 -0
- package/dist/lib/forms/Datetimes/TimeInput.d.ts +42 -0
- package/dist/lib/forms/File/FileInput.d.ts +71 -0
- package/dist/lib/forms/Input.d.ts +248 -0
- package/dist/lib/forms/MaskedInput/IBANInput.d.ts +95 -0
- package/dist/lib/forms/MaskedInput/MaskedInput.d.ts +46 -0
- package/dist/lib/forms/Numeric/NumberInput.d.ts +16 -0
- package/dist/lib/forms/Numeric/RangeInput.d.ts +21 -0
- package/dist/lib/forms/Others/ColorInput.d.ts +56 -0
- package/dist/lib/forms/Others/HiddenInput.d.ts +29 -0
- package/dist/lib/forms/Others/TelephoneInput.d.ts +14 -0
- package/dist/lib/forms/Others/URLInput.d.ts +14 -0
- package/dist/lib/forms/Periodes/MonthInput.d.ts +43 -0
- package/dist/lib/forms/Periodes/WeekInput.d.ts +43 -0
- package/dist/lib/forms/Radio/Radio.d.ts +97 -0
- package/dist/lib/forms/Select/Select.d.ts +136 -0
- package/dist/lib/forms/TagsInput/TagsInput.d.ts +44 -0
- package/dist/lib/forms/Text/EmailInput.d.ts +14 -0
- package/dist/lib/forms/Text/FormattedInput.d.ts +54 -0
- package/dist/lib/forms/Text/PasswordInput.d.ts +19 -0
- package/dist/lib/forms/Text/TextArea.d.ts +31 -0
- package/dist/lib/forms/Text/TextEditor.d.ts +36 -0
- package/dist/lib/forms/Text/TextInput.d.ts +30 -0
- package/dist/lib/hooks/useCaretPosition.d.ts +8 -0
- package/dist/lib/hooks/useClickOutside.d.ts +15 -0
- package/dist/lib/hooks/useClipboard.d.ts +21 -0
- package/dist/lib/hooks/useContextMenu.d.ts +29 -0
- package/dist/lib/hooks/useCookieState.d.ts +37 -0
- package/dist/lib/hooks/useDebounced.hooks.d.ts +85 -0
- package/dist/lib/hooks/useFetchApi.d.ts +65 -0
- package/dist/lib/hooks/useHotkeys.d.ts +96 -0
- package/dist/lib/hooks/useIndexedDb.d.ts +90 -0
- package/dist/lib/hooks/useLocalStoredState.d.ts +36 -0
- package/dist/lib/hooks/useMediaQuery.d.ts +154 -0
- package/dist/lib/hooks/usePagination.d.ts +25 -0
- package/dist/lib/hooks/usePropState.d.ts +16 -0
- package/dist/lib/hooks/useScrollIntoView.d.ts +59 -0
- package/dist/lib/hooks/useSessionStoredState.d.ts +38 -0
- package/dist/lib/hooks/useThrottle.hooks.d.ts +99 -0
- package/dist/lib/hooks/useToggle.d.ts +16 -0
- package/dist/lib/hooks/useUncontrolled.d.ts +44 -0
- package/dist/lib/hooks/useValidatedState.d.ts +21 -0
- package/dist/lib/index.d.ts +174 -0
- package/dist/lib/internal_functions/createIconsInternal.d.ts +36 -0
- package/dist/lib/internal_functions/getAlignmentClass.d.ts +16 -0
- package/dist/lib/internal_functions/getColorClass.d.ts +23 -0
- package/dist/lib/internal_functions/getPositionClass.d.ts +2 -0
- package/dist/lib/internal_functions/getSizeClass.d.ts +23 -0
- package/dist/lib/internal_functions/index.d.ts +8 -0
- package/dist/lib/shims/useSyncExternalStoreShim.d.ts +1 -0
- package/dist/lib/shims/useSyncExternalStoreWithSelector.d.ts +5 -0
- package/dist/lib/test-data.d.ts +9 -0
- package/dist/lib/types/index.d.ts +104 -0
- package/dist/lib/utils/BSN.functions.d.ts +57 -0
- package/dist/lib/utils/IBAN.functions.d.ts +138 -0
- package/dist/lib/utils/JSDateTime.class.d.ts +512 -0
- package/dist/lib/utils/JSDuration.class.d.ts +184 -0
- package/dist/lib/utils/colors.d.ts +54 -0
- package/dist/lib/utils/compare.d.ts +7 -0
- package/dist/lib/utils/deserialize.function.d.ts +2 -0
- package/dist/lib/utils/flattenChildren.function.d.ts +49 -0
- package/dist/lib/utils/math.d.ts +22 -0
- package/dist/lib/utils/object.functions.d.ts +37 -0
- package/dist/lib/utils/operators.d.ts +195 -0
- package/dist/lib/utils/serialize.function.d.ts +2 -0
- package/dist/lib/utils/sorting.d.ts +34 -0
- package/dist/lib/utils/string.utils.d.ts +125 -0
- package/package.json +51 -51
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { JSDateTime } from './JSDateTime.class';
|
|
2
|
+
export type DiffFnType = 'years' | 'months' | 'weeks' | 'days' | 'hours' | 'minutes' | 'seconds' | 'milliseconds';
|
|
3
|
+
type DiffReturnType = {
|
|
4
|
+
/** Number of milliseconds in this difference */
|
|
5
|
+
milliseconds?: number;
|
|
6
|
+
/** Number of seconds in this difference */
|
|
7
|
+
seconds?: number;
|
|
8
|
+
/** Number of minutes in this difference */
|
|
9
|
+
minutes?: number;
|
|
10
|
+
/** Number of hours in this difference */
|
|
11
|
+
hours?: number;
|
|
12
|
+
/** Number of days in this difference */
|
|
13
|
+
days?: number;
|
|
14
|
+
/** Number of weeks in this difference */
|
|
15
|
+
weeks?: number;
|
|
16
|
+
/** Number of months in this difference */
|
|
17
|
+
months?: number;
|
|
18
|
+
/** Number of years in this difference */
|
|
19
|
+
years?: number;
|
|
20
|
+
/** Number of milliseconds left after subtracting all other wanted date-parts */
|
|
21
|
+
rest?: number;
|
|
22
|
+
};
|
|
23
|
+
export declare class JSDuration {
|
|
24
|
+
/** Een van de 2 JSDateTimes om te vergelijken */ private _jsd1;
|
|
25
|
+
/** Een van de 2 JSDateTimes om te vergelijken */ private _jsd2;
|
|
26
|
+
/**
|
|
27
|
+
* Constructor voor een JSDuration. Gebruik om het verschil in tijd tussen 2 JSDateTimes of Dates te berekenen.
|
|
28
|
+
*
|
|
29
|
+
* @param jsd1 de 1e JSDateTime/Date om het verschil mee uit te rekenen.
|
|
30
|
+
* @param jsd2 (optioneel) de andere JSDateTime/Date om het verschil mee te berekenen (default = Date.now())
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // verschil tussen 01-01-1970 & NU
|
|
34
|
+
* const dur = new JSDuration(JSDateTime.epoch());
|
|
35
|
+
* @example
|
|
36
|
+
* // verschil tussen nu en 1 dag, 30min later
|
|
37
|
+
* let dur = new JSDuration(JSDateTime.now(), JSDateTime.now().plus({ days: 1, minutes: 30 }));
|
|
38
|
+
* console.log(dur.inDays); // 1
|
|
39
|
+
* console.log(dur.differenceIn(['hours', 'minutes'])); // { hours: 24, minutes: 30 }
|
|
40
|
+
*
|
|
41
|
+
* let dur = new JSDuration(JSDateTime.now(), JSDateTime.now().plus({ days: 1, minutes: 30, seconds: 30 }));
|
|
42
|
+
* console.log(dur.differenceIn(['hours', 'minutes'])) // { hours: 24, minutes: 30, rest: 30_000 }
|
|
43
|
+
*/
|
|
44
|
+
constructor(jsd1: Date | JSDateTime, jsd2?: Date | JSDateTime);
|
|
45
|
+
/**
|
|
46
|
+
* Factory method om een JSDuration te maken tussen twee datums. - zelfde als constructor.
|
|
47
|
+
* @param date1 de 1e JSDateTime/Date
|
|
48
|
+
* @param date2 de 2e JSDateTime/Date
|
|
49
|
+
* @returns een nieuwe JSDuration
|
|
50
|
+
* @example
|
|
51
|
+
* const dur = JSDuration.between(JSDateTime.epoch(), JSDateTime.now());
|
|
52
|
+
*/
|
|
53
|
+
static between(date1: Date | JSDateTime, date2: Date | JSDateTime): JSDuration;
|
|
54
|
+
/**
|
|
55
|
+
* Statische methode om te controleren of twee JSDurations gelijk zijn (dezelfde magnitude hebben).
|
|
56
|
+
* @param dur1 de eerste JSDuration of number (milliseconds)
|
|
57
|
+
* @param dur2 de tweede JSDuration of number (milliseconds)
|
|
58
|
+
* @returns true als beide durations dezelfde magnitude hebben, anders false
|
|
59
|
+
* @example
|
|
60
|
+
* const dur1 = new JSDuration(now, now.plus({ hours: 1 }));
|
|
61
|
+
* const dur2 = new JSDuration(now, now.plus({ hours: 1 }));
|
|
62
|
+
* const dur3 = new JSDuration(now, now.plus({ hours: 2 }));
|
|
63
|
+
* console.log(JSDuration.isEqual(dur1, dur2)); // true
|
|
64
|
+
* console.log(JSDuration.isEqual(dur1, dur3)); // false
|
|
65
|
+
* console.log(JSDuration.isEqual(dur1, 3_600_000)); // true (1 hour in ms)
|
|
66
|
+
*/
|
|
67
|
+
static isEqual(dur1: JSDuration | number, dur2: JSDuration | number): boolean;
|
|
68
|
+
/** @returns Aantal absolute milliseconden tussen de twee JSDateTimes van deze duration (altijd positief) */
|
|
69
|
+
private get ms();
|
|
70
|
+
/**
|
|
71
|
+
* Geeft de primitieve waarde van de duration terug (in milliseconden).
|
|
72
|
+
* Hierdoor kunnen durations vergeleken worden met < en > operators.
|
|
73
|
+
* @returns Aantal milliseconden tussen de twee datums
|
|
74
|
+
* @example
|
|
75
|
+
* const dur1 = new JSDuration(now, now.plus({ hours: 1 }));
|
|
76
|
+
* const dur2 = new JSDuration(now, now.plus({ hours: 2 }));
|
|
77
|
+
* console.log(dur1 < dur2); // true
|
|
78
|
+
* console.log(dur2 > dur1); // true
|
|
79
|
+
*/
|
|
80
|
+
valueOf(): number;
|
|
81
|
+
/** @returns Aantal milliseconden tussen de twee datums. */
|
|
82
|
+
get inMillis(): number;
|
|
83
|
+
/** @returns Aantal HELE seconden tussen de twee datums. */
|
|
84
|
+
get inSeconds(): number;
|
|
85
|
+
/** @returns Aantal HELE minuten tussen de twee datums. */
|
|
86
|
+
get inMinutes(): number;
|
|
87
|
+
/** @returns Aantal HELE uren tussen de twee datums. */
|
|
88
|
+
get inHours(): number;
|
|
89
|
+
/** @returns Aantal HELE dagen tussen de twee datums. */
|
|
90
|
+
get inDays(): number;
|
|
91
|
+
/** @returns Aantal HELE weken tussen de twee datums. */
|
|
92
|
+
get inWeeks(): number;
|
|
93
|
+
/** @returns Aantal HELE maanden tussen de twee datums (calendar-based). */
|
|
94
|
+
get inMonths(): number;
|
|
95
|
+
/** @returns Aantal HELE jaren tussen de twee datums (calendar-based). */
|
|
96
|
+
get inYears(): number;
|
|
97
|
+
/** @returns Een overzicht van alle gehele waarden tussen de twee datums @deprecated gebruik `breakdown` */
|
|
98
|
+
get inAllTypes(): {
|
|
99
|
+
milliseconds: number;
|
|
100
|
+
seconds: number;
|
|
101
|
+
minutes: number;
|
|
102
|
+
hours: number;
|
|
103
|
+
days: number;
|
|
104
|
+
weeks: number;
|
|
105
|
+
months: number;
|
|
106
|
+
years: number;
|
|
107
|
+
};
|
|
108
|
+
/** @returns Een overzicht van alle gehele waarden tussen de twee datums */
|
|
109
|
+
get breakdown(): {
|
|
110
|
+
milliseconds: number;
|
|
111
|
+
seconds: number;
|
|
112
|
+
minutes: number;
|
|
113
|
+
hours: number;
|
|
114
|
+
days: number;
|
|
115
|
+
weeks: number;
|
|
116
|
+
months: number;
|
|
117
|
+
years: number;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Bereken het verschil tussen de twee datums in de gewenste types.
|
|
121
|
+
* Dat is het verschil tov de inXXX-get-functions, die geven alleen het verschil in gehele eenheden van dat type
|
|
122
|
+
* @param types een array van de gewenste types
|
|
123
|
+
* @returns {DiffReturnType}een object met daarin de waarden van de gewenste types
|
|
124
|
+
* @example
|
|
125
|
+
* const dur = new JSDuration(JSDateTime.now(), JSDateTime.now().plus({ days: 1, minutes: 30 }));
|
|
126
|
+
* dur.differenceIn(['hours', 'minutes']); // { hours: 24, minutes: 30 }
|
|
127
|
+
* dur.differenceIn(['days', 'minutes']); // { days: 1, minutes: 30 }
|
|
128
|
+
* dur.differenceIn(['hours']); // { hours: 24, rest: 1_800_000 }
|
|
129
|
+
*/
|
|
130
|
+
differenceIn(types: DiffFnType[]): DiffReturnType;
|
|
131
|
+
/**
|
|
132
|
+
* Geeft een menselijk leesbare string terug van de duration.
|
|
133
|
+
* @returns een string in het formaat "Xy Xmo Xd Xh Xm Xs"
|
|
134
|
+
* @example
|
|
135
|
+
* const dur = new JSDuration(JSDateTime.now(), JSDateTime.now().plus({ days: 2, hours: 3, minutes: 45, seconds: 30 }));
|
|
136
|
+
* console.log(dur.toString()); // "2d 3h 45m 30s"
|
|
137
|
+
* @example
|
|
138
|
+
* const dur2 = new JSDuration(JSDateTime.now(), JSDateTime.now().plus({ years: 1, months: 6, days: 15 }));
|
|
139
|
+
* console.log(dur2.toString()); // "1y 6mo 15d"
|
|
140
|
+
*/
|
|
141
|
+
toString(): string;
|
|
142
|
+
/**
|
|
143
|
+
* Controleert of de duration gelijk is aan nul (beide datums zijn hetzelfde).
|
|
144
|
+
* @returns true als de duration 0 milliseconden is, anders false
|
|
145
|
+
* @example
|
|
146
|
+
* const dur1 = new JSDuration(JSDateTime.now(), JSDateTime.now());
|
|
147
|
+
* console.log(dur1.isZero()); // true
|
|
148
|
+
*
|
|
149
|
+
* const dur2 = new JSDuration(JSDateTime.now(), JSDateTime.now().plus({ seconds: 1 }));
|
|
150
|
+
* console.log(dur2.isZero()); // false
|
|
151
|
+
*/
|
|
152
|
+
isZero(): boolean;
|
|
153
|
+
/**
|
|
154
|
+
* Controleert of de duration negatief is (tweede datum is eerder dan de eerste).
|
|
155
|
+
* Let op: intern gebruikt de class altijd absolute waarden, dus deze method kijkt naar de originele volgorde.
|
|
156
|
+
* @returns true als jsd2 < jsd1, anders false
|
|
157
|
+
* @example
|
|
158
|
+
* const dur = new JSDuration(JSDateTime.now(), JSDateTime.now().plus({ days: -1 }));
|
|
159
|
+
* console.log(dur.isNegative()); // true
|
|
160
|
+
*/
|
|
161
|
+
isNegative(): boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Geeft een nieuwe JSDuration terug waar de volgorde van de datums is omgedraaid.
|
|
164
|
+
* @returns een nieuwe JSDuration met omgedraaide datums
|
|
165
|
+
* @example
|
|
166
|
+
* const dur1 = new JSDuration(date1, date2);
|
|
167
|
+
* const dur2 = dur1.negate();
|
|
168
|
+
* console.log(dur1.isNegative() === !dur2.isNegative()); // true
|
|
169
|
+
*/
|
|
170
|
+
negate(): JSDuration;
|
|
171
|
+
/**
|
|
172
|
+
* Controleert of deze duration gelijk is aan een andere duration of een numerieke waarde (in milliseconden).
|
|
173
|
+
* @param other de JSDuration of number (milliseconds) om mee te vergelijken
|
|
174
|
+
* @returns true als de durations dezelfde magnitude hebben, anders false
|
|
175
|
+
* @throws Error als het type ongeldig is
|
|
176
|
+
* @example
|
|
177
|
+
* const dur1 = new JSDuration(now, now.plus({ hours: 1 }));
|
|
178
|
+
* const dur2 = new JSDuration(now, now.plus({ hours: 1 }));
|
|
179
|
+
* console.log(dur1.equals(dur2)); // true
|
|
180
|
+
* console.log(dur1.equals(3_600_000)); // true (1 hour in milliseconds)
|
|
181
|
+
*/
|
|
182
|
+
equals(other: JSDuration | number): boolean;
|
|
183
|
+
}
|
|
184
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { HexColor, RGBColor, HSLColor, ColorProp, ColorSchemeType } from '..';
|
|
2
|
+
/** Vaste (per jaar verschillende) kleuren die gebruikt worden binnen `loon-bulma-react` voor als we GEEN css kunnen gebruiken. */
|
|
3
|
+
export declare const DefinedHexColors: Readonly<{
|
|
4
|
+
Primary: "#0089b6";
|
|
5
|
+
Info: "#3b59ec";
|
|
6
|
+
Link: "#2f47bc";
|
|
7
|
+
Success: "#519c43";
|
|
8
|
+
Danger: "#d91000";
|
|
9
|
+
Warning: "#eea720";
|
|
10
|
+
Light: "#f5f5f5";
|
|
11
|
+
Dark: "#363636";
|
|
12
|
+
}>;
|
|
13
|
+
export declare function setColorScheme(scheme?: ColorSchemeType): void;
|
|
14
|
+
export declare function getCurrentColorScheme(): ColorSchemeType;
|
|
15
|
+
/** bepaal het color scheme dat door het systeem wordt gebruikt */
|
|
16
|
+
export declare function getSystemColorScheme(): ColorSchemeType;
|
|
17
|
+
/**
|
|
18
|
+
* Bepaal op basis van de achtergrondkleur wat de kleur van de tekst moet zijn (zwart of wit).
|
|
19
|
+
* - alpha-channel wordt genegeerd.
|
|
20
|
+
* - gebaseerd op WCAG-guidelines
|
|
21
|
+
* @param bgColor de achtergrondkleur van de tekst. string? hex colors (#abc of #abcdef). tuple? [r, g, b] of [h, s, l]
|
|
22
|
+
* @returns zwart of wit (hex-color of rgb-tuple)
|
|
23
|
+
* @example
|
|
24
|
+
* calculateTxtColor('#ffffff'); // '#000000'
|
|
25
|
+
* calculateTxtColor('#000000'); // '#ffffff'
|
|
26
|
+
* calculateTxtColor([0, 0, 0]); // [255, 255, 255]
|
|
27
|
+
* calculateTxtColor([255, 255, 255]); // [0, 0, 0]
|
|
28
|
+
*/
|
|
29
|
+
export declare function calculateTxtColor<T = HexColor | RGBColor | HSLColor>(bgColor: HexColor | RGBColor | HSLColor, type?: 'hex' | 'rgb' | 'hsl'): T;
|
|
30
|
+
export declare function colorPropToHex(color: ColorProp | HexColor): HexColor;
|
|
31
|
+
/** Converteer een r-g-b color naar een hex color */
|
|
32
|
+
export declare function rgbToHex([r, g, b]: RGBColor | [r: number, g: number, b: number]): HexColor;
|
|
33
|
+
/** Converteer een hex color naar een r-g-b color */
|
|
34
|
+
export declare function hexToRGB(hex: HexColor | string): RGBColor;
|
|
35
|
+
/** Converteer een h-s-l color naar een hex color */
|
|
36
|
+
export declare function hslToHex([h, s, l]: HSLColor | [h: number, s: number, l: number]): HexColor;
|
|
37
|
+
/** Converteer een hex color naar een h-s-l color */
|
|
38
|
+
export declare function hexToHSL(hex: HexColor | string): HSLColor;
|
|
39
|
+
/** Converteer een RGB-color naar een HSL-color
|
|
40
|
+
* @todo: HSL kleuren zijn experimenteel!
|
|
41
|
+
*/
|
|
42
|
+
export declare function rgbToHSL([r255, g255, b255]: RGBColor | [r: number, g: number, b: number]): HSLColor;
|
|
43
|
+
/** converteer een hsl-color naar een rgb-color
|
|
44
|
+
* @todo: HSL kleuren zijn experimenteel!
|
|
45
|
+
*/
|
|
46
|
+
export declare function hslToRGB([h, s, l]: HSLColor | [h: number, s: number, l: number]): RGBColor;
|
|
47
|
+
/** returns een random color van onze `ColorProp`s. */
|
|
48
|
+
export declare function randomColor(colors?: Array<HexColor> | undefined): HexColor;
|
|
49
|
+
/** returns een random color van onze `ColorProp`s. */
|
|
50
|
+
export declare function randomColorProp(colors?: Array<ColorProp | HexColor>): ColorProp | HexColor;
|
|
51
|
+
/** controleer of een object een hex color is */
|
|
52
|
+
export declare function isHexColor(obj: any): obj is HexColor;
|
|
53
|
+
export declare function isRGBColor(obj: any): obj is RGBColor;
|
|
54
|
+
export declare function isHSLColor(obj: any): obj is HSLColor;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Zet React children om naar een array en verwijdert fragment-wrappers.
|
|
4
|
+
*
|
|
5
|
+
* @param children - De React children die geflattened moeten worden
|
|
6
|
+
* @param deep - Optioneel. Als `true`, worden geneste fragments recursief geflattened. Als `false` (default), wordt alleen het eerste niveau van fragments geflattened.
|
|
7
|
+
* @param keys - Optioneel. Interne parameter voor het bijhouden van keys (wordt automatisch gebruikt bij recursie)
|
|
8
|
+
* @returns Een array met de geflattende children
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Shallow flattening (default) - alleen het eerste niveau van fragments wordt verwijderd
|
|
12
|
+
* const children = (
|
|
13
|
+
* <>
|
|
14
|
+
* <div>First</div>
|
|
15
|
+
* <div>Second</div>
|
|
16
|
+
* </>
|
|
17
|
+
* );
|
|
18
|
+
* const flattened = flattenChildren(children);
|
|
19
|
+
* // Result: [<div>First</div>, <div>Second</div>]
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* // Shallow flattening met geneste fragments - binnenste fragment blijft intact
|
|
23
|
+
* const children = (
|
|
24
|
+
* <>
|
|
25
|
+
* <div>First</div>
|
|
26
|
+
* <>
|
|
27
|
+
* <div>Nested</div>
|
|
28
|
+
* </>
|
|
29
|
+
* </>
|
|
30
|
+
* );
|
|
31
|
+
* const flattened = flattenChildren(children);
|
|
32
|
+
* // Result: [<div>First</div>, <Fragment><div>Nested</div></Fragment>]
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* // Deep flattening - alle niveaus van fragments worden recursief verwijderd
|
|
36
|
+
* const children = (
|
|
37
|
+
* <>
|
|
38
|
+
* <div>First</div>
|
|
39
|
+
* <>
|
|
40
|
+
* <>
|
|
41
|
+
* <div>Deeply nested</div>
|
|
42
|
+
* </>
|
|
43
|
+
* </>
|
|
44
|
+
* </>
|
|
45
|
+
* );
|
|
46
|
+
* const flattened = flattenChildren(children, true);
|
|
47
|
+
* // Result: [<div>First</div>, <div>Deeply nested</div>]
|
|
48
|
+
*/
|
|
49
|
+
export declare function flattenChildren(children: ReactNode, deep?: boolean, keys?: (string | number)[]): ReactNode[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Genereer ene random integer tussen 2 waarden
|
|
3
|
+
* @param min Minimum waarde (exclusief)
|
|
4
|
+
* @param max Maximum waarde (exclusief)
|
|
5
|
+
* @param inclusive Inclusief de `min` en `max` waarde (default `true`)
|
|
6
|
+
* @returns random geheel getal tussen de `min` en de `max` waarde
|
|
7
|
+
*/
|
|
8
|
+
export declare function randomInt(min: number, max: number, inclusive?: boolean): number;
|
|
9
|
+
/**
|
|
10
|
+
* Genereer een random double / float tussen 2 waarden
|
|
11
|
+
* @param min Minimum waarde
|
|
12
|
+
* @param max Maximum waarde
|
|
13
|
+
* @returns random getal tussen de `min` en de `max` waarde
|
|
14
|
+
*/
|
|
15
|
+
export declare function randomDbl(min: number, max: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* Rond een getal af op het `digits` aantal decimalen (default 2)
|
|
18
|
+
* @param value de af te ronden waarde
|
|
19
|
+
* @param digits de gewenste precisie (default 2)
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function roundTo(value: number, digits?: number): number;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DeepPartial } from 'lib/types';
|
|
2
|
+
/**
|
|
3
|
+
* Test if an object is empty (has no own properties) or is null/undefined.
|
|
4
|
+
* - For arrays, it checks if the length is 0.
|
|
5
|
+
* - For objects, it checks if there are no own properties.
|
|
6
|
+
* - For null or undefined, it returns the value of `undefinedOrNullIsEmpty`.
|
|
7
|
+
* - For other types (like strings, numbers), it returns false.
|
|
8
|
+
* @param obj - The object to test.
|
|
9
|
+
* @param undefinedOrNullIsEmpty - If true, null and undefined are considered empty. Default is true.
|
|
10
|
+
* @returns True if the object is empty, false otherwise.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isEmptyObject(obj: any, undefinedOrNullIsEmpty?: boolean): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Merges two objects recursively, with support for arrays and nested objects.
|
|
15
|
+
* - If a new value is null or undefined, it will overwrite the existing value.
|
|
16
|
+
* - If both values are arrays, they can be merged based on the specified strategy (replace, concat, unique).
|
|
17
|
+
* - If both values are objects, they will be merged recursively.
|
|
18
|
+
* - For other types, the new value will overwrite the existing value.
|
|
19
|
+
* @param existing - The existing object.
|
|
20
|
+
* @param nieuw - The new object to merge.
|
|
21
|
+
* @param reuse - If true, the existing object will be modified. Default is false.
|
|
22
|
+
* @param arrayMergeStrategy - The strategy for merging arrays. Default is 'replace'.
|
|
23
|
+
* @returns The merged object, which is a combination of the existing and new objects.
|
|
24
|
+
*/
|
|
25
|
+
declare function mergeObjects<T extends Record<string, any>>(existing: T, nieuw: Partial<T>, reuse?: boolean, arrayMergeStrategy?: 'replace' | 'concat' | 'unique'): T;
|
|
26
|
+
declare function mergeObjects<T extends Record<string, any>>(existing: T, nieuw: DeepPartial<T>, reuse?: boolean, arrayMergeStrategy?: 'replace' | 'concat' | 'unique'): T;
|
|
27
|
+
declare function mergeObjects<T extends Record<string, any>, U extends Record<string, any>>(existing: T, nieuw: U, reuse?: boolean, arrayMergeStrategy?: 'replace' | 'concat' | 'unique'): T & U;
|
|
28
|
+
export { mergeObjects };
|
|
29
|
+
/**
|
|
30
|
+
* Maak een kopie van een object (deep clone, dus ook object-properties worden gekloond)
|
|
31
|
+
* Ondersteunt ook circulaire referenties.
|
|
32
|
+
* @param obj het originele object
|
|
33
|
+
* @returns een kopie van het originele object
|
|
34
|
+
* @alias copyObject: `cloneObject` is ook beschikbaar onder de naam `copyObject`.
|
|
35
|
+
*/
|
|
36
|
+
declare function cloneObject<T>(obj: T): T;
|
|
37
|
+
export { cloneObject, cloneObject as copyObject };
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/** recursieve AND-vergelijking met truthy and falsy waarden
|
|
2
|
+
* @param x Eerste waarde
|
|
3
|
+
* @param y Tweede waarde
|
|
4
|
+
* @param rest Nog meer waarden, die ook allemaal truthy/falsy kunnen zijn
|
|
5
|
+
* @returns true als alle waarden truthy zijn, anders false
|
|
6
|
+
* @example
|
|
7
|
+
* AND(true, false) // false
|
|
8
|
+
* AND(1, 1) // true
|
|
9
|
+
* AND(1, '1', null, NaN) // false
|
|
10
|
+
*
|
|
11
|
+
* @description Truth table:
|
|
12
|
+
* | x | y | result |
|
|
13
|
+
* |-----|-----|--------|
|
|
14
|
+
* | `1` | `1` | `1` |
|
|
15
|
+
* | `1` | `0` | `0` |
|
|
16
|
+
* | `0` | `1` | `0` |
|
|
17
|
+
* | `0` | `0` | `0` |
|
|
18
|
+
*/
|
|
19
|
+
export declare function AND(x: unknown, y: unknown, ...rest: unknown[]): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* recursieve NAND vergelijking met truthy and falsy waarden
|
|
22
|
+
* @param x Eerste waarde
|
|
23
|
+
* @param y Tweede waarde
|
|
24
|
+
* @param rest Nog meer waarden, die ook allemaal truthy/falsy kunnen zijn
|
|
25
|
+
* @returns true zolang niet ALLE waarden truthy zijn, anders false
|
|
26
|
+
* @example
|
|
27
|
+
* NAND(true, false) // true
|
|
28
|
+
* NAND(1, 1) // false
|
|
29
|
+
* NAND(1, '1', null, NaN) // true
|
|
30
|
+
* NAND(1,2,3,4,'str', true) // false
|
|
31
|
+
* @description Truth table:
|
|
32
|
+
* | x | y | result |
|
|
33
|
+
* |-----|-----|--------|
|
|
34
|
+
* | `1` | `1` | `0` |
|
|
35
|
+
* | `1` | `0` | `1` |
|
|
36
|
+
* | `0` | `1` | `1` |
|
|
37
|
+
* | `0` | `0` | `1` |
|
|
38
|
+
*/
|
|
39
|
+
export declare function NAND(x: unknown, y: unknown, ...rest: unknown[]): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* recursieve OR-vergelijking met truthy and falsy waarden
|
|
42
|
+
* @param x Eerste waarde
|
|
43
|
+
* @param y Tweede waarde
|
|
44
|
+
* @param rest Nog meer waarden, die ook allemaal truthy/falsy kunnen zijn
|
|
45
|
+
* @returns true als een van beide waarden truey is, of allebei, anders false
|
|
46
|
+
* @example
|
|
47
|
+
* OR(true, false) // true
|
|
48
|
+
* OR(1, 1) // true
|
|
49
|
+
* OR(1, '1', null, NaN) // true
|
|
50
|
+
* OR(false,false,null,0) // false
|
|
51
|
+
* @description Truth table:
|
|
52
|
+
* | x | y | result |
|
|
53
|
+
* |-----|-----|--------|
|
|
54
|
+
* | `1` | `1` | `1` |
|
|
55
|
+
* | `1` | `0` | `1` |
|
|
56
|
+
* | `0` | `1` | `1` |
|
|
57
|
+
* | `0` | `0` | `0` |
|
|
58
|
+
*/
|
|
59
|
+
export declare function OR(x: unknown, y: unknown, ...rest: unknown[]): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Recursieve NOR-vergelijking, met truthy and falsy waarden
|
|
62
|
+
* @param x Eerste waarde
|
|
63
|
+
* @param y Tweede waarde
|
|
64
|
+
* @param rest Nog meer waarden, die ook allemaal truthy/falsy kunnen zijn
|
|
65
|
+
* @returns true als beide waarden falsey zijn, anders false
|
|
66
|
+
* @example
|
|
67
|
+
* NOR(true, false) // false
|
|
68
|
+
* NOR(1, 1) // false
|
|
69
|
+
* NOR(1, '1', null, NaN) // false
|
|
70
|
+
* NOR(false,false,null,0) // true
|
|
71
|
+
* @description Truth table:
|
|
72
|
+
* | x | y | result |
|
|
73
|
+
* |-----|-----|--------|
|
|
74
|
+
* | `1` | `1` | `0` |
|
|
75
|
+
* | `1` | `0` | `0` |
|
|
76
|
+
* | `0` | `1` | `0` |
|
|
77
|
+
* | `0` | `0` | `1` |
|
|
78
|
+
*/
|
|
79
|
+
export declare function NOR(x: unknown, y: unknown, ...rest: unknown[]): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* XOR-vergelijking met truthy and falsy waarden (odd parity)
|
|
82
|
+
* @param x Eerste waarde
|
|
83
|
+
* @param y Tweede waarde
|
|
84
|
+
* @param rest Nog meer waarden, die ook allemaal truthy/falsy kunnen zijn
|
|
85
|
+
* @returns true als een oneven aantal waarden truthy zijn (1, 3, 5, ...)
|
|
86
|
+
* @example
|
|
87
|
+
* XOR(true, false) // true
|
|
88
|
+
* XOR(1, 1) // false
|
|
89
|
+
* XOR(1, '1', null, true) // false (2 truthy)
|
|
90
|
+
* XOR(1,2,3,4,'str', true) // false (6 truthy)
|
|
91
|
+
* XOR(false, false, false, true, false) // true (1 truthy)
|
|
92
|
+
* XOR(false, false, false, false) // false (0 truthy)
|
|
93
|
+
* XOR(false, true, false, false, true) // false (2 truthy)
|
|
94
|
+
* XOR(true, true, true) // true (3 truthy)
|
|
95
|
+
* @description Truth table (2 inputs, odd parity):
|
|
96
|
+
* | x | y | result |
|
|
97
|
+
* |-----|-----|--------|
|
|
98
|
+
* | `1` | `1` | `0` |
|
|
99
|
+
* | `1` | `0` | `1` |
|
|
100
|
+
* | `0` | `1` | `1` |
|
|
101
|
+
* | `0` | `0` | `0` |
|
|
102
|
+
*
|
|
103
|
+
* Truth table (3 inputs, odd parity):
|
|
104
|
+
* | x | y | z | result |
|
|
105
|
+
* |-----|-----|-----|--------|
|
|
106
|
+
* | `1` | `1` | `1` | `1` |
|
|
107
|
+
* | `1` | `1` | `0` | `0` |
|
|
108
|
+
* | `1` | `0` | `1` | `0` |
|
|
109
|
+
* | `1` | `0` | `0` | `1` |
|
|
110
|
+
* | `0` | `1` | `1` | `0` |
|
|
111
|
+
* | `0` | `1` | `0` | `1` |
|
|
112
|
+
* | `0` | `0` | `1` | `1` |
|
|
113
|
+
* | `0` | `0` | `0` | `0` |
|
|
114
|
+
*/
|
|
115
|
+
export declare function XOR(x: unknown, y: unknown, ...rest: unknown[]): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* XNOR-vergelijking met truthy and falsy waarden (even parity)
|
|
118
|
+
* @param x Eerste waarde
|
|
119
|
+
* @param y Tweede waarde
|
|
120
|
+
* @param rest Nog meer waarden, die ook allemaal truthy/falsy kunnen zijn
|
|
121
|
+
* @returns true als een even aantal waarden truthy zijn (0, 2, 4, ...)
|
|
122
|
+
* @description Truth table (2 inputs, even parity):
|
|
123
|
+
* | x | y | result |
|
|
124
|
+
* |-----|-----|--------|
|
|
125
|
+
* | `1` | `1` | `1` |
|
|
126
|
+
* | `1` | `0` | `0` |
|
|
127
|
+
* | `0` | `1` | `0` |
|
|
128
|
+
* | `0` | `0` | `1` |
|
|
129
|
+
*
|
|
130
|
+
* Truth table (3 inputs, even parity):
|
|
131
|
+
* | x | y | z | result |
|
|
132
|
+
* |-----|-----|-----|--------|
|
|
133
|
+
* | `1` | `1` | `1` | `0` |
|
|
134
|
+
* | `1` | `1` | `0` | `1` |
|
|
135
|
+
* | `1` | `0` | `1` | `1` |
|
|
136
|
+
* | `1` | `0` | `0` | `0` |
|
|
137
|
+
* | `0` | `1` | `1` | `1` |
|
|
138
|
+
* | `0` | `1` | `0` | `0` |
|
|
139
|
+
* | `0` | `0` | `1` | `0` |
|
|
140
|
+
* | `0` | `0` | `0` | `1` |
|
|
141
|
+
*/
|
|
142
|
+
export declare function XNOR(x: unknown, y: unknown, ...rest: unknown[]): boolean;
|
|
143
|
+
/**
|
|
144
|
+
* NOT-vergelijking
|
|
145
|
+
* @param val Waarde
|
|
146
|
+
* @returns true als de waarde falsey is, anders false
|
|
147
|
+
* @description Truth table:
|
|
148
|
+
* | val | result |
|
|
149
|
+
* |-----|--------|
|
|
150
|
+
* | `1` | `0` |
|
|
151
|
+
* | `0` | `1` |
|
|
152
|
+
*/
|
|
153
|
+
export declare function NOT(val: unknown): boolean;
|
|
154
|
+
/**
|
|
155
|
+
* IF-vergelijkking. Met 2 of 3 parameters
|
|
156
|
+
* - 2 parameters: als val truthy is, return val, anders then
|
|
157
|
+
* - 3 parameters: als val truthy is, return then, anders otherwise
|
|
158
|
+
* @param val een truthy of falsy waarde
|
|
159
|
+
* @param then een returnbare waarde
|
|
160
|
+
* @param otherwise nog een returnbare waarde in geval van 3 parameters
|
|
161
|
+
* @returns Een van de opgegeven waarden.
|
|
162
|
+
* @example
|
|
163
|
+
* // IF-vergelijking met 2 parameters. Als val truey is, return val, anders then
|
|
164
|
+
* IF(0, 'a') => 'a'
|
|
165
|
+
* IF(2, 'a') => 2
|
|
166
|
+
* @example
|
|
167
|
+
* // IF-vergelijking met 3 parameters. Als val truey is, return then, anders otherwise
|
|
168
|
+
* IF(1, 'a', 'b') => 'a'
|
|
169
|
+
* IF(0, 'a', 'b') => 'b'
|
|
170
|
+
*/
|
|
171
|
+
export declare function IF<T, A>(val: T, then: A): T | A;
|
|
172
|
+
export declare function IF<T, A, B>(val: T, then: A, otherwise: B): T | A | B;
|
|
173
|
+
type SwitchFnType<T, RT> = {
|
|
174
|
+
/** de (optionele) waarde in de switch statement */
|
|
175
|
+
value: T | null;
|
|
176
|
+
/** een array van tuples alle mogelijke waardes van de statement, bestaand uit een value [0] en returnValue [1] */
|
|
177
|
+
cases: Array<[value: T | null, returnVal: RT | null]>;
|
|
178
|
+
/** de default waarde, als er geen match is (case default), als niet opgegeven, maken we een defaultCase van `null` */
|
|
179
|
+
defaultCase?: RT | undefined;
|
|
180
|
+
/** een functie om de geselecteerde value uit de switch te bepalen als we met objecten werken. */
|
|
181
|
+
compare?: (switchVal: T | null, caseVal: T | null) => boolean | undefined;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Switch statement om een waarde uit een lijst van waarden te selecteren en te returnen.
|
|
185
|
+
* een value met waarde `null` wordt gezien als defaultCase, deze kan je in de cases array zetten, of alleen de defaultCase als param opgeven
|
|
186
|
+
* @returns een van de waarden uit de cases, of de defaultCase
|
|
187
|
+
* @example
|
|
188
|
+
* SWITCH({
|
|
189
|
+
* value: 1,
|
|
190
|
+
* cases: [ [1, 'a'], [2, 'b'], [3, 'c'] ],
|
|
191
|
+
* defaultCase: 'd'
|
|
192
|
+
* }); // 'a'
|
|
193
|
+
*/
|
|
194
|
+
export declare function SWITCH<T, RT>({ value: switchVal, cases, defaultCase, compare }: SwitchFnType<T, RT>): RT | null;
|
|
195
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { JSDateTime } from "./JSDateTime.class";
|
|
2
|
+
/**
|
|
3
|
+
* Sort boolean values
|
|
4
|
+
* @param a
|
|
5
|
+
* @param b
|
|
6
|
+
@example [true, false, false, true, true, false].sort((a,b) => boolSort(a,b))
|
|
7
|
+
@example [true, false, false, true, true, false].sort(boolSort);
|
|
8
|
+
*/
|
|
9
|
+
export declare const boolSort: (a?: boolean | undefined, b?: boolean | undefined) => -1 | 0 | 1 | number;
|
|
10
|
+
/**
|
|
11
|
+
* sort Date / JSDateTime values
|
|
12
|
+
* @param a
|
|
13
|
+
* @param b
|
|
14
|
+
* @example [new Date(), new Date(), new Date(), new Date(), new Date(), new Date()].sort((a,b) => dateSort(a,b))
|
|
15
|
+
* @example [new Date(), new Date(), new Date(), new Date(), new Date(), new Date()].sort(dateSort);
|
|
16
|
+
* @example [new Date(), new Date(), JSDateTime.now(), JSDateTime.now(), new Date()].sort(dateSort);
|
|
17
|
+
*/
|
|
18
|
+
export declare const dateSort: (a?: Date | JSDateTime | undefined, b?: Date | JSDateTime | undefined) => -1 | 0 | 1 | number;
|
|
19
|
+
/**
|
|
20
|
+
* Sort string values
|
|
21
|
+
* @param a
|
|
22
|
+
* @param b
|
|
23
|
+
* @example ["a", "b", "c", "d", "e", "f"].sort((a,b) => stringSort(a,b))
|
|
24
|
+
* @example ["a", "b", "c", "d", "e", "f"].sort(stringSort);
|
|
25
|
+
*/
|
|
26
|
+
export declare const stringSort: (a?: string | undefined, b?: string | undefined) => -1 | 0 | 1 | number;
|
|
27
|
+
/**
|
|
28
|
+
* Sort number values
|
|
29
|
+
* @param a
|
|
30
|
+
* @param b
|
|
31
|
+
* @example [1, 2, 3, 4, 5, 6].sort((a,b) => numSort(a,b))
|
|
32
|
+
* @example [1, 2, 3, 4, 5, 6].sort(numSort);
|
|
33
|
+
*/
|
|
34
|
+
export declare const numSort: (a?: number | undefined, b?: number | undefined) => -1 | 0 | 1 | number;
|