@rainersoft/utils 1.2.0 → 1.4.0
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/auth/index.d.mts +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +63 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/index.mjs +54 -0
- package/dist/auth/index.mjs.map +1 -0
- package/dist/date/index.d.mts +2 -9
- package/dist/date/index.d.ts +2 -9
- package/dist/index-BA11MtKk.d.ts +18 -0
- package/dist/index-BPYjFrM1.d.mts +18 -0
- package/dist/index-BfZE8XjJ.d.ts +18 -0
- package/dist/index-BuqX8-qm.d.mts +18 -0
- package/dist/index-DeZ9ZulO.d.mts +28 -0
- package/dist/index-DeZ9ZulO.d.ts +28 -0
- package/dist/index.d.mts +181 -49
- package/dist/index.d.ts +181 -49
- package/dist/index.js +897 -155
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +858 -154
- package/dist/index.mjs.map +1 -1
- package/dist/search/index.d.mts +12 -0
- package/dist/search/index.d.ts +12 -0
- package/dist/search/index.js +92 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/index.mjs +88 -0
- package/dist/search/index.mjs.map +1 -0
- package/dist/status/index.d.mts +2 -9
- package/dist/status/index.d.ts +2 -9
- package/dist/string/index.d.mts +6 -1
- package/dist/string/index.d.ts +6 -1
- package/dist/string/index.js +73 -1
- package/dist/string/index.js.map +1 -1
- package/dist/string/index.mjs +69 -2
- package/dist/string/index.mjs.map +1 -1
- package/package.json +102 -87
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { b as getRefreshToken, g as getToken, d as getTokens, h as hasToken, r as removeToken, c as setRefreshToken, s as setToken, e as setTokens } from '../index-DeZ9ZulO.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { b as getRefreshToken, g as getToken, d as getTokens, h as hasToken, r as removeToken, c as setRefreshToken, s as setToken, e as setTokens } from '../index-DeZ9ZulO.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/authentication/index.ts
|
|
4
|
+
var TOKEN_KEY = "auth_token";
|
|
5
|
+
var REFRESH_TOKEN_KEY = "refresh_token";
|
|
6
|
+
var getToken = () => {
|
|
7
|
+
if (typeof window === "undefined") {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
return localStorage.getItem(TOKEN_KEY);
|
|
11
|
+
};
|
|
12
|
+
var setToken = (token) => {
|
|
13
|
+
if (typeof window === "undefined") {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
localStorage.setItem(TOKEN_KEY, token);
|
|
17
|
+
};
|
|
18
|
+
var getRefreshToken = () => {
|
|
19
|
+
if (typeof window === "undefined") {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return localStorage.getItem(REFRESH_TOKEN_KEY);
|
|
23
|
+
};
|
|
24
|
+
var setRefreshToken = (refreshToken) => {
|
|
25
|
+
if (typeof window === "undefined") {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
localStorage.setItem(REFRESH_TOKEN_KEY, refreshToken);
|
|
29
|
+
};
|
|
30
|
+
var removeToken = () => {
|
|
31
|
+
if (typeof window === "undefined") {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
localStorage.removeItem(TOKEN_KEY);
|
|
35
|
+
localStorage.removeItem(REFRESH_TOKEN_KEY);
|
|
36
|
+
};
|
|
37
|
+
var hasToken = () => {
|
|
38
|
+
return !!getToken();
|
|
39
|
+
};
|
|
40
|
+
var getTokens = () => {
|
|
41
|
+
return {
|
|
42
|
+
accessToken: getToken(),
|
|
43
|
+
refreshToken: getRefreshToken()
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
var setTokens = ({
|
|
47
|
+
accessToken,
|
|
48
|
+
refreshToken
|
|
49
|
+
}) => {
|
|
50
|
+
setToken(accessToken);
|
|
51
|
+
setRefreshToken(refreshToken);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.getRefreshToken = getRefreshToken;
|
|
55
|
+
exports.getToken = getToken;
|
|
56
|
+
exports.getTokens = getTokens;
|
|
57
|
+
exports.hasToken = hasToken;
|
|
58
|
+
exports.removeToken = removeToken;
|
|
59
|
+
exports.setRefreshToken = setRefreshToken;
|
|
60
|
+
exports.setToken = setToken;
|
|
61
|
+
exports.setTokens = setTokens;
|
|
62
|
+
//# sourceMappingURL=index.js.map
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/authentication/index.ts"],"names":[],"mappings":";;;AAWA,IAAM,SAAA,GAAY,YAAA;AAClB,IAAM,iBAAA,GAAoB,eAAA;AAenB,IAAM,WAAW,MAAqB;AAC3C,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,YAAA,CAAa,QAAQ,SAAS,CAAA;AACvC;AAYO,IAAM,QAAA,GAAW,CAAC,KAAA,KAAwB;AAC/C,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AAEA,EAAA,YAAA,CAAa,OAAA,CAAQ,WAAW,KAAK,CAAA;AACvC;AAYO,IAAM,kBAAkB,MAAqB;AAClD,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,YAAA,CAAa,QAAQ,iBAAiB,CAAA;AAC/C;AAYO,IAAM,eAAA,GAAkB,CAAC,YAAA,KAA+B;AAC7D,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AAEA,EAAA,YAAA,CAAa,OAAA,CAAQ,mBAAmB,YAAY,CAAA;AACtD;AAWO,IAAM,cAAc,MAAY;AACrC,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AAEA,EAAA,YAAA,CAAa,WAAW,SAAS,CAAA;AACjC,EAAA,YAAA,CAAa,WAAW,iBAAiB,CAAA;AAC3C;AAcO,IAAM,WAAW,MAAe;AACrC,EAAA,OAAO,CAAC,CAAC,QAAA,EAAS;AACpB;AAYO,IAAM,YAAY,MAGpB;AACH,EAAA,OAAO;AAAA,IACL,aAAa,QAAA,EAAS;AAAA,IACtB,cAAc,eAAA;AAAgB,GAChC;AACF;AAgBO,IAAM,YAAY,CAAC;AAAA,EACxB,WAAA;AAAA,EACA;AACF,CAAA,KAGY;AACV,EAAA,QAAA,CAAS,WAAW,CAAA;AACpB,EAAA,eAAA,CAAgB,YAAY,CAAA;AAC9B","file":"index.js","sourcesContent":["/**\r\n * Auth Utilities\r\n *\r\n * Utilitários para gerenciamento de tokens de autenticação.\r\n * Funções para armazenar, recuperar e remover tokens JWT do localStorage.\r\n *\r\n * @module @rainersoft/utils/auth\r\n * @author Rainer Teixeira\r\n * @version 1.0.0\r\n */\r\n\r\nconst TOKEN_KEY = 'auth_token';\r\nconst REFRESH_TOKEN_KEY = 'refresh_token';\r\n\r\n/**\r\n * Obtém o token de acesso armazenado\r\n * \r\n * @returns string | null - Token JWT ou null se não encontrado\r\n * \r\n * @example\r\n * ```ts\r\n * const token = getToken();\r\n * if (token) {\r\n * // Usar token na requisição\r\n * }\r\n * ```\r\n */\r\nexport const getToken = (): string | null => {\r\n if (typeof window === 'undefined') {\r\n return null;\r\n }\r\n \r\n return localStorage.getItem(TOKEN_KEY);\r\n};\r\n\r\n/**\r\n * Define o token de acesso\r\n * \r\n * @param token - Token JWT a ser armazenado\r\n * \r\n * @example\r\n * ```ts\r\n * setToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...');\r\n * ```\r\n */\r\nexport const setToken = (token: string): void => {\r\n if (typeof window === 'undefined') {\r\n return;\r\n }\r\n \r\n localStorage.setItem(TOKEN_KEY, token);\r\n};\r\n\r\n/**\r\n * Obtém o refresh token armazenado\r\n * \r\n * @returns string | null - Refresh token ou null se não encontrado\r\n * \r\n * @example\r\n * ```ts\r\n * const refreshToken = getRefreshToken();\r\n * ```\r\n */\r\nexport const getRefreshToken = (): string | null => {\r\n if (typeof window === 'undefined') {\r\n return null;\r\n }\r\n \r\n return localStorage.getItem(REFRESH_TOKEN_KEY);\r\n};\r\n\r\n/**\r\n * Define o refresh token\r\n * \r\n * @param refreshToken - Refresh token a ser armazenado\r\n * \r\n * @example\r\n * ```ts\r\n * setRefreshToken('refresh_token_here');\r\n * ```\r\n */\r\nexport const setRefreshToken = (refreshToken: string): void => {\r\n if (typeof window === 'undefined') {\r\n return;\r\n }\r\n \r\n localStorage.setItem(REFRESH_TOKEN_KEY, refreshToken);\r\n};\r\n\r\n/**\r\n * Remove todos os tokens armazenados\r\n * \r\n * @example\r\n * ```ts\r\n * // Logout do usuário\r\n * removeToken();\r\n * ```\r\n */\r\nexport const removeToken = (): void => {\r\n if (typeof window === 'undefined') {\r\n return;\r\n }\r\n \r\n localStorage.removeItem(TOKEN_KEY);\r\n localStorage.removeItem(REFRESH_TOKEN_KEY);\r\n};\r\n\r\n/**\r\n * Verifica se há um token válido armazenado\r\n * \r\n * @returns boolean - True se token existe\r\n * \r\n * @example\r\n * ```ts\r\n * if (hasToken()) {\r\n * // Usuário autenticado\r\n * }\r\n * ```\r\n */\r\nexport const hasToken = (): boolean => {\r\n return !!getToken();\r\n};\r\n\r\n/**\r\n * Obtém os tokens como objeto\r\n * \r\n * @returns object - Com accessToken e refreshToken\r\n * \r\n * @example\r\n * ```ts\r\n * const { accessToken, refreshToken } = getTokens();\r\n * ```\r\n */\r\nexport const getTokens = (): {\r\n accessToken: string | null;\r\n refreshToken: string | null;\r\n} => {\r\n return {\r\n accessToken: getToken(),\r\n refreshToken: getRefreshToken(),\r\n };\r\n};\r\n\r\n/**\r\n * Define ambos os tokens de uma vez\r\n * \r\n * @param accessToken - Token de acesso\r\n * @param refreshToken - Token de refresh\r\n * \r\n * @example\r\n * ```ts\r\n * setTokens({\r\n * accessToken: 'access_token_here',\r\n * refreshToken: 'refresh_token_here'\r\n * });\r\n * ```\r\n */\r\nexport const setTokens = ({\r\n accessToken,\r\n refreshToken,\r\n}: {\r\n accessToken: string;\r\n refreshToken: string;\r\n}): void => {\r\n setToken(accessToken);\r\n setRefreshToken(refreshToken);\r\n};\r\n"]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// src/authentication/index.ts
|
|
2
|
+
var TOKEN_KEY = "auth_token";
|
|
3
|
+
var REFRESH_TOKEN_KEY = "refresh_token";
|
|
4
|
+
var getToken = () => {
|
|
5
|
+
if (typeof window === "undefined") {
|
|
6
|
+
return null;
|
|
7
|
+
}
|
|
8
|
+
return localStorage.getItem(TOKEN_KEY);
|
|
9
|
+
};
|
|
10
|
+
var setToken = (token) => {
|
|
11
|
+
if (typeof window === "undefined") {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
localStorage.setItem(TOKEN_KEY, token);
|
|
15
|
+
};
|
|
16
|
+
var getRefreshToken = () => {
|
|
17
|
+
if (typeof window === "undefined") {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return localStorage.getItem(REFRESH_TOKEN_KEY);
|
|
21
|
+
};
|
|
22
|
+
var setRefreshToken = (refreshToken) => {
|
|
23
|
+
if (typeof window === "undefined") {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
localStorage.setItem(REFRESH_TOKEN_KEY, refreshToken);
|
|
27
|
+
};
|
|
28
|
+
var removeToken = () => {
|
|
29
|
+
if (typeof window === "undefined") {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
localStorage.removeItem(TOKEN_KEY);
|
|
33
|
+
localStorage.removeItem(REFRESH_TOKEN_KEY);
|
|
34
|
+
};
|
|
35
|
+
var hasToken = () => {
|
|
36
|
+
return !!getToken();
|
|
37
|
+
};
|
|
38
|
+
var getTokens = () => {
|
|
39
|
+
return {
|
|
40
|
+
accessToken: getToken(),
|
|
41
|
+
refreshToken: getRefreshToken()
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
var setTokens = ({
|
|
45
|
+
accessToken,
|
|
46
|
+
refreshToken
|
|
47
|
+
}) => {
|
|
48
|
+
setToken(accessToken);
|
|
49
|
+
setRefreshToken(refreshToken);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { getRefreshToken, getToken, getTokens, hasToken, removeToken, setRefreshToken, setToken, setTokens };
|
|
53
|
+
//# sourceMappingURL=index.mjs.map
|
|
54
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/authentication/index.ts"],"names":[],"mappings":";AAWA,IAAM,SAAA,GAAY,YAAA;AAClB,IAAM,iBAAA,GAAoB,eAAA;AAenB,IAAM,WAAW,MAAqB;AAC3C,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,YAAA,CAAa,QAAQ,SAAS,CAAA;AACvC;AAYO,IAAM,QAAA,GAAW,CAAC,KAAA,KAAwB;AAC/C,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AAEA,EAAA,YAAA,CAAa,OAAA,CAAQ,WAAW,KAAK,CAAA;AACvC;AAYO,IAAM,kBAAkB,MAAqB;AAClD,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,OAAO,YAAA,CAAa,QAAQ,iBAAiB,CAAA;AAC/C;AAYO,IAAM,eAAA,GAAkB,CAAC,YAAA,KAA+B;AAC7D,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AAEA,EAAA,YAAA,CAAa,OAAA,CAAQ,mBAAmB,YAAY,CAAA;AACtD;AAWO,IAAM,cAAc,MAAY;AACrC,EAAA,IAAI,OAAO,WAAW,WAAA,EAAa;AACjC,IAAA;AAAA,EACF;AAEA,EAAA,YAAA,CAAa,WAAW,SAAS,CAAA;AACjC,EAAA,YAAA,CAAa,WAAW,iBAAiB,CAAA;AAC3C;AAcO,IAAM,WAAW,MAAe;AACrC,EAAA,OAAO,CAAC,CAAC,QAAA,EAAS;AACpB;AAYO,IAAM,YAAY,MAGpB;AACH,EAAA,OAAO;AAAA,IACL,aAAa,QAAA,EAAS;AAAA,IACtB,cAAc,eAAA;AAAgB,GAChC;AACF;AAgBO,IAAM,YAAY,CAAC;AAAA,EACxB,WAAA;AAAA,EACA;AACF,CAAA,KAGY;AACV,EAAA,QAAA,CAAS,WAAW,CAAA;AACpB,EAAA,eAAA,CAAgB,YAAY,CAAA;AAC9B","file":"index.mjs","sourcesContent":["/**\r\n * Auth Utilities\r\n *\r\n * Utilitários para gerenciamento de tokens de autenticação.\r\n * Funções para armazenar, recuperar e remover tokens JWT do localStorage.\r\n *\r\n * @module @rainersoft/utils/auth\r\n * @author Rainer Teixeira\r\n * @version 1.0.0\r\n */\r\n\r\nconst TOKEN_KEY = 'auth_token';\r\nconst REFRESH_TOKEN_KEY = 'refresh_token';\r\n\r\n/**\r\n * Obtém o token de acesso armazenado\r\n * \r\n * @returns string | null - Token JWT ou null se não encontrado\r\n * \r\n * @example\r\n * ```ts\r\n * const token = getToken();\r\n * if (token) {\r\n * // Usar token na requisição\r\n * }\r\n * ```\r\n */\r\nexport const getToken = (): string | null => {\r\n if (typeof window === 'undefined') {\r\n return null;\r\n }\r\n \r\n return localStorage.getItem(TOKEN_KEY);\r\n};\r\n\r\n/**\r\n * Define o token de acesso\r\n * \r\n * @param token - Token JWT a ser armazenado\r\n * \r\n * @example\r\n * ```ts\r\n * setToken('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...');\r\n * ```\r\n */\r\nexport const setToken = (token: string): void => {\r\n if (typeof window === 'undefined') {\r\n return;\r\n }\r\n \r\n localStorage.setItem(TOKEN_KEY, token);\r\n};\r\n\r\n/**\r\n * Obtém o refresh token armazenado\r\n * \r\n * @returns string | null - Refresh token ou null se não encontrado\r\n * \r\n * @example\r\n * ```ts\r\n * const refreshToken = getRefreshToken();\r\n * ```\r\n */\r\nexport const getRefreshToken = (): string | null => {\r\n if (typeof window === 'undefined') {\r\n return null;\r\n }\r\n \r\n return localStorage.getItem(REFRESH_TOKEN_KEY);\r\n};\r\n\r\n/**\r\n * Define o refresh token\r\n * \r\n * @param refreshToken - Refresh token a ser armazenado\r\n * \r\n * @example\r\n * ```ts\r\n * setRefreshToken('refresh_token_here');\r\n * ```\r\n */\r\nexport const setRefreshToken = (refreshToken: string): void => {\r\n if (typeof window === 'undefined') {\r\n return;\r\n }\r\n \r\n localStorage.setItem(REFRESH_TOKEN_KEY, refreshToken);\r\n};\r\n\r\n/**\r\n * Remove todos os tokens armazenados\r\n * \r\n * @example\r\n * ```ts\r\n * // Logout do usuário\r\n * removeToken();\r\n * ```\r\n */\r\nexport const removeToken = (): void => {\r\n if (typeof window === 'undefined') {\r\n return;\r\n }\r\n \r\n localStorage.removeItem(TOKEN_KEY);\r\n localStorage.removeItem(REFRESH_TOKEN_KEY);\r\n};\r\n\r\n/**\r\n * Verifica se há um token válido armazenado\r\n * \r\n * @returns boolean - True se token existe\r\n * \r\n * @example\r\n * ```ts\r\n * if (hasToken()) {\r\n * // Usuário autenticado\r\n * }\r\n * ```\r\n */\r\nexport const hasToken = (): boolean => {\r\n return !!getToken();\r\n};\r\n\r\n/**\r\n * Obtém os tokens como objeto\r\n * \r\n * @returns object - Com accessToken e refreshToken\r\n * \r\n * @example\r\n * ```ts\r\n * const { accessToken, refreshToken } = getTokens();\r\n * ```\r\n */\r\nexport const getTokens = (): {\r\n accessToken: string | null;\r\n refreshToken: string | null;\r\n} => {\r\n return {\r\n accessToken: getToken(),\r\n refreshToken: getRefreshToken(),\r\n };\r\n};\r\n\r\n/**\r\n * Define ambos os tokens de uma vez\r\n * \r\n * @param accessToken - Token de acesso\r\n * @param refreshToken - Token de refresh\r\n * \r\n * @example\r\n * ```ts\r\n * setTokens({\r\n * accessToken: 'access_token_here',\r\n * refreshToken: 'refresh_token_here'\r\n * });\r\n * ```\r\n */\r\nexport const setTokens = ({\r\n accessToken,\r\n refreshToken,\r\n}: {\r\n accessToken: string;\r\n refreshToken: string;\r\n}): void => {\r\n setToken(accessToken);\r\n setRefreshToken(refreshToken);\r\n};\r\n"]}
|
package/dist/date/index.d.mts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare function formatDate(date: string | Date, format?: 'short' | 'long' | 'full', locale?: Locale): string;
|
|
4
|
-
declare function formatDateTime(date: string | Date, locale?: Locale): string;
|
|
5
|
-
declare function formatRelativeDate(date: string | Date, locale?: Locale): string;
|
|
6
|
-
declare function toISOString(date: Date): string;
|
|
7
|
-
declare function isValidDate(date: unknown): date is Date;
|
|
8
|
-
|
|
9
|
-
export { formatDate, formatDateTime, formatRelativeDate, isValidDate, toISOString };
|
|
1
|
+
import '../types-tUMATEGI.mjs';
|
|
2
|
+
export { f as formatDate, a as formatDateTime, b as formatRelativeDate, i as isValidDate, t as toISOString } from '../index-BPYjFrM1.mjs';
|
package/dist/date/index.d.ts
CHANGED
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
declare function formatDate(date: string | Date, format?: 'short' | 'long' | 'full', locale?: Locale): string;
|
|
4
|
-
declare function formatDateTime(date: string | Date, locale?: Locale): string;
|
|
5
|
-
declare function formatRelativeDate(date: string | Date, locale?: Locale): string;
|
|
6
|
-
declare function toISOString(date: Date): string;
|
|
7
|
-
declare function isValidDate(date: unknown): date is Date;
|
|
8
|
-
|
|
9
|
-
export { formatDate, formatDateTime, formatRelativeDate, isValidDate, toISOString };
|
|
1
|
+
import '../types-tUMATEGI.js';
|
|
2
|
+
export { f as formatDate, a as formatDateTime, b as formatRelativeDate, i as isValidDate, t as toISOString } from '../index-BA11MtKk.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { L as Locale } from './types-tUMATEGI.js';
|
|
2
|
+
|
|
3
|
+
declare function formatDate(date: string | Date, format?: 'short' | 'long' | 'full', locale?: Locale): string;
|
|
4
|
+
declare function formatDateTime(date: string | Date, locale?: Locale): string;
|
|
5
|
+
declare function formatRelativeDate(date: string | Date, locale?: Locale): string;
|
|
6
|
+
declare function toISOString(date: Date): string;
|
|
7
|
+
declare function isValidDate(date: unknown): date is Date;
|
|
8
|
+
|
|
9
|
+
declare const dateModule_formatDate: typeof formatDate;
|
|
10
|
+
declare const dateModule_formatDateTime: typeof formatDateTime;
|
|
11
|
+
declare const dateModule_formatRelativeDate: typeof formatRelativeDate;
|
|
12
|
+
declare const dateModule_isValidDate: typeof isValidDate;
|
|
13
|
+
declare const dateModule_toISOString: typeof toISOString;
|
|
14
|
+
declare namespace dateModule {
|
|
15
|
+
export { dateModule_formatDate as formatDate, dateModule_formatDateTime as formatDateTime, dateModule_formatRelativeDate as formatRelativeDate, dateModule_isValidDate as isValidDate, dateModule_toISOString as toISOString };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { formatDateTime as a, formatRelativeDate as b, dateModule as d, formatDate as f, isValidDate as i, toISOString as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { L as Locale } from './types-tUMATEGI.mjs';
|
|
2
|
+
|
|
3
|
+
declare function formatDate(date: string | Date, format?: 'short' | 'long' | 'full', locale?: Locale): string;
|
|
4
|
+
declare function formatDateTime(date: string | Date, locale?: Locale): string;
|
|
5
|
+
declare function formatRelativeDate(date: string | Date, locale?: Locale): string;
|
|
6
|
+
declare function toISOString(date: Date): string;
|
|
7
|
+
declare function isValidDate(date: unknown): date is Date;
|
|
8
|
+
|
|
9
|
+
declare const dateModule_formatDate: typeof formatDate;
|
|
10
|
+
declare const dateModule_formatDateTime: typeof formatDateTime;
|
|
11
|
+
declare const dateModule_formatRelativeDate: typeof formatRelativeDate;
|
|
12
|
+
declare const dateModule_isValidDate: typeof isValidDate;
|
|
13
|
+
declare const dateModule_toISOString: typeof toISOString;
|
|
14
|
+
declare namespace dateModule {
|
|
15
|
+
export { dateModule_formatDate as formatDate, dateModule_formatDateTime as formatDateTime, dateModule_formatRelativeDate as formatRelativeDate, dateModule_isValidDate as isValidDate, dateModule_toISOString as toISOString };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { formatDateTime as a, formatRelativeDate as b, dateModule as d, formatDate as f, isValidDate as i, toISOString as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { L as Locale } from './types-tUMATEGI.js';
|
|
2
|
+
|
|
3
|
+
type GenericStatus = 'DRAFT' | 'PENDING' | 'PUBLISHED' | 'ACTIVE' | 'INACTIVE' | 'ARCHIVED' | 'DELETED' | 'SCHEDULED' | 'COMPLETED' | 'CANCELLED' | 'APPROVED' | 'REJECTED';
|
|
4
|
+
declare function translateStatus(status: string, locale?: Locale): string;
|
|
5
|
+
declare function getStatusColor(status: string): string;
|
|
6
|
+
declare function getStatusVariant(status: string): 'default' | 'secondary' | 'destructive' | 'outline';
|
|
7
|
+
declare function translatePostStatus(status: string, locale?: Locale): string;
|
|
8
|
+
|
|
9
|
+
type statusModule_GenericStatus = GenericStatus;
|
|
10
|
+
declare const statusModule_getStatusColor: typeof getStatusColor;
|
|
11
|
+
declare const statusModule_getStatusVariant: typeof getStatusVariant;
|
|
12
|
+
declare const statusModule_translatePostStatus: typeof translatePostStatus;
|
|
13
|
+
declare const statusModule_translateStatus: typeof translateStatus;
|
|
14
|
+
declare namespace statusModule {
|
|
15
|
+
export { type statusModule_GenericStatus as GenericStatus, statusModule_getStatusColor as getStatusColor, statusModule_getStatusVariant as getStatusVariant, statusModule_translatePostStatus as translatePostStatus, statusModule_translateStatus as translateStatus };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { type GenericStatus as G, getStatusVariant as a, translatePostStatus as b, getStatusColor as g, statusModule as s, translateStatus as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { L as Locale } from './types-tUMATEGI.mjs';
|
|
2
|
+
|
|
3
|
+
type GenericStatus = 'DRAFT' | 'PENDING' | 'PUBLISHED' | 'ACTIVE' | 'INACTIVE' | 'ARCHIVED' | 'DELETED' | 'SCHEDULED' | 'COMPLETED' | 'CANCELLED' | 'APPROVED' | 'REJECTED';
|
|
4
|
+
declare function translateStatus(status: string, locale?: Locale): string;
|
|
5
|
+
declare function getStatusColor(status: string): string;
|
|
6
|
+
declare function getStatusVariant(status: string): 'default' | 'secondary' | 'destructive' | 'outline';
|
|
7
|
+
declare function translatePostStatus(status: string, locale?: Locale): string;
|
|
8
|
+
|
|
9
|
+
type statusModule_GenericStatus = GenericStatus;
|
|
10
|
+
declare const statusModule_getStatusColor: typeof getStatusColor;
|
|
11
|
+
declare const statusModule_getStatusVariant: typeof getStatusVariant;
|
|
12
|
+
declare const statusModule_translatePostStatus: typeof translatePostStatus;
|
|
13
|
+
declare const statusModule_translateStatus: typeof translateStatus;
|
|
14
|
+
declare namespace statusModule {
|
|
15
|
+
export { type statusModule_GenericStatus as GenericStatus, statusModule_getStatusColor as getStatusColor, statusModule_getStatusVariant as getStatusVariant, statusModule_translatePostStatus as translatePostStatus, statusModule_translateStatus as translateStatus };
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { type GenericStatus as G, getStatusVariant as a, translatePostStatus as b, getStatusColor as g, statusModule as s, translateStatus as t };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const getToken: () => string | null;
|
|
2
|
+
declare const setToken: (token: string) => void;
|
|
3
|
+
declare const getRefreshToken: () => string | null;
|
|
4
|
+
declare const setRefreshToken: (refreshToken: string) => void;
|
|
5
|
+
declare const removeToken: () => void;
|
|
6
|
+
declare const hasToken: () => boolean;
|
|
7
|
+
declare const getTokens: () => {
|
|
8
|
+
accessToken: string | null;
|
|
9
|
+
refreshToken: string | null;
|
|
10
|
+
};
|
|
11
|
+
declare const setTokens: ({ accessToken, refreshToken, }: {
|
|
12
|
+
accessToken: string;
|
|
13
|
+
refreshToken: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
|
|
16
|
+
declare const authModule_getRefreshToken: typeof getRefreshToken;
|
|
17
|
+
declare const authModule_getToken: typeof getToken;
|
|
18
|
+
declare const authModule_getTokens: typeof getTokens;
|
|
19
|
+
declare const authModule_hasToken: typeof hasToken;
|
|
20
|
+
declare const authModule_removeToken: typeof removeToken;
|
|
21
|
+
declare const authModule_setRefreshToken: typeof setRefreshToken;
|
|
22
|
+
declare const authModule_setToken: typeof setToken;
|
|
23
|
+
declare const authModule_setTokens: typeof setTokens;
|
|
24
|
+
declare namespace authModule {
|
|
25
|
+
export { authModule_getRefreshToken as getRefreshToken, authModule_getToken as getToken, authModule_getTokens as getTokens, authModule_hasToken as hasToken, authModule_removeToken as removeToken, authModule_setRefreshToken as setRefreshToken, authModule_setToken as setToken, authModule_setTokens as setTokens };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { authModule as a, getRefreshToken as b, setRefreshToken as c, getTokens as d, setTokens as e, getToken as g, hasToken as h, removeToken as r, setToken as s };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const getToken: () => string | null;
|
|
2
|
+
declare const setToken: (token: string) => void;
|
|
3
|
+
declare const getRefreshToken: () => string | null;
|
|
4
|
+
declare const setRefreshToken: (refreshToken: string) => void;
|
|
5
|
+
declare const removeToken: () => void;
|
|
6
|
+
declare const hasToken: () => boolean;
|
|
7
|
+
declare const getTokens: () => {
|
|
8
|
+
accessToken: string | null;
|
|
9
|
+
refreshToken: string | null;
|
|
10
|
+
};
|
|
11
|
+
declare const setTokens: ({ accessToken, refreshToken, }: {
|
|
12
|
+
accessToken: string;
|
|
13
|
+
refreshToken: string;
|
|
14
|
+
}) => void;
|
|
15
|
+
|
|
16
|
+
declare const authModule_getRefreshToken: typeof getRefreshToken;
|
|
17
|
+
declare const authModule_getToken: typeof getToken;
|
|
18
|
+
declare const authModule_getTokens: typeof getTokens;
|
|
19
|
+
declare const authModule_hasToken: typeof hasToken;
|
|
20
|
+
declare const authModule_removeToken: typeof removeToken;
|
|
21
|
+
declare const authModule_setRefreshToken: typeof setRefreshToken;
|
|
22
|
+
declare const authModule_setToken: typeof setToken;
|
|
23
|
+
declare const authModule_setTokens: typeof setTokens;
|
|
24
|
+
declare namespace authModule {
|
|
25
|
+
export { authModule_getRefreshToken as getRefreshToken, authModule_getToken as getToken, authModule_getTokens as getTokens, authModule_hasToken as hasToken, authModule_removeToken as removeToken, authModule_setRefreshToken as setRefreshToken, authModule_setToken as setToken, authModule_setTokens as setTokens };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { authModule as a, getRefreshToken as b, setRefreshToken as c, getTokens as d, setTokens as e, getToken as g, hasToken as h, removeToken as r, setToken as s };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { L as Locale } from './types-tUMATEGI.mjs';
|
|
2
2
|
export { C as CURRENCY_MAP, D as DEFAULT_LOCALE, a as LocaleConfig } from './types-tUMATEGI.mjs';
|
|
3
|
-
|
|
4
|
-
export { formatDate, formatDateTime, formatRelativeDate, isValidDate, toISOString } from './
|
|
3
|
+
import { d as dateModule } from './index-BPYjFrM1.mjs';
|
|
4
|
+
export { f as formatDate, a as formatDateTime, b as formatRelativeDate, i as isValidDate, t as toISOString } from './index-BPYjFrM1.mjs';
|
|
5
|
+
import { s as statusModule } from './index-BuqX8-qm.mjs';
|
|
6
|
+
export { G as GenericStatus, g as getStatusColor, a as getStatusVariant, b as translatePostStatus, t as translateStatus } from './index-BuqX8-qm.mjs';
|
|
7
|
+
import { a as authModule } from './index-DeZ9ZulO.mjs';
|
|
8
|
+
export { b as getRefreshToken, g as getToken, d as getTokens, h as hasToken, r as removeToken, c as setRefreshToken, s as setToken, e as setTokens } from './index-DeZ9ZulO.mjs';
|
|
9
|
+
export { SearchOptions, fuzzySearch, searchContent, searchWithScore } from './search/index.mjs';
|
|
10
|
+
export { formatCNPJ, formatCPF, formatPhone, getInitials, isCNPJ, isCPF, textToSlug, truncate } from './string/index.mjs';
|
|
5
11
|
export { formatCurrency } from './number/index.mjs';
|
|
6
|
-
export { GenericStatus, getStatusColor, getStatusVariant, translatePostStatus, translateStatus } from './status/index.mjs';
|
|
7
12
|
|
|
8
|
-
declare function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
declare function
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
declare function normalizeSpaces(text: string, options?: {
|
|
23
|
-
newlines?: boolean;
|
|
24
|
-
}): string;
|
|
25
|
-
declare function calculateReadingTime(content: string | Record<string, any>, wordsPerMinute?: number): number;
|
|
13
|
+
declare function hexToRgb(hex: string): {
|
|
14
|
+
r: number;
|
|
15
|
+
g: number;
|
|
16
|
+
b: number;
|
|
17
|
+
};
|
|
18
|
+
declare function validateContrast(foreground: string, background: string, options?: {
|
|
19
|
+
requireAAA?: boolean;
|
|
20
|
+
largeText?: boolean;
|
|
21
|
+
}): {
|
|
22
|
+
valid: boolean;
|
|
23
|
+
level: string;
|
|
24
|
+
contrast: number;
|
|
25
|
+
message: string;
|
|
26
|
+
};
|
|
26
27
|
|
|
27
28
|
interface ValidationResult {
|
|
28
29
|
isValid: boolean;
|
|
@@ -57,6 +58,47 @@ declare function validateMessage(message: string, options?: {
|
|
|
57
58
|
maxLength?: number;
|
|
58
59
|
}, locale?: Locale): ValidationResult;
|
|
59
60
|
|
|
61
|
+
interface TiptapNode {
|
|
62
|
+
type: string;
|
|
63
|
+
text?: string;
|
|
64
|
+
content?: TiptapNode[];
|
|
65
|
+
attrs?: Record<string, any>;
|
|
66
|
+
}
|
|
67
|
+
interface TiptapJSON {
|
|
68
|
+
type: 'doc';
|
|
69
|
+
content: TiptapNode[];
|
|
70
|
+
}
|
|
71
|
+
interface ContentStats {
|
|
72
|
+
wordCount: number;
|
|
73
|
+
characterCount: number;
|
|
74
|
+
readingTime: number;
|
|
75
|
+
}
|
|
76
|
+
declare function extractTextFromTiptap(content: TiptapJSON): string;
|
|
77
|
+
declare function generateExcerpt(content: TiptapJSON, maxLength?: number): string;
|
|
78
|
+
declare function createEmptyTiptapContent(): TiptapJSON;
|
|
79
|
+
declare function isContentEmpty(content: TiptapJSON): boolean;
|
|
80
|
+
declare function countCharacters(content: TiptapJSON): number;
|
|
81
|
+
declare function getReadingTime(content: TiptapJSON, wordsPerMinute?: number): number;
|
|
82
|
+
declare function getContentStats(content: TiptapJSON): ContentStats;
|
|
83
|
+
declare function containsText(content: TiptapJSON, searchText: string): boolean;
|
|
84
|
+
declare function replaceText(content: TiptapJSON, searchText: string, replaceText: string): TiptapJSON;
|
|
85
|
+
|
|
86
|
+
declare function rgbToHex(r: number, g: number, b: number): string;
|
|
87
|
+
declare function hexToHsl(hex: string): {
|
|
88
|
+
h: number;
|
|
89
|
+
s: number;
|
|
90
|
+
l: number;
|
|
91
|
+
};
|
|
92
|
+
declare function hslToHex(h: number, s: number, l: number): string;
|
|
93
|
+
declare function adjustBrightness(hex: string, amount: number): string;
|
|
94
|
+
declare function adjustSaturation(hex: string, amount: number): string;
|
|
95
|
+
declare function adjustHue(hex: string, degrees: number): string;
|
|
96
|
+
declare function lighten(hex: string, amount: number): string;
|
|
97
|
+
declare function darken(hex: string, amount: number): string;
|
|
98
|
+
declare function hexToRgba(hex: string, alpha: number): string;
|
|
99
|
+
declare function getComplementary(hex: string): string;
|
|
100
|
+
declare function getAnalogousPalette(hex: string, count?: number): string[];
|
|
101
|
+
|
|
60
102
|
declare function prefersReducedMotion(): boolean;
|
|
61
103
|
declare function onReducedMotionChange(callback: (prefersReduced: boolean) => void): () => void;
|
|
62
104
|
declare function scrollToPosition(x?: number, y?: number, options?: {
|
|
@@ -81,6 +123,72 @@ declare function onDarkModeChange(callback: (isDark: boolean) => void): () => vo
|
|
|
81
123
|
declare function copyToClipboard(text: string): Promise<boolean>;
|
|
82
124
|
declare function downloadFile(blob: Blob, filename: string): void;
|
|
83
125
|
|
|
126
|
+
interface UserProfile {
|
|
127
|
+
id: string;
|
|
128
|
+
nickname: string;
|
|
129
|
+
email?: string;
|
|
130
|
+
emailVerified?: boolean;
|
|
131
|
+
role?: UserRole;
|
|
132
|
+
avatar?: string;
|
|
133
|
+
createdAt?: string;
|
|
134
|
+
updatedAt?: string;
|
|
135
|
+
lastLoginAt?: string;
|
|
136
|
+
}
|
|
137
|
+
declare enum UserRole {
|
|
138
|
+
ADMIN = "admin",
|
|
139
|
+
MODERATOR = "moderator",
|
|
140
|
+
USER = "user",
|
|
141
|
+
GUEST = "guest"
|
|
142
|
+
}
|
|
143
|
+
interface LoginCredentials {
|
|
144
|
+
email: string;
|
|
145
|
+
password: string;
|
|
146
|
+
rememberMe?: boolean;
|
|
147
|
+
}
|
|
148
|
+
interface RegisterData {
|
|
149
|
+
nickname: string;
|
|
150
|
+
email: string;
|
|
151
|
+
password: string;
|
|
152
|
+
confirmPassword: string;
|
|
153
|
+
role?: UserRole;
|
|
154
|
+
}
|
|
155
|
+
interface LogoutOptions {
|
|
156
|
+
invalidateAllSessions?: boolean;
|
|
157
|
+
redirectPath?: string;
|
|
158
|
+
}
|
|
159
|
+
interface AuthResult {
|
|
160
|
+
success: boolean;
|
|
161
|
+
user?: UserProfile;
|
|
162
|
+
token?: string;
|
|
163
|
+
refreshToken?: string;
|
|
164
|
+
error?: string;
|
|
165
|
+
}
|
|
166
|
+
interface UseAuthConfig {
|
|
167
|
+
autoRefresh?: boolean;
|
|
168
|
+
refreshInterval?: number;
|
|
169
|
+
tokenStorageKey?: string;
|
|
170
|
+
userStorageKey?: string;
|
|
171
|
+
apiEndpoint?: string;
|
|
172
|
+
onAuthChange?: (user: UserProfile | null) => void;
|
|
173
|
+
onError?: (error: string) => void;
|
|
174
|
+
}
|
|
175
|
+
declare function useAuth(config?: Partial<UseAuthConfig>): {
|
|
176
|
+
user: UserProfile | null;
|
|
177
|
+
loading: boolean;
|
|
178
|
+
error: string | null;
|
|
179
|
+
isAuthenticated: boolean;
|
|
180
|
+
login: (credentials: LoginCredentials) => Promise<AuthResult>;
|
|
181
|
+
logout: (options?: LogoutOptions) => Promise<void>;
|
|
182
|
+
register: (userData: RegisterData) => Promise<AuthResult>;
|
|
183
|
+
updateProfile: (data: Partial<UserProfile>) => Promise<AuthResult>;
|
|
184
|
+
refreshToken: () => Promise<AuthResult>;
|
|
185
|
+
resetError: () => void;
|
|
186
|
+
};
|
|
187
|
+
declare function useIsAuthenticated(): boolean;
|
|
188
|
+
declare function useCurrentUser(): UserProfile | null;
|
|
189
|
+
declare function useHasRole(role: UserRole): boolean;
|
|
190
|
+
declare function useIsAdmin(): boolean;
|
|
191
|
+
|
|
84
192
|
declare function formatNumber$1(num: number): string;
|
|
85
193
|
declare function calculateChange(current: number, previous: number): number;
|
|
86
194
|
declare function formatPercentage(value: number, options?: {
|
|
@@ -95,32 +203,6 @@ declare function findMinMax<T extends Record<string, any>>(data: T[], field: key
|
|
|
95
203
|
max: number;
|
|
96
204
|
};
|
|
97
205
|
|
|
98
|
-
declare const getToken: () => string | null;
|
|
99
|
-
declare const setToken: (token: string) => void;
|
|
100
|
-
declare const getRefreshToken: () => string | null;
|
|
101
|
-
declare const setRefreshToken: (refreshToken: string) => void;
|
|
102
|
-
declare const removeToken: () => void;
|
|
103
|
-
declare const hasToken: () => boolean;
|
|
104
|
-
declare const getTokens: () => {
|
|
105
|
-
accessToken: string | null;
|
|
106
|
-
refreshToken: string | null;
|
|
107
|
-
};
|
|
108
|
-
declare const setTokens: ({ accessToken, refreshToken, }: {
|
|
109
|
-
accessToken: string;
|
|
110
|
-
refreshToken: string;
|
|
111
|
-
}) => void;
|
|
112
|
-
|
|
113
|
-
interface SearchOptions {
|
|
114
|
-
fields?: string[];
|
|
115
|
-
caseSensitive?: boolean;
|
|
116
|
-
exactMatch?: boolean;
|
|
117
|
-
}
|
|
118
|
-
declare function searchContent<T extends Record<string, any>>(query: string, content: T[], options?: SearchOptions): T[];
|
|
119
|
-
declare function searchWithScore<T extends Record<string, any>>(query: string, content: T[], options?: SearchOptions): T[];
|
|
120
|
-
declare function fuzzySearch<T extends Record<string, any>>(query: string, content: T[], options?: SearchOptions & {
|
|
121
|
-
threshold?: number;
|
|
122
|
-
}): T[];
|
|
123
|
-
|
|
124
206
|
declare function usePasswordStrength(password: string, options?: {
|
|
125
207
|
minLength?: number;
|
|
126
208
|
requireUppercase?: boolean;
|
|
@@ -174,6 +256,15 @@ declare function formatCurrency(value: number, options?: Intl.NumberFormatOption
|
|
|
174
256
|
declare function formatNumber(value: number, decimals?: number): string;
|
|
175
257
|
declare function formatCompact(value: number, decimals?: number): string;
|
|
176
258
|
declare function translateStatus(status: string): string;
|
|
259
|
+
declare const _default: {
|
|
260
|
+
formatDate: typeof formatDate;
|
|
261
|
+
formatDateTime: typeof formatDateTime;
|
|
262
|
+
formatRelativeDate: typeof formatRelativeDate;
|
|
263
|
+
formatCurrency: typeof formatCurrency;
|
|
264
|
+
formatNumber: typeof formatNumber;
|
|
265
|
+
formatCompact: typeof formatCompact;
|
|
266
|
+
translateStatus: typeof translateStatus;
|
|
267
|
+
};
|
|
177
268
|
|
|
178
269
|
declare const ptBr_formatCompact: typeof formatCompact;
|
|
179
270
|
declare const ptBr_formatCurrency: typeof formatCurrency;
|
|
@@ -183,7 +274,48 @@ declare const ptBr_formatNumber: typeof formatNumber;
|
|
|
183
274
|
declare const ptBr_formatRelativeDate: typeof formatRelativeDate;
|
|
184
275
|
declare const ptBr_translateStatus: typeof translateStatus;
|
|
185
276
|
declare namespace ptBr {
|
|
186
|
-
export { ptBr_formatCompact as formatCompact, ptBr_formatCurrency as formatCurrency, ptBr_formatDate as formatDate, ptBr_formatDateTime as formatDateTime, ptBr_formatNumber as formatNumber, ptBr_formatRelativeDate as formatRelativeDate, ptBr_translateStatus as translateStatus };
|
|
277
|
+
export { _default as default, ptBr_formatCompact as formatCompact, ptBr_formatCurrency as formatCurrency, ptBr_formatDate as formatDate, ptBr_formatDateTime as formatDateTime, ptBr_formatNumber as formatNumber, ptBr_formatRelativeDate as formatRelativeDate, ptBr_translateStatus as translateStatus };
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
declare function extractInitials(name: string | null | undefined, maxChars?: number): string;
|
|
281
|
+
declare function generateAvatarUrl(name: string, size?: number, backgroundColor?: string, textColor?: string): string;
|
|
282
|
+
declare function isValidAvatarUrl(url: string): boolean;
|
|
283
|
+
declare function getAvatarColorFromName(name: string): string;
|
|
284
|
+
declare function generateDynamicAvatarUrl(name: string, size?: number): string;
|
|
285
|
+
declare function generateUniqueId(text: string, prefix?: string, suffix?: string): string;
|
|
286
|
+
declare function truncateText(text: string, maxLength: number, suffix?: string): string;
|
|
287
|
+
declare function capitalize(text: string, options?: {
|
|
288
|
+
firstWordOnly?: boolean;
|
|
289
|
+
lowerRest?: boolean;
|
|
290
|
+
}): string;
|
|
291
|
+
declare function cleanText(text: string, allowSpaces?: boolean): string;
|
|
292
|
+
declare function countWords(text: string): number;
|
|
293
|
+
declare function isEmpty(text: string | null | undefined): boolean;
|
|
294
|
+
declare function normalizeSpaces(text: string, options?: {
|
|
295
|
+
newlines?: boolean;
|
|
296
|
+
}): string;
|
|
297
|
+
declare function calculateReadingTime(content: string | Record<string, any>, wordsPerMinute?: number): number;
|
|
298
|
+
|
|
299
|
+
declare const textModule_calculateReadingTime: typeof calculateReadingTime;
|
|
300
|
+
declare const textModule_capitalize: typeof capitalize;
|
|
301
|
+
declare const textModule_cleanText: typeof cleanText;
|
|
302
|
+
declare const textModule_countWords: typeof countWords;
|
|
303
|
+
declare const textModule_extractInitials: typeof extractInitials;
|
|
304
|
+
declare const textModule_generateAvatarUrl: typeof generateAvatarUrl;
|
|
305
|
+
declare const textModule_generateDynamicAvatarUrl: typeof generateDynamicAvatarUrl;
|
|
306
|
+
declare const textModule_generateUniqueId: typeof generateUniqueId;
|
|
307
|
+
declare const textModule_getAvatarColorFromName: typeof getAvatarColorFromName;
|
|
308
|
+
declare const textModule_isEmpty: typeof isEmpty;
|
|
309
|
+
declare const textModule_isValidAvatarUrl: typeof isValidAvatarUrl;
|
|
310
|
+
declare const textModule_normalizeSpaces: typeof normalizeSpaces;
|
|
311
|
+
declare const textModule_truncateText: typeof truncateText;
|
|
312
|
+
declare namespace textModule {
|
|
313
|
+
export { textModule_calculateReadingTime as calculateReadingTime, textModule_capitalize as capitalize, textModule_cleanText as cleanText, textModule_countWords as countWords, textModule_extractInitials as extractInitials, textModule_generateAvatarUrl as generateAvatarUrl, textModule_generateDynamicAvatarUrl as generateDynamicAvatarUrl, textModule_generateUniqueId as generateUniqueId, textModule_getAvatarColorFromName as getAvatarColorFromName, textModule_isEmpty as isEmpty, textModule_isValidAvatarUrl as isValidAvatarUrl, textModule_normalizeSpaces as normalizeSpaces, textModule_truncateText as truncateText };
|
|
187
314
|
}
|
|
188
315
|
|
|
189
|
-
|
|
316
|
+
declare const textProcessing: typeof textModule;
|
|
317
|
+
declare const datetime: typeof dateModule;
|
|
318
|
+
declare const authentication: typeof authModule;
|
|
319
|
+
declare const stateManagement: typeof statusModule;
|
|
320
|
+
|
|
321
|
+
export { type ContentStats, Locale, type TiptapJSON, type TiptapNode, type ValidationResult, adjustBrightness, adjustHue, adjustSaturation, authentication, calculateChange, calculateMovingAverage, calculateReadingTime, capitalize, cleanText, containsText, copyToClipboard, countCharacters, countWords, createEmptyTiptapContent, darken, datetime, downloadFile, extractInitials, extractTextFromTiptap, findMinMax, formatNumber$1 as formatNumber, formatPercentage, generateAvatarUrl, generateDynamicAvatarUrl, generateExcerpt, generateMockChartData, generateUniqueId, getAnalogousPalette, getAvatarColorFromName, getComplementary, getContentStats, getElementPosition, getReadingTime, groupDataByPeriod, hexToHsl, hexToRgb, hexToRgba, hslToHex, isContentEmpty, isDarkMode, isElementVisible, isEmpty, isMobile, isValidAvatarUrl, lighten, normalizeSpaces, onDarkModeChange, onReducedMotionChange, prefersReducedMotion, ptBr as ptBR, replaceText, rgbToHex, scrollToElement, scrollToPosition, scrollToTop, smoothScrollTo, stateManagement, textProcessing, truncateText, useAuth, useCurrentUser, useHasRole, useIsAdmin, useIsAuthenticated, usePasswordStrength, validateContrast, validateEmail, validateMessage, validatePassword, validatePhone, validateSlug, validateText, validateUrl, validateUsername };
|