athena-ui-js 2.0.0 → 2.0.1

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 (76) hide show
  1. package/README.md +28 -4
  2. package/package.json +5 -2
  3. package/src/athena-ui.js +1 -1
  4. package/src/libs/config/config.js +1 -1
  5. package/src/libs/hephaestus/chartGenerator/chartGenerator.js +26 -2
  6. package/types/athena-ui.d.ts +96 -96
  7. package/types/chart.d.ts +1 -1
  8. package/types/classic.d.ts +1 -1
  9. package/types/components.d.ts +1 -1
  10. package/types/controls.d.ts +3 -3
  11. package/types/csv.d.ts +1 -1
  12. package/types/dialog.d.ts +2 -2
  13. package/types/dom.d.ts +1 -1
  14. package/types/feedback.d.ts +1 -1
  15. package/types/format.d.ts +1 -1
  16. package/types/forms.d.ts +2 -2
  17. package/types/i18n.d.ts +1 -1
  18. package/types/inputs.d.ts +4 -4
  19. package/types/libs/config/config.d.ts +3 -3
  20. package/types/libs/config/hooks.d.ts +8 -8
  21. package/types/libs/core/combobox.d.ts +10 -10
  22. package/types/libs/core/controls.d.ts +28 -28
  23. package/types/libs/core/cookies.d.ts +27 -27
  24. package/types/libs/core/csv.d.ts +12 -12
  25. package/types/libs/core/dateRange.d.ts +72 -72
  26. package/types/libs/core/dom.d.ts +65 -65
  27. package/types/libs/core/elementGenerator.d.ts +30 -30
  28. package/types/libs/core/errors.d.ts +29 -29
  29. package/types/libs/core/focus.d.ts +6 -6
  30. package/types/libs/core/format.d.ts +21 -21
  31. package/types/libs/core/hungarianControls.d.ts +2 -2
  32. package/types/libs/core/i18n.d.ts +17 -17
  33. package/types/libs/core/pagination.d.ts +5 -5
  34. package/types/libs/core/sanitize.d.ts +6 -6
  35. package/types/libs/core/tableMath.d.ts +26 -26
  36. package/types/libs/core/theme.d.ts +39 -39
  37. package/types/libs/core/validation.d.ts +56 -56
  38. package/types/libs/hephaestus/LayoutGenerator/basicLayoutGenerator.d.ts +10 -10
  39. package/types/libs/hephaestus/LayoutGenerator/footerContentGenerator.d.ts +4 -4
  40. package/types/libs/hephaestus/LayoutGenerator/headerContentGenerator.d.ts +20 -20
  41. package/types/libs/hephaestus/LayoutGenerator/wrapperContentGenerator.d.ts +1 -1
  42. package/types/libs/hephaestus/MenuGenerator/basicMenuGenerator.d.ts +14 -14
  43. package/types/libs/hephaestus/MenuGenerator/menuGenerator.d.ts +65 -65
  44. package/types/libs/hephaestus/auth/authState.d.ts +26 -26
  45. package/types/libs/hephaestus/auth/session.d.ts +26 -26
  46. package/types/libs/hephaestus/chartGenerator/chartGenerator.d.ts +2 -0
  47. package/types/libs/hephaestus/componentGenerator/componentGenerator.d.ts +222 -222
  48. package/types/libs/hephaestus/componentGenerator/themePicker.d.ts +24 -24
  49. package/types/libs/hephaestus/dialogGenerator/dialogGenerator.d.ts +120 -120
  50. package/types/libs/hephaestus/feedbackGenerator/feedbackGenerator.d.ts +86 -86
  51. package/types/libs/hephaestus/formGenerator/authForms.d.ts +122 -122
  52. package/types/libs/hephaestus/formGenerator/changePasswordFormGenerator.d.ts +6 -6
  53. package/types/libs/hephaestus/formGenerator/formBuilder.d.ts +113 -113
  54. package/types/libs/hephaestus/formGenerator/formUtils.d.ts +8 -8
  55. package/types/libs/hephaestus/formGenerator/loginFormGenerator.d.ts +11 -11
  56. package/types/libs/hephaestus/formGenerator/lostPasswordFormGenerator.d.ts +4 -4
  57. package/types/libs/hephaestus/formGenerator/registrationFormGenerator.d.ts +7 -7
  58. package/types/libs/hephaestus/hephaestus.d.ts +3 -3
  59. package/types/libs/hephaestus/inputGenerator/dropZoneGenerator.d.ts +48 -48
  60. package/types/libs/hephaestus/inputGenerator/inputGenerator.d.ts +185 -185
  61. package/types/libs/hephaestus/inputGenerator/richTextGenerator.d.ts +49 -49
  62. package/types/libs/hephaestus/modalGenerator/modalGenerator.d.ts +2 -2
  63. package/types/libs/hephaestus/navigationGenerator/navigationGenerator.d.ts +150 -150
  64. package/types/libs/hephaestus/router/matchRoute.d.ts +12 -12
  65. package/types/libs/hephaestus/router/router.d.ts +67 -67
  66. package/types/libs/hephaestus/tableGenerator/tableGenerator.d.ts +120 -120
  67. package/types/menu.d.ts +1 -1
  68. package/types/navigation.d.ts +1 -1
  69. package/types/res/themes/themes.d.ts +7 -7
  70. package/types/router.d.ts +1 -1
  71. package/types/sanitize.d.ts +1 -1
  72. package/types/session.d.ts +3 -3
  73. package/types/table.d.ts +1 -1
  74. package/types/testing.d.ts +27 -27
  75. package/types/theme.d.ts +2 -2
  76. package/types/validation.d.ts +1 -1
