usemods-nuxt 0.0.12 → 0.0.21

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/module.json CHANGED
@@ -1,5 +1,9 @@
1
1
  {
2
2
  "name": "usemods",
3
3
  "configKey": "usemods",
4
- "version": "0.0.12"
4
+ "version": "0.0.21",
5
+ "builder": {
6
+ "@nuxt/module-builder": "0.6.0",
7
+ "unbuild": "2.0.0"
8
+ }
5
9
  }
package/dist/module.mjs CHANGED
@@ -1,5 +1,4 @@
1
- import { defineNuxtModule, createResolver, addImportsSources, addPlugin } from '@nuxt/kit';
2
- import * as utils from 'usemods';
1
+ import { defineNuxtModule, createResolver, addImportsDir, addPlugin } from '@nuxt/kit';
3
2
 
4
3
  const module = defineNuxtModule({
5
4
  meta: {
@@ -12,19 +11,7 @@ const module = defineNuxtModule({
12
11
  },
13
12
  setup(options, nuxt) {
14
13
  const { resolve } = createResolver(import.meta.url);
15
- const aliasMap = new Map(options.alias);
16
- const imports = [];
17
- for (const name of Object.keys(utils)) {
18
- const alias = aliasMap.has(name) ? aliasMap.get(name) : name;
19
- imports.push({
20
- name,
21
- alias
22
- });
23
- }
24
- addImportsSources({
25
- from: "usemods",
26
- imports
27
- });
14
+ addImportsDir(resolve("./runtime/utils"));
28
15
  addPlugin(resolve("./runtime/plugin"));
29
16
  }
30
17
  });
@@ -1,2 +1,2 @@
1
- declare const _default: any;
1
+ declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
2
  export default _default;
@@ -1,3 +1,4 @@
1
1
  import { defineNuxtPlugin } from "#app";
2
- export default defineNuxtPlugin((nuxtApp) => {
2
+ export default defineNuxtPlugin(() => {
3
+ console.debug("mods injected by use-mods!");
3
4
  });
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Smoothly scrolls to the element with the specified ID without scuffing up your URLs.
3
+ */
4
+ export declare function scrollToAnchor(id: string): Promise<void>;
5
+ /**
6
+ * Toggles the body scroll with specified class names and returns a promise
7
+ */
8
+ export declare function toggleBodyScroll(className?: string): Promise<void>;
9
+ /**
10
+ * Toggles the element scroll with specified class names and returns a promise
11
+ */
12
+ export declare function toggleElementScroll(element: HTMLElement): Promise<void>;
13
+ /**
14
+ * Copies a convereted string to the clipboard
15
+ */
16
+ export declare function copyToClipboard(value: string | number): Promise<void>;
17
+ /**
18
+ * Toggles the fullscreen mode
19
+ */
20
+ export declare function toggleFullScreen(): Promise<void>;
21
+ /**
22
+ * Resets a form to its initial state
23
+ */
24
+ export declare function resetForm(form: HTMLFormElement): Promise<void>;
25
+ /**
26
+ * Focuses on and scrolls to the first invalid input, select, or textarea element within a form.
27
+ */
28
+ export declare function focusOnInvalid(container: HTMLElement): Promise<void>;
29
+ /**
30
+ * Focuses on the nth element within the specified form, where 0 is the first element and -1 is the last element.
31
+ */
32
+ export declare function focusOnNth(container: HTMLElement, index?: number): Promise<void>;
33
+ /**
34
+ * Sets up a keyboard trap within an HTML element, allowing the focus to cycle between the first and last focusable elements when the Tab key is pressed.
35
+ */
36
+ export declare function focusTrap(container: HTMLElement): void;
@@ -0,0 +1,129 @@
1
+ export function scrollToAnchor(id) {
2
+ return new Promise((resolve, reject) => {
3
+ setTimeout(() => {
4
+ const selector = `#${id}`;
5
+ const element = document.querySelector(selector);
6
+ if (!element) {
7
+ reject(`Element with id '${id}' not found.`);
8
+ return;
9
+ }
10
+ element.scrollIntoView({
11
+ behavior: "smooth",
12
+ block: "start"
13
+ });
14
+ resolve();
15
+ }, 180);
16
+ });
17
+ }
18
+ export function toggleBodyScroll(className = "fixed") {
19
+ return new Promise((resolve, reject) => {
20
+ try {
21
+ const body = document.body;
22
+ const isFixed = body.classList.contains(className);
23
+ const scrollY = isFixed ? parseInt(body.style.top, 10) : window.scrollY;
24
+ body.style.top = isFixed ? "" : `-${scrollY}px`;
25
+ body.classList.toggle(className, !isFixed);
26
+ if (isFixed)
27
+ window.scrollTo(0, -scrollY);
28
+ resolve();
29
+ } catch (error) {
30
+ reject(error);
31
+ }
32
+ });
33
+ }
34
+ export function toggleElementScroll(element) {
35
+ return new Promise((resolve, reject) => {
36
+ if (element.dataset.isScrollLocked === "true") {
37
+ element.style.overflow = "";
38
+ delete element.dataset.isScrollLocked;
39
+ } else {
40
+ element.style.overflow = "hidden";
41
+ element.dataset.isScrollLocked = "true";
42
+ }
43
+ resolve();
44
+ });
45
+ }
46
+ export function copyToClipboard(value) {
47
+ if (!navigator.clipboard || !navigator.clipboard.writeText) {
48
+ return Promise.reject("Clipboard API is not available");
49
+ }
50
+ return navigator.clipboard.writeText(String(value)).catch((error) => {
51
+ console.error("Failed to copy text: ", error);
52
+ throw error;
53
+ });
54
+ }
55
+ export function toggleFullScreen() {
56
+ return new Promise((resolve, reject) => {
57
+ if (document.fullscreenElement) {
58
+ document.exitFullscreen().then(resolve).catch(reject);
59
+ } else {
60
+ document.documentElement.requestFullscreen().then(resolve).catch(reject);
61
+ }
62
+ });
63
+ }
64
+ export function resetForm(form) {
65
+ return new Promise((resolve, reject) => {
66
+ try {
67
+ form.reset();
68
+ resolve();
69
+ } catch (error) {
70
+ reject(error);
71
+ }
72
+ });
73
+ }
74
+ export function focusOnInvalid(container) {
75
+ return new Promise((resolve, reject) => {
76
+ try {
77
+ const input = container.querySelector("input:invalid, select:invalid, textarea:invalid");
78
+ if (input) {
79
+ input.focus();
80
+ input.scrollIntoView({ behavior: "smooth", block: "center" });
81
+ }
82
+ resolve();
83
+ } catch (error) {
84
+ reject(error);
85
+ }
86
+ });
87
+ }
88
+ export function focusOnNth(container, index = 0) {
89
+ return new Promise((resolve, reject) => {
90
+ const elements = container.querySelectorAll("input, textarea, select");
91
+ const elementIndex = index === -1 ? elements.length - 1 : index;
92
+ if (elementIndex < 0 || elementIndex >= elements.length) {
93
+ return reject(new Error(`Element at index ${index} is out of bounds.`));
94
+ }
95
+ const element = elements[elementIndex];
96
+ if (!element || typeof element.focus !== "function") {
97
+ return reject(new Error("Failed to focus on the element."));
98
+ }
99
+ try {
100
+ element.focus({ preventScroll: true });
101
+ element.scrollIntoView({ behavior: "smooth", block: "center" });
102
+ resolve();
103
+ } catch (error) {
104
+ reject(new Error("Failed to focus on the element."));
105
+ }
106
+ });
107
+ }
108
+ export function focusTrap(container) {
109
+ const focusableElements = container.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select');
110
+ const firstFocusableElement = focusableElements[0];
111
+ const lastFocusableElement = focusableElements[focusableElements.length - 1];
112
+ const KEYCODE_TAB = 9;
113
+ container.addEventListener("keydown", (event) => {
114
+ const isTabPressed = event.key === "Tab" || event.keyCode === KEYCODE_TAB;
115
+ if (!isTabPressed)
116
+ return;
117
+ if (event.shiftKey) {
118
+ if (document.activeElement === firstFocusableElement) {
119
+ lastFocusableElement.focus();
120
+ event.preventDefault();
121
+ }
122
+ } else {
123
+ if (document.activeElement === lastFocusableElement) {
124
+ firstFocusableElement.focus();
125
+ event.preventDefault();
126
+ }
127
+ }
128
+ });
129
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Animate text by wrapping each character in a span with a delay.
3
+ */
4
+ export declare function animateText(text: string, options?: {
5
+ splitBy?: 'word' | 'character';
6
+ time?: number;
7
+ unit?: 'ms' | 's';
8
+ class?: string;
9
+ }): string;
10
+ /**
11
+ * Animate a group of elements by wrapping each in a span with an incremental delay.
12
+ */
@@ -0,0 +1,21 @@
1
+ export function animateText(text, options = {}) {
2
+ if (!text)
3
+ return "";
4
+ const { splitBy = "character", time = 0.1, unit = "s", class: cssClass = "" } = options;
5
+ const delimiter = splitBy === "word" ? " " : "";
6
+ const elements = text.split(delimiter);
7
+ const result = elements.map((element, index) => {
8
+ const delay = `${index * time}${unit}`;
9
+ const spanStyle = `display: inline-block; position: relative;`;
10
+ const translateStyle = `position: absolute; top: 0; left: 0; animation-delay: ${delay};`;
11
+ if (element === " " && splitBy === "character") {
12
+ return `<span class="space" style="white-space: pre;"> </span>`;
13
+ } else {
14
+ return `<span class="relative overflow-clip" style="${spanStyle}">
15
+ <span class="ghost" style="visibility: hidden;">${element}</span>
16
+ <span class="translate ${cssClass}" style="${translateStyle}">${element}</span>
17
+ </span>`;
18
+ }
19
+ });
20
+ return splitBy === "word" ? result.join(" ") : result.join("");
21
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Shuffles your data in a random order.
3
+ */
4
+ export declare function dataShuffle(items: object | any[]): any;
5
+ /**
6
+ * Reverse an array.
7
+ */
8
+ export declare function dataReverse(items: object | any[]): any;
9
+ /**
10
+ * Sort an array or object by a property.
11
+ */
12
+ export declare function dataSortBy(items: object | any[], options?: {
13
+ property?: string;
14
+ order?: 'asc' | 'desc';
15
+ }): any;
16
+ /**
17
+ * Returns single unique values within an array or object
18
+ */
19
+ export declare function dataRemoveDuplicates(...arrays: any[][]): any[];
20
+ /**
21
+ * Flatten an array of arrays or an object of objects into a single array or object. That was hard to say.
22
+ */
23
+ export declare function dataFlatten(items: object | any[]): object | any[];
24
+ /**
25
+ * Returns an array without a property or properties.
26
+ */
27
+ export declare function dataWithout(items: object | any[], properties: any | any[]): any;
@@ -0,0 +1,86 @@
1
+ import { isObject, isArray } from "./validators.mjs";
2
+ export function dataShuffle(items) {
3
+ if (!items || !(isObject(items) || isArray(items))) {
4
+ console.warn("[MODS] Warning: dataShuffle() expects an object or array as the first argument.");
5
+ return items;
6
+ }
7
+ const shuffleArray = (array) => {
8
+ let shuffled = false;
9
+ while (!shuffled) {
10
+ for (let i = array.length - 1; i > 0; i--) {
11
+ const j = Math.floor(Math.random() * (i + 1));
12
+ [array[i], array[j]] = [array[j], array[i]];
13
+ }
14
+ shuffled = !array.every((element, index) => {
15
+ if (Array.isArray(items))
16
+ return element === items[index];
17
+ return false;
18
+ });
19
+ }
20
+ return array;
21
+ };
22
+ if (isObject(items)) {
23
+ const entries = Object.entries(items);
24
+ return Object.fromEntries(shuffleArray(entries));
25
+ } else {
26
+ return shuffleArray([...items]);
27
+ }
28
+ }
29
+ export function dataReverse(items) {
30
+ if (!items || !(isObject(items) || isArray(items))) {
31
+ console.warn("[MODS] Warning: dataReverse() expects an object or array as the first argument.");
32
+ return items;
33
+ }
34
+ if (isObject(items)) {
35
+ const entries = Object.entries(items);
36
+ return Object.fromEntries(entries.reverse());
37
+ } else {
38
+ return items.reverse();
39
+ }
40
+ }
41
+ export function dataSortBy(items, options) {
42
+ const comparator = (a, b) => {
43
+ const property = options?.property;
44
+ const order = options?.order ?? "asc";
45
+ if (!property)
46
+ return 0;
47
+ if (a[property] < b[property])
48
+ return order === "asc" ? -1 : 1;
49
+ if (a[property] > b[property])
50
+ return order === "asc" ? 1 : -1;
51
+ return 0;
52
+ };
53
+ if (isObject(items)) {
54
+ const entries = Object.entries(items);
55
+ return Object.fromEntries(entries.sort((a, b) => comparator(a[1], b[1])));
56
+ } else {
57
+ return items.sort(comparator);
58
+ }
59
+ }
60
+ export function dataRemoveDuplicates(...arrays) {
61
+ const mergedArray = arrays.flat();
62
+ return mergedArray.filter((item, index) => mergedArray.indexOf(item) === index);
63
+ }
64
+ export function dataFlatten(items) {
65
+ if (isObject(items)) {
66
+ const flattened = {};
67
+ Object.keys(items).forEach((key) => {
68
+ const item = items[key];
69
+ flattened[key] = Array.isArray(item) ? dataFlatten(item) : item;
70
+ });
71
+ return flattened;
72
+ } else if (Array.isArray(items)) {
73
+ return items.reduce((acc, val) => acc.concat(Array.isArray(val) ? dataFlatten(val) : val), []);
74
+ } else {
75
+ return items;
76
+ }
77
+ }
78
+ export function dataWithout(items, properties) {
79
+ const propertyArray = Array.isArray(properties) ? properties : [properties];
80
+ if (isObject(items)) {
81
+ const entries = Object.entries(items);
82
+ return Object.fromEntries(entries.filter(([key]) => !propertyArray.includes(key)));
83
+ } else {
84
+ return items.filter((item) => !propertyArray.includes(item));
85
+ }
86
+ }
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Detect the current scroll position of the window
3
+ */
4
+ export declare function detectScrollPosition(): {
5
+ x: number;
6
+ y: number;
7
+ };
8
+ /**
9
+ * Detect the absolute mouse position with the page
10
+ */
11
+ export declare function detectMousePosition(event: MouseEvent): {
12
+ x: number;
13
+ y: number;
14
+ };
15
+ /**
16
+ * Detect the relative mouse position with the window size and returns a percentage value
17
+ */
18
+ export declare function detectRelativeMousePosition(event: MouseEvent): {
19
+ x: number;
20
+ y: number;
21
+ };
22
+ /**
23
+ * Detect the browser's window size
24
+ */
25
+ export declare function detectWindowSize(): {
26
+ width: number;
27
+ height: number;
28
+ };
29
+ /**
30
+ * Detect the screen or monitor size
31
+ */
32
+ export declare function detectScreenSize(): {
33
+ width: number;
34
+ height: number;
35
+ };
36
+ /**
37
+ * Detect the current device type (Mobile or Desktop)
38
+ */
39
+ export declare function detectDevice(): string;
40
+ /**
41
+ * Detect the current operating system
42
+ */
43
+ export declare function detectOS(): string;
44
+ /**
45
+ * Detect if the browser window is currently active or hidden.
46
+ */
47
+ export declare function detectActiveBrowser(): boolean;
48
+ /**
49
+ * Detect the current color scheme (Light or Dark)
50
+ */
51
+ export declare function detectColorScheme(): string;
52
+ /**
53
+ * Detect the current user's Timezone
54
+ */
55
+ export declare function detectUserTimezone(): string;
56
+ /**
57
+ * Detect the currect device orientation
58
+ */
59
+ export declare function detectDeviceOrientation(): string;
60
+ /**
61
+ * Detect the container size via ID
62
+ */
63
+ /**
64
+ * Detect the current breakpoint based on Tailwind CSS breakpoints
65
+ */
66
+ export declare function detectBreakpoint(): string;
67
+ /**
68
+ * Detect any container breakpoint based on Tailwind CSS breakpoints
69
+ */
70
+ export declare function detectContainerBreakpoint(element: HTMLElement): string;
71
+ /**
72
+ * Detect the current network status of the user (Online or Offline)
73
+ */
74
+ export declare function detectNetworkStatus(): string;
75
+ /**
76
+ * Returns the current URL
77
+ */
78
+ export declare function detectUrl(): string;
79
+ /**
80
+ * Returns the path of the current URL in an array
81
+ */
82
+ export declare function detectUrlPath(): string[];
83
+ /**
84
+ * Returns a value from the URL by name
85
+ */
86
+ export declare function detectUrlParams(): {
87
+ [key: string]: string;
88
+ }[] | null;
89
+ /**
90
+ * Returns a value from the URL hash by name
91
+ */
92
+ export declare function detectUrlHash(): string | null;
93
+ /**
94
+ * Returns the current host or domain name from the URL
95
+ */
96
+ export declare function detectHost(): string;
97
+ /**
98
+ * Returns the current hostname from the URL
99
+ */
100
+ export declare function detectHostName(): string;
101
+ /**
102
+ * Returns the current port
103
+ */
104
+ export declare function detectPort(): string;
105
+ /**
106
+ * Detects if the element is currently in the viewport
107
+ */
108
+ /**
109
+ * Detects if the element is currently in the container via ID
110
+ */
@@ -0,0 +1,131 @@
1
+ export function detectScrollPosition() {
2
+ return {
3
+ x: window.scrollX,
4
+ y: window.scrollY
5
+ };
6
+ }
7
+ export function detectMousePosition(event) {
8
+ return {
9
+ x: event.pageX,
10
+ y: event.pageY
11
+ };
12
+ }
13
+ export function detectRelativeMousePosition(event) {
14
+ const { innerWidth, innerHeight } = window;
15
+ return {
16
+ x: parseFloat((event.clientX / innerWidth).toFixed(2)),
17
+ y: parseFloat((event.clientY / innerHeight).toFixed(2))
18
+ };
19
+ }
20
+ export function detectWindowSize() {
21
+ return {
22
+ width: window.innerWidth,
23
+ height: window.innerHeight
24
+ };
25
+ }
26
+ export function detectScreenSize() {
27
+ return {
28
+ width: window.screen.width,
29
+ height: window.screen.height
30
+ };
31
+ }
32
+ export function detectDevice() {
33
+ return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Mobile" : "Desktop";
34
+ }
35
+ export function detectOS() {
36
+ const userAgent = navigator.userAgent.toLowerCase();
37
+ if (userAgent.includes("win"))
38
+ return "Windows";
39
+ if (userAgent.includes("mac"))
40
+ return "Mac";
41
+ if (userAgent.includes("linux"))
42
+ return "Linux";
43
+ if (userAgent.includes("x11"))
44
+ return "UNIX";
45
+ if (userAgent.includes("android"))
46
+ return "Android";
47
+ if (userAgent.includes("iphone"))
48
+ return "iOS";
49
+ return "Unknown";
50
+ }
51
+ export function detectActiveBrowser() {
52
+ return !document.hidden;
53
+ }
54
+ export function detectColorScheme() {
55
+ return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
56
+ }
57
+ export function detectUserTimezone() {
58
+ return Intl.DateTimeFormat().resolvedOptions().timeZone;
59
+ }
60
+ export function detectDeviceOrientation() {
61
+ return window.screen.orientation.type;
62
+ }
63
+ export function detectBreakpoint() {
64
+ const width = window.innerWidth;
65
+ if (width < 640)
66
+ return "xs";
67
+ if (width < 768)
68
+ return "sm";
69
+ if (width < 1024)
70
+ return "md";
71
+ if (width < 1280)
72
+ return "lg";
73
+ if (width < 1536)
74
+ return "xl";
75
+ return "2xl";
76
+ }
77
+ export function detectContainerBreakpoint(element) {
78
+ const width = element.getBoundingClientRect().width;
79
+ if (width < 320)
80
+ return "@xs";
81
+ if (width < 384)
82
+ return "@sm";
83
+ if (width < 448)
84
+ return "@md";
85
+ if (width < 512)
86
+ return "@lg";
87
+ if (width < 576)
88
+ return "@xl";
89
+ if (width < 672)
90
+ return "@2xl";
91
+ if (width < 768)
92
+ return "@3xl";
93
+ if (width < 896)
94
+ return "@4xl";
95
+ if (width < 1024)
96
+ return "@5xl";
97
+ if (width < 1152)
98
+ return "@6xl";
99
+ if (width < 1280)
100
+ return "@7xl";
101
+ return "@7xl";
102
+ }
103
+ export function detectNetworkStatus() {
104
+ return navigator.onLine ? "Online" : "Offline";
105
+ }
106
+ export function detectUrl() {
107
+ return window.location.href;
108
+ }
109
+ export function detectUrlPath() {
110
+ return window.location.pathname.split("/").filter((p) => p);
111
+ }
112
+ export function detectUrlParams() {
113
+ const searchParams = new URLSearchParams(window.location.search);
114
+ const paramsArray = [];
115
+ for (const [key, value] of searchParams.entries()) {
116
+ paramsArray.push({ [key]: value });
117
+ }
118
+ return paramsArray.length > 0 ? paramsArray : null;
119
+ }
120
+ export function detectUrlHash() {
121
+ return window.location.hash.replace("#", "");
122
+ }
123
+ export function detectHost() {
124
+ return window.location.host;
125
+ }
126
+ export function detectHostName() {
127
+ return window.location.hostname;
128
+ }
129
+ export function detectPort() {
130
+ return window.location.port;
131
+ }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * Format numbers into neat and formatted strings for people
3
+ */
4
+ export declare function formatNumber(number: number, options?: {
5
+ decimals?: number;
6
+ locale?: string;
7
+ }): string;
8
+ /**
9
+ * Format numbers into local currency with extra smarts
10
+ */
11
+ export declare function formatCurrency(number: number, options?: {
12
+ decimals?: number;
13
+ locale?: string;
14
+ }): string;
15
+ /**
16
+ * Format numbers into valuations displayed in thousands, millions or billions
17
+ */
18
+ export declare function formatValuation(number: number, options?: {
19
+ decimals?: number;
20
+ locale?: string;
21
+ }): string;
22
+ /**
23
+ * Format a number into a percentage
24
+ */
25
+ export declare function formatPercentage(value: number, options?: {
26
+ decimals?: number;
27
+ locale?: string;
28
+ }): string;
29
+ /**
30
+ * Format time into a human-readable string
31
+ */
32
+ export declare function formatDurationLabels(seconds: number, options?: {
33
+ labels?: 'short' | 'long';
34
+ round?: boolean;
35
+ }): string;
36
+ /**
37
+ * Format time into duration 00:00:00
38
+ */
39
+ export declare function formatDurationNumbers(seconds: number): string;
40
+ /**
41
+ * Format numbers into words
42
+ */
43
+ export declare function formatNumberToWords(value: number): string;
44
+ /**
45
+ * Generate initials from any string while ignoring common titles
46
+ */
47
+ export declare function formatInitials(text: string, options?: {
48
+ length?: number;
49
+ }): string;
50
+ /**
51
+ * Format Unix timestamp into a datetime string
52
+ */
53
+ export declare function formatUnixTime(timestamp: number): string;
54
+ /**
55
+ * Create a string of comma-separated values from an array, object or string with an optional limit and conjunction
56
+ */
57
+ export declare function formatList(items: string | object | any[], options?: {
58
+ limit?: number;
59
+ conjunction?: string;
60
+ }): string;
61
+ /**
62
+ * Converts a string to title case following the Chicago Manual of Style rules.
63
+ * @reference https://www.chicagomanualofstyle.org/book/ed17/frontmatter/toc.html
64
+
65
+ */
66
+ export declare function formatTitle(text: string): string;
67
+ /**
68
+ * Format a sentence case string
69
+ */
70
+ export declare function formatSentenceCase(text: string): string;
71
+ /**
72
+ * Adds a space between the last two words in a string to prevent lonely words.
73
+ */
74
+ export declare function formatTextWrap(value: string): string;
75
+ /**
76
+ * Format a number into a unit formatting
77
+ */