| 1519 | * Use the {@link AutoNumeric.global} property to access the handler that provides methods to modify all linked elements. |
| 1520 | */ |
| 1521 | export interface AutoNumericGlobal { |
| 1522 | /** |
| 1523 | * Add an existing AutoNumeric object (or DOM element) to the local AutoNumeric element list, using the DOM element as the key. |
| 1524 | * This manages the case where `addObject` is used on an AutoNumeric object that already has multiple elements in its local list. |
| 1525 | * @param element The AutoNumeric element to add. |
| 1526 | */ |
| 1527 | readonly addObject: (element: HTMLElement | AutoNumeric) => void; |
| 1528 | |
| 1529 | /** |
| 1530 | * Execute the {@link AutoNumeric.prototype.clear} method on each AutoNumeric object in the local AutoNumeric element list |
| 1531 | * |
| 1532 | * @param forceClearAll `true` to clear the the entire input, including the currency sign. |
| 1533 | */ |
| 1534 | readonly clear: (forceClearAll?: boolean) => void; |
| 1535 | |
| 1536 | /** |
| 1537 | * Gets an array containing all the AutoNumeric DOM elements that have been initialized by each other. |
| 1538 | * @returns An array with all AutoNumeric DOM elements. |
| 1539 | */ |
| 1540 | readonly elements: () => HTMLElement[]; |
| 1541 | |
| 1542 | /** |
| 1543 | * Remove all elements from the shared list, effectively emptying it. |
| 1544 | * This is the equivalent of calling {@link AutoNumeric.detach} on each of its elements. |
| 1545 | * @param keepEachAnObjectInItsOwnList If set to `true`, then instead of completely emptying the local list |
| 1546 | * of each AutoNumeric objects, each one of those keeps itself in its own local list. |
| 1547 | */ |
| 1548 | readonly empty: (keepEachAnObjectInItsOwnList?: boolean) => void; |
| 1549 | |
| 1550 | // The get() function is deprecated and should not be used. Omitted from TS def for that reason. |
| 1551 | |
| 1552 | /** |
| 1553 | * Gets a map containing all the AutoNumeric DOM elements that have been initialized by each other. |
| 1554 | * The key is the DOM element, the value the corresponding AutoNumeric instance. |
| 1555 | * @returns A map with all AutoNumeric instances. |
| 1556 | */ |
| 1557 | readonly getList: () => Map<HTMLElement, AutoNumeric>; |
| 1558 | |
| 1559 | /** |
| 1560 | * Execute the {@link AutoNumeric.prototype.getNumericString} method on each AutoNumeric object in the local AutoNumeric element list. |
| 1561 | * |
| 1562 | * Return an array of the unformatted values of each AutoNumeric element of the local AutoNumeric element list |
| 1563 | * This can also return `null` if `rawValue` is null. |
| 1564 | * @param callback Optional callback that, when given, is called with the value and the AutoNumeric instance. |
| 1565 | * @returns The numeric value for each linked AutoNumeric instance. |
| 1566 | */ |
| 1567 | readonly getNumericString: (callback?: GetValueCallback<Array<string | null>> | null) => Array<string | null>; |
| 1568 | |
| 1569 | /** |
| 1570 | * Execute the {@link AutoNumeric.prototype.getFormatted} method on each AutoNumeric object in the local AutoNumeric element list. |
| 1571 | * |
| 1572 | * Return an array of the current formatted values of each AutoNumeric element of the local AutoNumeric element list |
| 1573 | * @param callback Optional callback that, when given, is called with the value and the AutoNumeric instance. |
| 1574 | * @returns The formatted value for each linked AutoNumeric instance. |
| 1575 | */ |
| 1576 | readonly getFormatted: ( |
| 1577 | callback?: GetValueCallback<Array<string>> | null |
| 1578 | ) => Array<string>; |
nothing calls this directly
no outgoing calls
no test coverage detected