@@ -1,12 +1,12 @@
1
- /**
2
- * Converts rows to CSV text (RFC 4180 quoting, CRLF line ends).
3
- *
4
- * @param {{key: string, label?: string}[]} columns
5
- * @param {object[]} rows
6
- * @param {string} [separator=","]
7
- */
8
- export function toCsv(columns: {
9
- key: string;
10
- label?: string;
11
- }[], rows: object[], separator?: string): string;
12
- export function downloadFile(filename: any, text: any, type?: string): void;
1
+ /**
2
+ * Converts rows to CSV text (RFC 4180 quoting, CRLF line ends).
3
+ *
4
+ * @param {{key: string, label?: string}[]} columns
5
+ * @param {object[]} rows
6
+ * @param {string} [separator=","]
7
+ */
8
+ export function toCsv(columns: {
9
+ key: string;
10
+ label?: string;
11
+ }[], rows: object[], separator?: string): string;
12
+ export function downloadFile(filename: any, text: any, type?: string): void;
@@ -1,72 +1,72 @@
1
- /**
2
- * Internal: two native date inputs (from / to). The "to" picker starts at the chosen start date.
3
- * Values are ISO dates ("2026-01-31"), an empty date is "".
4
- */
5
- export function createDateRange(options?: {}): {
6
- element: HTMLElement;
7
- inputs: HTMLElement[];
8
- getValue: () => {
9
- from: any;
10
- to: any;
11
- };
12
- setValue: (value: any) => void;
13
- validate: () => any;
14
- };
15
- /** A Date as the value of a datetime-local input, in the local time of the person: "2026-11-19T10:30". */
16
- export function toLocalInput(date: any, seconds?: boolean): string;
17
- /** The value of a datetime-local input as a Date (local time), or null when it is empty or not valid. */
18
- export function fromLocalInput(value: any): Date;
19
- /**
20
- * Internal: two datetime-local inputs and a list of presets (last 15 minutes, hour, 24 hours, 7 days). Choosing a preset fills
21
- * both inputs; changing an input switches the preset to "Custom". A preset is remembered as a preset: getRange() works out
22
- * "now" when it is called, so a screen that refreshes asks again and gets the moving window.
23
- *
24
- * @param {object} options
25
- * @param {string} [options.id]
26
- * @param {string} [options.from] initial start (datetime-local value)
27
- * @param {string} [options.to] initial end
28
- * @param {string} [options.preset] id of the preset to start with
29
- * @param {object[]} [options.presets] default DEFAULT_RANGE_PRESETS; { id, label | labelKey, minutes }
30
- * @param {boolean} [options.seconds=false] the inputs ask for seconds too
31
- * @param {string} [options.min]
32
- * @param {string} [options.max]
33
- * @param {boolean} [options.disabled]
34
- * @param {(value: {from: string, to: string, preset: string}) => void} [options.onChange]
35
- */
36
- export function createDateTimeRange(options?: {
37
- id?: string;
38
- from?: string;
39
- to?: string;
40
- preset?: string;
41
- presets?: object[];
42
- seconds?: boolean;
43
- min?: string;
44
- max?: string;
45
- disabled?: boolean;
46
- onChange?: (value: {
47
- from: string;
48
- to: string;
49
- preset: string;
50
- }) => void;
51
- }): {
52
- element: HTMLElement;
53
- inputs: HTMLElement[];
54
- getValue: () => {
55
- from: any;
56
- to: any;
57
- preset: string;
58
- };
59
- setValue: (value: any) => void;
60
- /** The range as Dates: a preset is measured from now (when this is called), a custom range is what the inputs hold. */
61
- getRange(): {
62
- from: Date;
63
- to: Date;
64
- };
65
- validate: () => any;
66
- };
67
- /** The presets of generateDateTimeRange: a name, and how far back from now they reach. */
68
- export const DEFAULT_RANGE_PRESETS: {
69
- id: string;
70
- labelKey: string;
71
- minutes: number;
72
- }[];
1
+ /**
2
+ * Internal: two native date inputs (from / to). The "to" picker starts at the chosen start date.
3
+ * Values are ISO dates ("2026-01-31"), an empty date is "".
4
+ */
5
+ export function createDateRange(options?: {}): {
6
+ element: HTMLElement;
7
+ inputs: HTMLElement[];
8
+ getValue: () => {
9
+ from: any;
10
+ to: any;
11
+ };
12
+ setValue: (value: any) => void;
13
+ validate: () => any;
14
+ };
15
+ /** A Date as the value of a datetime-local input, in the local time of the person: "2026-11-19T10:30". */
16
+ export function toLocalInput(date: any, seconds?: boolean): string;
17
+ /** The value of a datetime-local input as a Date (local time), or null when it is empty or not valid. */
18
+ export function fromLocalInput(value: any): Date;
19
+ /**
20
+ * Internal: two datetime-local inputs and a list of presets (last 15 minutes, hour, 24 hours, 7 days). Choosing a preset fills
21
+ * both inputs; changing an input switches the preset to "Custom". A preset is remembered as a preset: getRange() works out
22
+ * "now" when it is called, so a screen that refreshes asks again and gets the moving window.
23
+ *
24
+ * @param {object} options
25
+ * @param {string} [options.id]
26
+ * @param {string} [options.from] initial start (datetime-local value)
27
+ * @param {string} [options.to] initial end
28
+ * @param {string} [options.preset] id of the preset to start with
29
+ * @param {object[]} [options.presets] default DEFAULT_RANGE_PRESETS; { id, label | labelKey, minutes }
30
+ * @param {boolean} [options.seconds=false] the inputs ask for seconds too
31
+ * @param {string} [options.min]
32
+ * @param {string} [options.max]
33
+ * @param {boolean} [options.disabled]
34
+ * @param {(value: {from: string, to: string, preset: string}) => void} [options.onChange]
35
+ */
36
+ export function createDateTimeRange(options?: {
37
+ id?: string;
38
+ from?: string;
39
+ to?: string;
40
+ preset?: string;
41
+ presets?: object[];
42
+ seconds?: boolean;
43
+ min?: string;
44
+ max?: string;
45
+ disabled?: boolean;
46
+ onChange?: (value: {
47
+ from: string;
48
+ to: string;
49
+ preset: string;
50
+ }) => void;
51
+ }): {
52
+ element: HTMLElement;
53
+ inputs: HTMLElement[];
54
+ getValue: () => {
55
+ from: any;
56
+ to: any;
57
+ preset: string;
58
+ };
59
+ setValue: (value: any) => void;
60
+ /** The range as Dates: a preset is measured from now (when this is called), a custom range is what the inputs hold. */
61
+ getRange(): {
62
+ from: Date;
63
+ to: Date;
64
+ };
65
+ validate: () => any;
66
+ };
67
+ /** The presets of generateDateTimeRange: a name, and how far back from now they reach. */
68
+ export const DEFAULT_RANGE_PRESETS: {
69
+ id: string;
70
+ labelKey: string;
71
+ minutes: number;
72
+ }[];
@@ -1,65 +1,65 @@
1
- /**
2
- * Creates an element. This is the safe way to write pages: text is only ever inserted as text, attributes that run code
3
- * (on*, style, srcdoc) and unsafe addresses (javascript:, data:, ...) in href / src / action are refused, listeners have to be
4
- * functions, and children can be given as nested lists.
5
- *
6
- * @param {string} tag
7
- * @param {object} [props]
8
- * @param {string} [props.class]
9
- * @param {string} [props.id]
10
- * @param {string} [props.text] set as textContent (never parsed as HTML)
11
- * @param {Object<string, string|boolean|number>} [props.attrs] attributes, false / null / undefined are skipped
12
- * @param {Object<string, Function>} [props.on] event listeners (a value that is not a function throws a TypeError)
13
- * @param {Object<string, *>} [props.prop] DOM properties (value, checked, disabled, ...), not the ones that parse HTML
14
- * @param {...(Node|string|number|Array|null|false)} children text, nodes, or lists of them
15
- */
16
- export function el(tag: string, props?: {
17
- class?: string;
18
- id?: string;
19
- text?: string;
20
- attrs?: {
21
- [x: string]: string | boolean | number;
22
- };
23
- on?: {
24
- [x: string]: Function;
25
- };
26
- prop?: {
27
- [x: string]: any;
28
- };
29
- }, ...children: (Node | string | number | any[] | null | false)[]): HTMLElement;
30
- /**
31
- * Fills a node with content. Strings are inserted as text, never as HTML.
32
- * Accepts a string / number, a Node, an array of those, or a function returning one.
33
- */
34
- export function setContent(node: any, content: any): any;
35
- /**
36
- * Finds an element from an element, an id or a CSS selector ("#list", ".panel > ul").
37
- * An id wins over a selector with the same text. Returns null when nothing matches.
38
- */
39
- export function resolveElement(target: any): Element;
40
- export function mount(parent: any, node: any): any;
41
- /**
42
- * Gives a component the same handle as every other one: { element, update(), destroy() }.
43
- * What the component already has is kept. `update` does nothing unless the component supports it
44
- * (it returns the handle), `destroy` removes the element (and `also`, e.g. a wrapper around it).
45
- */
46
- export function asHandle(handle: any, { element, also }?: {
47
- element?: any;
48
- }): any;
49
- /**
50
- * A stricter el(): only the tags and attributes on your lists are allowed, everything else is refused (a tag throws, an attribute is
51
- * skipped with a warning). For pages that are built from data you do not control, such as a plugin API. The refusals of el() still apply.
52
- *
53
- * @param {object} allow
54
- * @param {string[]} [allow.tags] allowed tag names (default: any)
55
- * @param {string[]} allow.attributes allowed attribute names, lower case: ["class", "title", "href"]
56
- * @param {boolean} [allow.dataAndAria=true] data-* and aria-* attributes are allowed too
57
- * @returns {typeof el}
58
- */
59
- export function createSafeBuilder({ tags, attributes, dataAndAria }?: {
60
- tags?: string[];
61
- attributes: string[];
62
- dataAndAria?: boolean;
63
- }): typeof el;
64
- export function uid(prefix?: string): string;
65
- export function cx(...classes: any[]): string;
1
+ /**
2
+ * Creates an element. This is the safe way to write pages: text is only ever inserted as text, attributes that run code
3
+ * (on*, style, srcdoc) and unsafe addresses (javascript:, data:, ...) in href / src / action are refused, listeners have to be
4
+ * functions, and children can be given as nested lists.
5
+ *
6
+ * @param {string} tag
7
+ * @param {object} [props]
8
+ * @param {string} [props.class]
9
+ * @param {string} [props.id]
10
+ * @param {string} [props.text] set as textContent (never parsed as HTML)
11
+ * @param {Object<string, string|boolean|number>} [props.attrs] attributes, false / null / undefined are skipped
12
+ * @param {Object<string, Function>} [props.on] event listeners (a value that is not a function throws a TypeError)
13
+ * @param {Object<string, *>} [props.prop] DOM properties (value, checked, disabled, ...), not the ones that parse HTML
14
+ * @param {...(Node|string|number|Array|null|false)} children text, nodes, or lists of them
15
+ */
16
+ export function el(tag: string, props?: {
17
+ class?: string;
18
+ id?: string;
19
+ text?: string;
20
+ attrs?: {
21
+ [x: string]: string | boolean | number;
22
+ };
23
+ on?: {
24
+ [x: string]: Function;
25
+ };
26
+ prop?: {
27
+ [x: string]: any;
28
+ };
29
+ }, ...children: (Node | string | number | any[] | null | false)[]): HTMLElement;
30
+ /**
31
+ * Fills a node with content. Strings are inserted as text, never as HTML.
32
+ * Accepts a string / number, a Node, an array of those, or a function returning one.
33
+ */
34
+ export function setContent(node: any, content: any): any;
35
+ /**
36
+ * Finds an element from an element, an id or a CSS selector ("#list", ".panel > ul").
37
+ * An id wins over a selector with the same text. Returns null when nothing matches.
38
+ */
39
+ export function resolveElement(target: any): Element;
40
+ export function mount(parent: any, node: any): any;
41
+ /**
42
+ * Gives a component the same handle as every other one: { element, update(), destroy() }.
43
+ * What the component already has is kept. `update` does nothing unless the component supports it
44
+ * (it returns the handle), `destroy` removes the element (and `also`, e.g. a wrapper around it).
45
+ */
46
+ export function asHandle(handle: any, { element, also }?: {
47
+ element?: any;
48
+ }): any;
49
+ /**
50
+ * A stricter el(): only the tags and attributes on your lists are allowed, everything else is refused (a tag throws, an attribute is
51
+ * skipped with a warning). For pages that are built from data you do not control, such as a plugin API. The refusals of el() still apply.
52
+ *
53
+ * @param {object} allow
54
+ * @param {string[]} [allow.tags] allowed tag names (default: any)
55
+ * @param {string[]} allow.attributes allowed attribute names, lower case: ["class", "title", "href"]
56
+ * @param {boolean} [allow.dataAndAria=true] data-* and aria-* attributes are allowed too
57
+ * @returns {typeof el}
58
+ */
59
+ export function createSafeBuilder({ tags, attributes, dataAndAria }?: {
60
+ tags?: string[];
61
+ attributes: string[];
62
+ dataAndAria?: boolean;
63
+ }): typeof el;
64
+ export function uid(prefix?: string): string;
65
+ export function cx(...classes: any[]): string;
@@ -1,30 +1,30 @@
1
- /**
2
- * Generates an HTML element and appends it to its parent.
3
- *
4
- * @param {object} options
5
- * @param {string} options.elementType one of `supportedElements`
6
- * @param {string} [options.parent] id of the parent element; omitted or '' appends to body
7
- * @param {string} [options.id]
8
- * @param {string} [options.class]
9
- * @param {string} [options.text]
10
- * @param {string} [options.src] img only
11
- * @param {string} [options.alt] img only
12
- * @param {*} [options.data] passed to the onclick / onchange handlers
13
- * @param {(data: *) => void} [options.onclick]
14
- * @param {(data: *) => void} [options.onchange]
15
- * @returns {HTMLElement|null} the generated element, or null when generation failed
16
- */
17
- export function HTMLElementGenerator(options: {
18
- elementType: string;
19
- parent?: string;
20
- id?: string;
21
- class?: string;
22
- text?: string;
23
- src?: string;
24
- alt?: string;
25
- data?: any;
26
- onclick?: (data: any) => void;
27
- onchange?: (data: any) => void;
28
- }): HTMLElement | null;
29
- export const supportedElements: readonly string[];
30
- export default HTMLElementGenerator;
1
+ /**
2
+ * Generates an HTML element and appends it to its parent.
3
+ *
4
+ * @param {object} options
5
+ * @param {string} options.elementType one of `supportedElements`
6
+ * @param {string} [options.parent] id of the parent element; omitted or '' appends to body
7
+ * @param {string} [options.id]
8
+ * @param {string} [options.class]
9
+ * @param {string} [options.text]
10
+ * @param {string} [options.src] img only
11
+ * @param {string} [options.alt] img only
12
+ * @param {*} [options.data] passed to the onclick / onchange handlers
13
+ * @param {(data: *) => void} [options.onclick]
14
+ * @param {(data: *) => void} [options.onchange]
15
+ * @returns {HTMLElement|null} the generated element, or null when generation failed
16
+ */
17
+ export function HTMLElementGenerator(options: {
18
+ elementType: string;
19
+ parent?: string;
20
+ id?: string;
21
+ class?: string;
22
+ text?: string;
23
+ src?: string;
24
+ alt?: string;
25
+ data?: any;
26
+ onclick?: (data: any) => void;
27
+ onchange?: (data: any) => void;
28
+ }): HTMLElement | null;
29
+ export const supportedElements: readonly string[];
30
+ export default HTMLElementGenerator;
@@ -1,29 +1,29 @@
1
- /**
2
- * Logs the error and, when the page has a body, shows a short message in it.
3
- * Always returns null so callers can `return reportError(...)`.
4
- */
5
- export function reportError(error: any): any;
6
- export const ErrorCode: Readonly<{
7
- UNDEFINED: 0;
8
- WRONG_INPUT_TYPE: 1;
9
- NO_BODY_OR_PARENT: 2;
10
- }>;
11
- export function undefinedError(variable: any, functionName: any): {
12
- errorCode: 0;
13
- errorString: string;
14
- errorVariable: any;
15
- errorFunction: any;
16
- };
17
- export function wrongInputTypeError(variable: any, functionName: any, inputOptions: any): {
18
- errorCode: 1;
19
- errorString: string;
20
- errorVariable: any;
21
- errorFunction: any;
22
- errorMiscInfo: any;
23
- };
24
- export function noBodyOrParentError(variable: any, functionName: any): {
25
- errorCode: 2;
26
- errorString: string;
27
- errorVariable: any;
28
- errorFunction: any;
29
- };
1
+ /**
2
+ * Logs the error and, when the page has a body, shows a short message in it.
3
+ * Always returns null so callers can `return reportError(...)`.
4
+ */
5
+ export function reportError(error: any): any;
6
+ export const ErrorCode: Readonly<{
7
+ UNDEFINED: 0;
8
+ WRONG_INPUT_TYPE: 1;
9
+ NO_BODY_OR_PARENT: 2;
10
+ }>;
11
+ export function undefinedError(variable: any, functionName: any): {
12
+ errorCode: 0;
13
+ errorString: string;
14
+ errorVariable: any;
15
+ errorFunction: any;
16
+ };
17
+ export function wrongInputTypeError(variable: any, functionName: any, inputOptions: any): {
18
+ errorCode: 1;
19
+ errorString: string;
20
+ errorVariable: any;
21
+ errorFunction: any;
22
+ errorMiscInfo: any;
23
+ };
24
+ export function noBodyOrParentError(variable: any, functionName: any): {
25
+ errorCode: 2;
26
+ errorString: string;
27
+ errorVariable: any;
28
+ errorFunction: any;
29
+ };
@@ -1,6 +1,6 @@
1
- export function focusableIn(container: any): any[];
2
- /**
3
- * Keeps Tab inside the container, calls onEscape on Esc and moves the focus into the container.
4
- * Returns a release function that restores the previous focus.
5
- */
6
- export function trapFocus(container: any, { onEscape }?: {}): () => void;
1
+ export function focusableIn(container: any): any[];
2
+ /**
3
+ * Keeps Tab inside the container, calls onEscape on Esc and moves the focus into the container.
4
+ * Returns a release function that restores the previous focus.
5
+ */
6
+ export function trapFocus(container: any, { onEscape }?: {}): () => void;
@@ -1,21 +1,21 @@
1
- export function formatBytes(bytes: any): string;
2
- /**
3
- * Checks a file against an `accept` list like ".png,image/*,application/pdf". An empty list accepts everything.
4
- */
5
- export function matchesAccept(file: any, accept: any): boolean;
6
- /** 1234567.891 -> "1,234,567.89" (the separators of the current language). */
7
- export function formatNumber(value: any, options?: {}): string;
8
- /**
9
- * A length of time in milliseconds as short text: 350 -> "350 ms", 45000 -> "45 sec", 7500000 -> "2 hr, 5 min".
10
- * At most `parts` units are shown (default 2). The unit names follow the current language.
11
- */
12
- export function formatDuration(ms: any, { parts }?: {
13
- parts?: number;
14
- }): string;
15
- /** "2 min ago", "in 3 days", "yesterday": the time between `date` and `now`, in the current language. */
16
- export function formatRelativeTime(date: any, now?: number): string;
17
- /** A date (and time) for people: formatDate(d) -> "Nov 19, 2026"; formatDate(d, { time: true }) adds the time. */
18
- export function formatDate(date: any, { time, style }?: {
19
- time?: boolean;
20
- style?: string;
21
- }): string;
1
+ export function formatBytes(bytes: any): string;
2
+ /**
3
+ * Checks a file against an `accept` list like ".png,image/*,application/pdf". An empty list accepts everything.
4
+ */
5
+ export function matchesAccept(file: any, accept: any): boolean;
6
+ /** 1234567.891 -> "1,234,567.89" (the separators of the current language). */
7
+ export function formatNumber(value: any, options?: {}): string;
8
+ /**
9
+ * A length of time in milliseconds as short text: 350 -> "350 ms", 45000 -> "45 sec", 7500000 -> "2 hr, 5 min".
10
+ * At most `parts` units are shown (default 2). The unit names follow the current language.
11
+ */
12
+ export function formatDuration(ms: any, { parts }?: {
13
+ parts?: number;
14
+ }): string;
15
+ /** "2 min ago", "in 3 days", "yesterday": the time between `date` and `now`, in the current language. */
16
+ export function formatRelativeTime(date: any, now?: number): string;
17
+ /** A date (and time) for people: formatDate(d) -> "Nov 19, 2026"; formatDate(d, { time: true }) adds the time. */
18
+ export function formatDate(date: any, { time, style }?: {
19
+ time?: boolean;
20
+ style?: string;
21
+ }): string;
@@ -1,2 +1,2 @@
1
- /** Adds the input types hunPIN, hunCRID and hunTID (Hungarian personal insurance, company registration and tax numbers, in segments). */
2
- export function registerHungarianInputControls(): void;
1
+ /** Adds the input types hunPIN, hunCRID and hunTID (Hungarian personal insurance, company registration and tax numbers, in segments). */
2
+ export function registerHungarianInputControls(): void;
@@ -1,17 +1,17 @@
1
- export function setLocale(newLocale: any): void;
2
- export function getLocale(): string;
3
- export function addMessages(forLocale: any, texts: any): void;
4
- /**
5
- * Looks a text up in the current locale, then in its base language ("hu-HU" -> "hu"), then in English.
6
- * Unknown keys are returned as they are.
7
- *
8
- * Placeholders: {name} is replaced from params as it is, {name:number} is formatted as a number and {name:date} as a date, in the current language (Intl).
9
- * Plural forms: a message can be an object with the forms of the language, and the form is chosen by `params.count`:
10
- *
11
- * addMessages("en", { files: { zero: "No files", one: "{count} file", other: "{count:number} files" } });
12
- * translate("files", { count: 1200 }) // "1,200 files"
13
- *
14
- * The keys are the categories of Intl.PluralRules for the language ("one", "other", and where the language has them "zero", "two", "few", "many"),
15
- * or an exact number ("0"). "other" is the fallback.
16
- */
17
- export function translate(key: any, params?: {}): any;
1
+ export function setLocale(newLocale: any): void;
2
+ export function getLocale(): string;
3
+ export function addMessages(forLocale: any, texts: any): void;
4
+ /**
5
+ * Looks a text up in the current locale, then in its base language ("hu-HU" -> "hu"), then in English.
6
+ * Unknown keys are returned as they are.
7
+ *
8
+ * Placeholders: {name} is replaced from params as it is, {name:number} is formatted as a number and {name:date} as a date, in the current language (Intl).
9
+ * Plural forms: a message can be an object with the forms of the language, and the form is chosen by `params.count`:
10
+ *
11
+ * addMessages("en", { files: { zero: "No files", one: "{count} file", other: "{count:number} files" } });
12
+ * translate("files", { count: 1200 }) // "1,200 files"
13
+ *
14
+ * The keys are the categories of Intl.PluralRules for the language ("one", "other", and where the language has them "zero", "two", "few", "many"),
15
+ * or an exact number ("0"). "other" is the fallback.
16
+ */
17
+ export function translate(key: any, params?: {}): any;
@@ -1,5 +1,5 @@
1
- /**
2
- * Page buttons to show: first and last page, the current page with its neighbours, "…" for the gaps.
3
- * pageRange(5, 10, 1) -> [1, "…", 4, 5, 6, "…", 10]
4
- */
5
- export function pageRange(page: any, pages: any, siblings?: number): any[];
1
+ /**
2
+ * Page buttons to show: first and last page, the current page with its neighbours, "…" for the gaps.
3
+ * pageRange(5, 10, 1) -> [1, "…", 4, 5, 6, "…", 10]
4
+ */
5
+ export function pageRange(page: any, pages: any, siblings?: number): any[];
@@ -1,6 +1,6 @@
1
- /** True for http(s), mailto, tel, anchors and relative paths. Rejects javascript:, data:, vbscript: and the like. */
2
- export function isSafeUrl(url: any): boolean;
3
- /** Cleans HTML from the editor, the clipboard or the application. Returns the safe HTML string. */
4
- export function sanitizeHtml(html: any): string;
5
- /** The text of an HTML string, without tags. */
6
- export function htmlToText(html: any): string;
1
+ /** True for http(s), mailto, tel, anchors and relative paths. Rejects javascript:, data:, vbscript: and the like. */
2
+ export function isSafeUrl(url: any): boolean;
3
+ /** Cleans HTML from the editor, the clipboard or the application. Returns the safe HTML string. */
4
+ export function sanitizeHtml(html: any): string;
5
+ /** The text of an HTML string, without tags. */
6
+ export function htmlToText(html: any): string;
@@ -1,26 +1,26 @@
1
- /**
2
- * Which rows of a long list have to be in the DOM for the current scroll position.
3
- * The rows before and after the window are replaced by spacers of `offsetTop` / `offsetBottom` pixels,
4
- * so the scroll bar keeps the size of the whole list.
5
- *
6
- * @param {object} options
7
- * @param {number} options.scrollTop
8
- * @param {number} options.viewportHeight
9
- * @param {number} options.rowHeight
10
- * @param {number} options.total number of rows
11
- * @param {number} [options.overscan=5] extra rows above and below, so fast scrolling does not show gaps
12
- * @returns {{start: number, end: number, offsetTop: number, offsetBottom: number}} rows start..end-1 are rendered
13
- */
14
- export function virtualWindow({ scrollTop, viewportHeight, rowHeight, total, overscan }: {
15
- scrollTop: number;
16
- viewportHeight: number;
17
- rowHeight: number;
18
- total: number;
19
- overscan?: number;
20
- }): {
21
- start: number;
22
- end: number;
23
- offsetTop: number;
24
- offsetBottom: number;
25
- };
26
- export function clampWidth(width: any, min?: number, max?: number): number;
1
+ /**
2
+ * Which rows of a long list have to be in the DOM for the current scroll position.
3
+ * The rows before and after the window are replaced by spacers of `offsetTop` / `offsetBottom` pixels,
4
+ * so the scroll bar keeps the size of the whole list.
5
+ *
6
+ * @param {object} options
7
+ * @param {number} options.scrollTop
8
+ * @param {number} options.viewportHeight
9
+ * @param {number} options.rowHeight
10
+ * @param {number} options.total number of rows
11
+ * @param {number} [options.overscan=5] extra rows above and below, so fast scrolling does not show gaps
12
+ * @returns {{start: number, end: number, offsetTop: number, offsetBottom: number}} rows start..end-1 are rendered
13
+ */
14
+ export function virtualWindow({ scrollTop, viewportHeight, rowHeight, total, overscan }: {
15
+ scrollTop: number;
16
+ viewportHeight: number;
17
+ rowHeight: number;
18
+ total: number;
19
+ overscan?: number;
20
+ }): {
21
+ start: number;
22
+ end: number;
23
+ offsetTop: number;
24
+ offsetBottom: number;
25
+ };
26
+ export function clampWidth(width: any, min?: number, max?: number): number;