@putkoff/abstract-utilities 1.0.70 → 1.0.93
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/cjs/index.js +247 -341
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/server.js +342 -0
- package/dist/cjs/server.js.map +1 -0
- package/dist/esm/index.js +508 -1156
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/server.js +305 -0
- package/dist/esm/server.js.map +1 -0
- package/dist/types/functions/auth_utils/imports.d.ts +0 -0
- package/dist/types/functions/auth_utils/index.d.ts +0 -0
- package/dist/types/functions/auth_utils/src/index.d.ts +0 -0
- package/dist/types/functions/auth_utils/src/token_utils.d.ts +0 -0
- package/dist/types/functions/config_utils/imports.d.ts +0 -0
- package/dist/types/functions/config_utils/index.d.ts +0 -0
- package/dist/types/functions/config_utils/src/config_utils.d.ts +0 -0
- package/dist/types/functions/config_utils/src/index.d.ts +0 -0
- package/dist/types/functions/constants_utils/index.d.ts +0 -0
- package/dist/types/functions/constants_utils/src/constants.d.ts +0 -0
- package/dist/types/functions/constants_utils/src/index.d.ts +0 -0
- package/dist/types/functions/env_utils/imports.d.ts +0 -0
- package/dist/types/functions/env_utils/index.d.ts +0 -0
- package/dist/types/functions/env_utils/src/index.d.ts +0 -0
- package/dist/types/functions/env_utils/src/window_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/imports.d.ts +0 -0
- package/dist/types/functions/fetch_utils/index.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/fetch_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/index.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/url_utils.d.ts +0 -0
- package/dist/types/functions/fetch_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/index.d.ts +0 -0
- package/dist/types/functions/math_utils/constants.d.ts +0 -0
- package/dist/types/functions/math_utils/conversions.d.ts +0 -0
- package/dist/types/functions/math_utils/index.d.ts +0 -0
- package/dist/types/functions/math_utils/safe_math.d.ts +0 -0
- package/dist/types/functions/math_utils/scaleInterfaces.d.ts +0 -0
- package/dist/types/functions/path_utils/imports.d.ts +0 -0
- package/dist/types/functions/path_utils/index.d.ts +0 -0
- package/dist/types/functions/path_utils/src/base_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/function_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/index.d.ts +0 -0
- package/dist/types/functions/path_utils/src/misc_dirs.d.ts +0 -0
- package/dist/types/functions/path_utils/src/path_utils.d.ts +0 -0
- package/dist/types/functions/path_utils/src/paths.d.ts +0 -0
- package/dist/types/functions/path_utils/src/src_dirs.d.ts +0 -0
- package/dist/types/functions/read_utils/imports.d.ts +0 -0
- package/dist/types/functions/read_utils/index.d.ts +0 -0
- package/dist/types/functions/read_utils/src/index.d.ts +3 -1
- package/dist/types/functions/read_utils/src/readJsonFile.browser.d.ts +1 -0
- package/dist/types/functions/read_utils/src/readJsonFile.d.ts +2 -0
- package/dist/types/functions/read_utils/src/readJsonFile.node.d.ts +1 -0
- package/dist/types/functions/rndm_utils/imports.d.ts +0 -0
- package/dist/types/functions/rndm_utils/index.d.ts +0 -0
- package/dist/types/functions/rndm_utils/src/index.d.ts +0 -0
- package/dist/types/functions/rndm_utils/src/utils.d.ts +0 -0
- package/dist/types/functions/safe_utils/imports.d.ts +0 -0
- package/dist/types/functions/safe_utils/index.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/index.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_document.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_globals.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_storage.d.ts +0 -0
- package/dist/types/functions/safe_utils/src/safe_window.d.ts +0 -0
- package/dist/types/functions/string_utils/index.d.ts +0 -0
- package/dist/types/functions/string_utils/src/index.d.ts +0 -0
- package/dist/types/functions/string_utils/src/string_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/imports.d.ts +0 -0
- package/dist/types/functions/type_utils/index.d.ts +0 -0
- package/dist/types/functions/type_utils/src/clean_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/ensure_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/imports.d.ts +0 -0
- package/dist/types/functions/type_utils/src/index.d.ts +0 -0
- package/dist/types/functions/type_utils/src/json_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/list_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/mime_utils.d.ts +0 -0
- package/dist/types/functions/type_utils/src/type_utils.d.ts +0 -0
- package/dist/types/functions/variable_utils/imports.d.ts +0 -0
- package/dist/types/functions/variable_utils/index.d.ts +0 -0
- package/dist/types/functions/variable_utils/src/index.d.ts +0 -0
- package/dist/types/functions/variable_utils/src/variable_utils.d.ts +0 -0
- package/dist/types/index.d.ts +0 -0
- package/dist/types/types/index.d.ts +0 -0
- package/dist/types/types/src/Files.d.ts +0 -0
- package/dist/types/types/src/index.d.ts +0 -0
- package/dist/types/types/src/login.d.ts +0 -0
- package/dist/types/types/src/logout.d.ts +0 -0
- package/dist/types/types/src/utils.d.ts +0 -0
- package/dist/types/utils/imports.d.ts +0 -0
- package/dist/types/utils/index.d.ts +0 -0
- package/dist/types/utils/src/Input.d.ts +0 -0
- package/dist/types/utils/src/config.d.ts +0 -0
- package/dist/types/utils/src/index.d.ts +0 -0
- package/package.json +2 -17
- package/dist/index.d.ts +0 -813
- package/dist/types/functions/read_utils/src/utils.d.ts +0 -8
- package/dist/types/functions/ui_utils/imports.d.ts +0 -4
- package/dist/types/functions/ui_utils/index.d.ts +0 -1
- package/dist/types/functions/ui_utils/src/button.d.ts +0 -5
- package/dist/types/functions/ui_utils/src/checkbox.d.ts +0 -4
- package/dist/types/functions/ui_utils/src/index.d.ts +0 -4
- package/dist/types/functions/ui_utils/src/input.d.ts +0 -5
- package/dist/types/functions/ui_utils/src/spinner.d.ts +0 -1
- package/dist/types/types/src/ChangePassword.d.ts +0 -16
- package/dist/types/ui/Navbar/DropDowns/DropDownElements.d.ts +0 -8
- package/dist/types/ui/Navbar/DropDowns/ForumsDropdown.d.ts +0 -2
- package/dist/types/ui/Navbar/DropDowns/index.d.ts +0 -3
- package/dist/types/ui/Navbar/NavBar.d.ts +0 -8
- package/dist/types/ui/Navbar/index.d.ts +0 -3
- package/dist/types/ui/index.d.ts +0 -1
package/dist/index.d.ts
DELETED
|
@@ -1,813 +0,0 @@
|
|
|
1
|
-
interface FileItem {
|
|
2
|
-
id: number | string;
|
|
3
|
-
filename: string;
|
|
4
|
-
uploader_id: string;
|
|
5
|
-
filepath: string;
|
|
6
|
-
created_at: string;
|
|
7
|
-
download_count: number;
|
|
8
|
-
download_limit: number | null;
|
|
9
|
-
shareable: boolean;
|
|
10
|
-
needsPassword: boolean;
|
|
11
|
-
share_password: string | null;
|
|
12
|
-
}
|
|
13
|
-
interface ApiRow {
|
|
14
|
-
id: number | string;
|
|
15
|
-
filename: string;
|
|
16
|
-
uploader_id: string;
|
|
17
|
-
filepath: string;
|
|
18
|
-
created_at: string;
|
|
19
|
-
download_count: number;
|
|
20
|
-
download_limit: number | null;
|
|
21
|
-
shareable: boolean;
|
|
22
|
-
needsPassword: boolean;
|
|
23
|
-
share_password: string;
|
|
24
|
-
}
|
|
25
|
-
interface FileListResponse {
|
|
26
|
-
files?: ApiRow[];
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface AppConfig {
|
|
30
|
-
BASE_API_URL: string;
|
|
31
|
-
BASE_OTHER_URL: string;
|
|
32
|
-
FEATURE_FLAG?: boolean;
|
|
33
|
-
SOME_NUMBER?: number;
|
|
34
|
-
}
|
|
35
|
-
interface Promise$1<AppConfig> {
|
|
36
|
-
BASE_URL: string;
|
|
37
|
-
BASE_API_URL: string;
|
|
38
|
-
FEATURE_FLAG?: boolean;
|
|
39
|
-
SOME_NUMBER?: number;
|
|
40
|
-
}
|
|
41
|
-
interface InputProps {
|
|
42
|
-
label?: any;
|
|
43
|
-
type?: any;
|
|
44
|
-
value?: any;
|
|
45
|
-
onChange?: any;
|
|
46
|
-
disabled?: any;
|
|
47
|
-
placeholder?: any;
|
|
48
|
-
error?: string;
|
|
49
|
-
}
|
|
50
|
-
type UrlKey = Extract<keyof AppConfig, `BASE_${string}_URL`>;
|
|
51
|
-
interface FetchVariables {
|
|
52
|
-
method: string;
|
|
53
|
-
headers: Record<string, string>;
|
|
54
|
-
body?: string | FormData;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Helpers for dealing with the JWT stored in localStorage.
|
|
58
|
-
*/
|
|
59
|
-
interface JwtPayload {
|
|
60
|
-
/** UNIX-epoch seconds (standard exp claim) */
|
|
61
|
-
exp: number;
|
|
62
|
-
/** Your backend also stores the username here */
|
|
63
|
-
username?: string;
|
|
64
|
-
/** Any other claims are allowed */
|
|
65
|
-
[key: string]: unknown;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
interface LogoutButtonProps {
|
|
69
|
-
/** Fired after the user is fully logged out so you can redirect to /login */
|
|
70
|
-
onLoggedOut?: () => void;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
interface LoginProps {
|
|
74
|
-
onSuccess?: () => void;
|
|
75
|
-
}
|
|
76
|
-
interface LoginFormProps {
|
|
77
|
-
username: string;
|
|
78
|
-
setUsername: (value: string) => void;
|
|
79
|
-
password: string;
|
|
80
|
-
setPassword: (value: string) => void;
|
|
81
|
-
error: string | null;
|
|
82
|
-
busy: boolean;
|
|
83
|
-
onSubmit: (e: React.FormEvent) => void;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
declare function getSafeDocument(): Document | undefined;
|
|
87
|
-
declare function getDocumentProp<K1 extends keyof Document>(prop1: K1): Document[K1] | undefined;
|
|
88
|
-
declare function getDocumentProp<K1 extends keyof Document, K2 extends keyof NonNullable<Document[K1]>>(prop1: K1, prop2: K2): NonNullable<Document[K1]>[K2] | undefined;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Returns `window` if running in a browser, otherwise `undefined`.
|
|
92
|
-
*/
|
|
93
|
-
declare function getSafeLocalStorage(): Storage | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Call a Storage method by name, silencing any errors or missing storage.
|
|
96
|
-
*
|
|
97
|
-
* @param method One of the keys of the Storage interface: "getItem", "setItem", etc.
|
|
98
|
-
* @param args The arguments you’d normally pass to that method.
|
|
99
|
-
* @returns The method’s return value, or undefined if storage/method isn’t available.
|
|
100
|
-
*/
|
|
101
|
-
declare function callStorage<K extends keyof Storage>(method: K, ...args: Parameters<Storage[K]>): ReturnType<Storage[K]> | undefined;
|
|
102
|
-
/**
|
|
103
|
-
* Safely call storage methods (`localStorage` or `sessionStorage`) without blowing up.
|
|
104
|
-
* Returns `undefined` on any error.
|
|
105
|
-
*/
|
|
106
|
-
declare function safeStorage<S extends "localStorage" | "sessionStorage", K extends keyof Storage>(storageName: S, method: K, ...args: Parameters<Storage[K]>): ReturnType<Storage[K]> | undefined;
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Safely walk `globalThis` (or window/document) by a chain of property names.
|
|
110
|
-
* Returns `undefined` if any step is missing.
|
|
111
|
-
*/
|
|
112
|
-
declare function safeGlobalProp<T = any>(...path: string[]): T | undefined;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* Returns the global window object if it exists, otherwise undefined.
|
|
116
|
-
*/
|
|
117
|
-
declare function getSafeWindow(): Window | undefined;
|
|
118
|
-
/**
|
|
119
|
-
* Safely call a method on window by name.
|
|
120
|
-
*
|
|
121
|
-
* @param method The Window method to call (e.g. "alert", "open", etc.).
|
|
122
|
-
* @param args Arguments to pass to that method.
|
|
123
|
-
* @returns The method’s return value, or undefined if
|
|
124
|
-
* window/method isn’t available or throws.
|
|
125
|
-
*/
|
|
126
|
-
declare function callWindowMethod<K extends keyof Window, F extends Window[K] = Window[K], Args extends any[] = F extends (...a: infer P) => any ? P : never, R = F extends (...a: any) => infer U ? U : void>(method: K, ...args: Args): R | undefined;
|
|
127
|
-
/** overloads for 1‐ and 2‐level deep props */
|
|
128
|
-
declare function getWindowProp<K1 extends keyof Window>(prop1: K1): Window[K1] | undefined;
|
|
129
|
-
declare function getWindowProp<K1 extends keyof Window, K2 extends keyof NonNullable<Window[K1]>>(prop1: K1, prop2: K2): NonNullable<Window[K1]>[K2] | undefined;
|
|
130
|
-
declare function getWindowHost(): string | undefined;
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Helpers for dealing with the JWT stored in localStorage.
|
|
134
|
-
*/
|
|
135
|
-
|
|
136
|
-
/** True if token is structurally bad or its exp ≤ now. */
|
|
137
|
-
declare function isTokenExpired(token: string): boolean;
|
|
138
|
-
declare function decodeJwt(token: string): JwtPayload;
|
|
139
|
-
|
|
140
|
-
declare const PROTOCOL = "https://";
|
|
141
|
-
declare const DOMAIN_NAME = "abstractendeavors";
|
|
142
|
-
declare const BASE_URL = "https://abstractendeavors.com";
|
|
143
|
-
declare const SUB_DIR = "secure-files";
|
|
144
|
-
declare const PROD_PREFIX = "/secure-files/";
|
|
145
|
-
declare const API_PREFIX = "/secure-files/api";
|
|
146
|
-
declare const DEV_PREFIX = "/secure-files-dev/";
|
|
147
|
-
|
|
148
|
-
declare function get_window(): (Window & typeof globalThis) | null;
|
|
149
|
-
declare function get_window_location(): Location | "https://abstractendeavors.com" | null;
|
|
150
|
-
declare function get_window_pathname(): string | null;
|
|
151
|
-
declare function get_window_parts(): Location | "https://abstractendeavors.com" | null;
|
|
152
|
-
|
|
153
|
-
declare function fetchIt<T>(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<T>;
|
|
154
|
-
declare function fetchIt(url: any, body?: any, method?: any, headers?: Record<string, string> | null, blob?: boolean, configUrl?: boolean, withCredentials?: boolean, returnJson?: boolean, returnReult?: boolean): Promise<Blob>;
|
|
155
|
-
declare function getHtmlDirectory(directory: string, filename: string): string;
|
|
156
|
-
declare function fetchIndexHtml(filename: string, directory?: string, base?: string): Promise<string>;
|
|
157
|
-
declare function fetchIndexHtmlContainer(filename: string, doc?: Document, directory?: string): Promise<void>;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Reads a JSON file, either via Node’s fs (if available)
|
|
161
|
-
* or via window.fetch in the browser. Never throws — returns
|
|
162
|
-
* the parsed object or null on any error.
|
|
163
|
-
*/
|
|
164
|
-
declare function readJsonFile<T = any>(relativeOrAbsolutePath: string): Promise<T | null>;
|
|
165
|
-
declare function getConfigContent<T = Record<string, any>>(): Promise<T | null>;
|
|
166
|
-
declare function getConfigVar<T = any>(key?: any): Promise<T | undefined>;
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Unwraps nested { result } fields until you hit a non-object or no more "result" keys.
|
|
170
|
-
*/
|
|
171
|
-
declare function getResult<T>(obj: unknown): T;
|
|
172
|
-
declare function getMethod(method?: string | null, body?: unknown): string;
|
|
173
|
-
declare function getHeaders(headers?: Record<string, string>, method?: string | null, body?: unknown): Record<string, string>;
|
|
174
|
-
declare function getBody(body?: unknown, method?: string | null): string | undefined;
|
|
175
|
-
declare function getFetchVars(headers?: Record<string, string> | null, method?: string | null, body?: any): FetchVariables;
|
|
176
|
-
declare function parseResult(res: Response): Promise<unknown>;
|
|
177
|
-
/**
|
|
178
|
-
* Intercept 401/403 and force a clean redirect to login
|
|
179
|
-
* without ever showing an alert.
|
|
180
|
-
*/
|
|
181
|
-
declare function checkResponse(res: Response): Response;
|
|
182
|
-
|
|
183
|
-
declare function urlJoin(...parts: (string | undefined | null)[]): string;
|
|
184
|
-
/**
|
|
185
|
-
* Returns a full URL.
|
|
186
|
-
* If partial_url is already absolute (starts with http), it is returned as is.
|
|
187
|
-
* Otherwise, it is combined with the base URL.
|
|
188
|
-
*/
|
|
189
|
-
declare function get_full_url(partial_url: any, domain?: any): string;
|
|
190
|
-
/**
|
|
191
|
-
* Returns a full file system path.
|
|
192
|
-
* If partial_path is already absolute, it is returned as is.
|
|
193
|
-
* Otherwise, it is joined with the base directory.
|
|
194
|
-
*/
|
|
195
|
-
declare function get_full_path(partial_path: any, parent_dir?: any): string;
|
|
196
|
-
/**
|
|
197
|
-
* Converts a local file system path into its corresponding URL.
|
|
198
|
-
* It checks against the known directories in all_paths and replaces the matching base.
|
|
199
|
-
*/
|
|
200
|
-
declare function path_to_url(filePath: string, all_paths: any): string | null;
|
|
201
|
-
/**
|
|
202
|
-
* Converts a URL into its corresponding local file system path.
|
|
203
|
-
* It checks against the known URL prefixes in all_paths and replaces the matching base.
|
|
204
|
-
*/
|
|
205
|
-
declare function url_to_path(urlStr: string, all_paths: any): string | null;
|
|
206
|
-
declare function urljoin(...parts: (string | undefined | null)[]): string;
|
|
207
|
-
|
|
208
|
-
declare function get_dirname(filePath: string | null): string;
|
|
209
|
-
declare function get_basename(filePath: string | null): string;
|
|
210
|
-
declare function get_filename(filePath: string): string;
|
|
211
|
-
declare function get_extname(filePath: string | null): string;
|
|
212
|
-
declare function get_splitext(filePath: string | null): {
|
|
213
|
-
filename: string;
|
|
214
|
-
extname: string;
|
|
215
|
-
ext?: undefined;
|
|
216
|
-
} | {
|
|
217
|
-
filename: string;
|
|
218
|
-
ext: string;
|
|
219
|
-
extname?: undefined;
|
|
220
|
-
};
|
|
221
|
-
/**
|
|
222
|
-
* Returns the path of `targetPath` relative to `basePath`.
|
|
223
|
-
* Normalizes separators for consistent web and server environments.
|
|
224
|
-
*
|
|
225
|
-
* @param basePath - The base directory you want to compare from.
|
|
226
|
-
* @param targetPath - The full path of the file/directory.
|
|
227
|
-
* @returns A normalized relative path (e.g., "subdir/file.txt").
|
|
228
|
-
*/
|
|
229
|
-
declare function get_relative_path(basePath: string, targetPath: string): string;
|
|
230
|
-
/**
|
|
231
|
-
* Join multiple path segments — clean, predictable, bulletproof.
|
|
232
|
-
*
|
|
233
|
-
* Accepts ANYTHING that ensure_list can handle:
|
|
234
|
-
* • 'a,b,c'
|
|
235
|
-
* • ['a', 'b,c']
|
|
236
|
-
* • 'a/b/c'
|
|
237
|
-
* • '/a/', 'b//c'
|
|
238
|
-
* • mixed arrays, comma strings, whatever
|
|
239
|
-
*
|
|
240
|
-
* Always returns a clean POSIX path string. Never a list.
|
|
241
|
-
*/
|
|
242
|
-
declare function make_path(...parts: any[]): string;
|
|
243
|
-
declare function sanitizeFilename(filename: string): string;
|
|
244
|
-
declare function make_sanitized_path(...paths: string[]): string;
|
|
245
|
-
declare function normalizeUrl(base: string, p?: string): string;
|
|
246
|
-
declare function pathjoin(...parts: any[]): string;
|
|
247
|
-
declare function pathJoin(...parts: any[]): string;
|
|
248
|
-
declare function makepath(...parts: any[]): string;
|
|
249
|
-
declare function makePath(...parts: any[]): string;
|
|
250
|
-
declare function path_join(...parts: any[]): string;
|
|
251
|
-
declare function getSplitext(filePath: string | null): {
|
|
252
|
-
filename: string;
|
|
253
|
-
extname: string;
|
|
254
|
-
ext?: undefined;
|
|
255
|
-
} | {
|
|
256
|
-
filename: string;
|
|
257
|
-
ext: string;
|
|
258
|
-
extname?: undefined;
|
|
259
|
-
};
|
|
260
|
-
declare function getsplitext(filePath: string | null): {
|
|
261
|
-
filename: string;
|
|
262
|
-
extname: string;
|
|
263
|
-
ext?: undefined;
|
|
264
|
-
} | {
|
|
265
|
-
filename: string;
|
|
266
|
-
ext: string;
|
|
267
|
-
extname?: undefined;
|
|
268
|
-
};
|
|
269
|
-
declare function getextname(filePath: string | null): string;
|
|
270
|
-
declare function getExtname(filePath: string | null): string;
|
|
271
|
-
declare function getfilename(filePath: string): string;
|
|
272
|
-
declare function getFilename(filePath: string): string;
|
|
273
|
-
declare function getbasename(filePath: string | null): string;
|
|
274
|
-
declare function getBasename(filePath: string | null): string;
|
|
275
|
-
declare function getdirname(filePath: string | null): string;
|
|
276
|
-
declare function getDirname(filePath: string | null): string;
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Returns the absolute path of the current file.
|
|
280
|
-
*/
|
|
281
|
-
declare function getAbsDir(): string;
|
|
282
|
-
declare function getAbsPath(subPath: string): string;
|
|
283
|
-
|
|
284
|
-
declare function getFunctionsDir(): string;
|
|
285
|
-
declare function geAuthsUtilsDirectory(): string;
|
|
286
|
-
declare function geBackupsUtilsDirectory(): string;
|
|
287
|
-
declare function geConstantsUtilsDirectory(): string;
|
|
288
|
-
declare function geEnvUtilsDirectory(): string;
|
|
289
|
-
declare function geFetchUtilsDirectory(): string;
|
|
290
|
-
declare function geFileUtilsDirectory(): string;
|
|
291
|
-
declare function gePathUtilsDirectory(): string;
|
|
292
|
-
declare function geStringUtilsDirectory(): string;
|
|
293
|
-
declare function geTypeUtilsDirectory(): string;
|
|
294
|
-
|
|
295
|
-
declare function getSrcDir(): string;
|
|
296
|
-
declare function geStaticDirectory(): string;
|
|
297
|
-
declare function getLibUtilsDirectory(): string;
|
|
298
|
-
declare function getHooksUtilsDirectory(): string;
|
|
299
|
-
declare function getFunctionsUtilsDirectory(): string;
|
|
300
|
-
declare function getComponentsUtilsDirectory(): string;
|
|
301
|
-
|
|
302
|
-
declare function getBaseDir(): string;
|
|
303
|
-
declare function getPublicDir(): string;
|
|
304
|
-
declare function getDistDir(): string;
|
|
305
|
-
declare function getEnvDir(): string;
|
|
306
|
-
|
|
307
|
-
declare function getEnvPath(string?: string): string;
|
|
308
|
-
declare function getDbConfigsPath(): string;
|
|
309
|
-
declare function getSchemasPath(): string;
|
|
310
|
-
declare function getSchemasDirPath(subPath: string): string;
|
|
311
|
-
|
|
312
|
-
declare function alertit(obj?: any): void;
|
|
313
|
-
|
|
314
|
-
declare function getSubstring(obj: string, maxLength?: number | null, minLength?: number | null): string;
|
|
315
|
-
/**
|
|
316
|
-
* Sanitize a string by removing null bytes and trimming whitespace.
|
|
317
|
-
*/
|
|
318
|
-
declare function sanitizeString(input: string): string;
|
|
319
|
-
declare function truncateString(obj: string, maxLength?: number): string;
|
|
320
|
-
declare function capitalize_str(string: any): string;
|
|
321
|
-
declare function capitalize(string: any): string;
|
|
322
|
-
declare function stripPrefixes(str: string, bases?: string | string[]): string;
|
|
323
|
-
declare function tryEatPrefix(str: string, length: number, ...objs: any[]): [string, boolean];
|
|
324
|
-
/** Python-equivalent eatInner */
|
|
325
|
-
declare function eatInner(str: any, listObjects: any): string;
|
|
326
|
-
/** Python-equivalent eatOuter */
|
|
327
|
-
declare function eatOuter(str: any, listObjects: any): string;
|
|
328
|
-
/** Python-equivalent eatAll */
|
|
329
|
-
declare function eatAll(str: any, listObjects: any): string;
|
|
330
|
-
/** Python-equivalent eatElse */
|
|
331
|
-
declare function eatElse(stringObj: any, chars?: any, ints?: boolean, alpha?: boolean, lower?: boolean, capitalize?: boolean, string?: boolean, listObj?: boolean): string;
|
|
332
|
-
declare function tryParse(obj: any): any;
|
|
333
|
-
declare function create_list_string(array_obj: any): string;
|
|
334
|
-
declare function eatall(str: any, listObjects: any): string;
|
|
335
|
-
declare function eatinner(str: any, listObjects: any): string;
|
|
336
|
-
declare function eatouter(str: any, listObjects: any): string;
|
|
337
|
-
|
|
338
|
-
/**
|
|
339
|
-
* Checks if a value is enclosed in quotes.
|
|
340
|
-
*/
|
|
341
|
-
declare function ends_in_quotes(value: any): boolean;
|
|
342
|
-
declare function stripQuotes(value: any): any;
|
|
343
|
-
|
|
344
|
-
declare function safeNums(...args: Array<number | string | null | undefined>): number[];
|
|
345
|
-
declare function safeDivide(...args: Array<number | string | null | undefined>): number;
|
|
346
|
-
declare function safeMultiply(...args: Array<number | string | null | undefined>): number;
|
|
347
|
-
declare function roundPercentage(x: any): number;
|
|
348
|
-
declare function exponential(i: number, k: number): number;
|
|
349
|
-
declare function isZero(obj: any): boolean;
|
|
350
|
-
|
|
351
|
-
type Second = 'sec' | 's' | 'second';
|
|
352
|
-
type Hour = 'h' | 'hour';
|
|
353
|
-
type Minute = 'm' | 'min' | 'minute';
|
|
354
|
-
type Day = 'day' | 'd';
|
|
355
|
-
type Mile = 'mi' | 'mile';
|
|
356
|
-
type Kilometer = 'km' | 'kilometer';
|
|
357
|
-
type Foot = 'ft' | 'f' | 'foot';
|
|
358
|
-
type Meter = 'm' | 'meter';
|
|
359
|
-
interface TargetAltIn {
|
|
360
|
-
angleDeg?: number | null;
|
|
361
|
-
targetAlt: number | null;
|
|
362
|
-
altUnit: DistanceUnit;
|
|
363
|
-
targetVel?: number | null;
|
|
364
|
-
velDistUnit?: DistanceUnit;
|
|
365
|
-
velTimeUnit?: TimeUnit;
|
|
366
|
-
startVel?: number | null;
|
|
367
|
-
startVelDist?: DistanceUnit;
|
|
368
|
-
startVelTime?: TimeUnit;
|
|
369
|
-
}
|
|
370
|
-
interface TargetVelIn {
|
|
371
|
-
angleDeg?: number | null;
|
|
372
|
-
targetAlt?: number | null;
|
|
373
|
-
altUnit?: DistanceUnit;
|
|
374
|
-
targetVel: number | null;
|
|
375
|
-
velDistUnit: DistanceUnit;
|
|
376
|
-
velTimeUnit: TimeUnit;
|
|
377
|
-
startVel?: number | null;
|
|
378
|
-
startVelDist?: DistanceUnit;
|
|
379
|
-
startVelTime?: TimeUnit;
|
|
380
|
-
}
|
|
381
|
-
interface StartVelIn {
|
|
382
|
-
angleDeg?: number | null;
|
|
383
|
-
targetAlt?: number | null;
|
|
384
|
-
altUnit?: DistanceUnit;
|
|
385
|
-
targetVel?: number | null;
|
|
386
|
-
velDistUnit?: DistanceUnit;
|
|
387
|
-
velTimeUnit?: TimeUnit;
|
|
388
|
-
startVel: number | null;
|
|
389
|
-
startVelDist: DistanceUnit;
|
|
390
|
-
startVelTime: TimeUnit;
|
|
391
|
-
}
|
|
392
|
-
interface OutSpeeds {
|
|
393
|
-
v: number;
|
|
394
|
-
d?: DistanceUnit;
|
|
395
|
-
t?: TimeUnit;
|
|
396
|
-
}
|
|
397
|
-
interface OutTimes {
|
|
398
|
-
t: number;
|
|
399
|
-
T?: TimeUnit;
|
|
400
|
-
}
|
|
401
|
-
interface ConvertDistance {
|
|
402
|
-
d: number;
|
|
403
|
-
fromDist: DistanceUnit;
|
|
404
|
-
toDist?: DistanceUnit;
|
|
405
|
-
vOnly?: boolean;
|
|
406
|
-
}
|
|
407
|
-
interface ConvertDistance {
|
|
408
|
-
d: number;
|
|
409
|
-
fromDist: DistanceUnit;
|
|
410
|
-
toDist?: DistanceUnit;
|
|
411
|
-
vOnly?: boolean;
|
|
412
|
-
}
|
|
413
|
-
interface ConvertTime {
|
|
414
|
-
t: number;
|
|
415
|
-
fromTime: TimeUnit;
|
|
416
|
-
toTime?: TimeUnit;
|
|
417
|
-
vOnly?: boolean;
|
|
418
|
-
}
|
|
419
|
-
interface ConvertTime {
|
|
420
|
-
t: number;
|
|
421
|
-
fromTime: TimeUnit;
|
|
422
|
-
toTime?: TimeUnit;
|
|
423
|
-
vOnly?: boolean;
|
|
424
|
-
}
|
|
425
|
-
interface ConvertSpeed {
|
|
426
|
-
v: number;
|
|
427
|
-
fromDist: DistanceUnit;
|
|
428
|
-
fromTime: TimeUnit;
|
|
429
|
-
toDist?: DistanceUnit;
|
|
430
|
-
toTime?: TimeUnit;
|
|
431
|
-
vOnly?: boolean;
|
|
432
|
-
}
|
|
433
|
-
interface ConvertSpeed {
|
|
434
|
-
v: number;
|
|
435
|
-
fromDist: DistanceUnit;
|
|
436
|
-
fromTime: TimeUnit;
|
|
437
|
-
toDist?: DistanceUnit;
|
|
438
|
-
toTime?: TimeUnit;
|
|
439
|
-
vOnly?: boolean;
|
|
440
|
-
}
|
|
441
|
-
type CanonDist = "m" | "km" | "mi" | "ft";
|
|
442
|
-
type CanonTime = "s" | "min" | "h" | "day";
|
|
443
|
-
type DistanceUnit = "m" | "meter" | "meters" | "km" | "kms" | "kilometer" | "kilometers" | "mi" | "mile" | "miles" | "ft" | "foot" | "feet" | "f";
|
|
444
|
-
type TimeUnit = "s" | "sec" | "second" | "seconds" | "min" | "m" | "minute" | "minutes" | "h" | "hr" | "hour" | "hours" | "day" | "d" | "days";
|
|
445
|
-
interface VelocityUnit {
|
|
446
|
-
D: DistanceUnit;
|
|
447
|
-
T: TimeUnit;
|
|
448
|
-
}
|
|
449
|
-
interface OutDistance {
|
|
450
|
-
d: number;
|
|
451
|
-
D?: DistanceUnit;
|
|
452
|
-
}
|
|
453
|
-
interface OutDistance {
|
|
454
|
-
d: number;
|
|
455
|
-
D?: DistanceUnit;
|
|
456
|
-
}
|
|
457
|
-
interface OutTime {
|
|
458
|
-
t: number;
|
|
459
|
-
T?: TimeUnit;
|
|
460
|
-
}
|
|
461
|
-
interface OutSpeed {
|
|
462
|
-
v: number;
|
|
463
|
-
d?: DistanceUnit;
|
|
464
|
-
t?: TimeUnit;
|
|
465
|
-
}
|
|
466
|
-
type OutDist = OutDistance | number | null;
|
|
467
|
-
type OutTimeType = OutTime | number | null;
|
|
468
|
-
type OutSpeedType = OutSpeed | number | null;
|
|
469
|
-
|
|
470
|
-
declare const DIST_ALIASES: Record<string, CanonDist>;
|
|
471
|
-
declare const TIME_ALIASES: Record<string, CanonTime>;
|
|
472
|
-
declare const DIST_FACTORS: Record<CanonDist, number>;
|
|
473
|
-
declare const TIME_FACTORS: Record<CanonTime, number>;
|
|
474
|
-
declare function canonDist(u: DistanceUnit | string | undefined): CanonDist;
|
|
475
|
-
declare function canonTime(u: TimeUnit | string | undefined): CanonTime;
|
|
476
|
-
declare function distanceToMeters(d: number, unit: DistanceUnit | string): number;
|
|
477
|
-
declare function metersToDistance(v: number, unit: DistanceUnit | string): number;
|
|
478
|
-
declare function timeToSeconds(t: number, unit: TimeUnit | string): number;
|
|
479
|
-
declare function secondsToTime(v: number, unit: TimeUnit | string): number;
|
|
480
|
-
declare function speedToMps(v: number, distUnit: DistanceUnit | string, timeUnit: TimeUnit | string): number;
|
|
481
|
-
declare function mpsToSpeed(vMps: number, distUnit: DistanceUnit | string, timeUnit: TimeUnit | string): number;
|
|
482
|
-
declare function convertDistance({ d, fromDist, toDist, vOnly, }: ConvertDistance): OutDist;
|
|
483
|
-
declare function convertTime({ t, fromTime, toTime, vOnly, }: ConvertTime): OutTimeType;
|
|
484
|
-
declare function convertSpeed({ v, fromDist, fromTime, toDist, toTime, vOnly, }: ConvertSpeed): OutSpeedType;
|
|
485
|
-
interface UnitConverter<T> {
|
|
486
|
-
normalize: (value: number, unit: T) => number;
|
|
487
|
-
unnormalize: (value: number, unit: T) => number;
|
|
488
|
-
}
|
|
489
|
-
declare const DistanceConverter: UnitConverter<DistanceUnit>;
|
|
490
|
-
declare const TimeConverter: UnitConverter<TimeUnit>;
|
|
491
|
-
declare const SpeedConverter: UnitConverter<[DistanceUnit, TimeUnit]>;
|
|
492
|
-
declare const toMeters: typeof distanceToMeters;
|
|
493
|
-
declare const fromMeters: typeof metersToDistance;
|
|
494
|
-
declare const toSeconds: typeof timeToSeconds;
|
|
495
|
-
declare const fromSeconds: typeof secondsToTime;
|
|
496
|
-
declare const velocityToMs: (value: number, unit: string) => number;
|
|
497
|
-
declare const velocityFromMs: (value: number, unit: string) => number;
|
|
498
|
-
/** Non-canonical helper for arbitrary rate conversion, e.g. ft/day → m/s */
|
|
499
|
-
declare const fromMps: (v: number, dist_unit: DistanceUnit | string, time_unit: TimeUnit | string) => number;
|
|
500
|
-
declare const isFiniteNum: (x: any) => x is number;
|
|
501
|
-
declare const fmt: (n: number, digits?: number) => string;
|
|
502
|
-
|
|
503
|
-
declare const SECOND: number;
|
|
504
|
-
declare const ZEPTOSECOND: number;
|
|
505
|
-
declare const ATTOSECOND: number;
|
|
506
|
-
declare const FEMTOSECOND: number;
|
|
507
|
-
declare const PICOSECOND: number;
|
|
508
|
-
declare const NANOSECOND: number;
|
|
509
|
-
declare const MICROSECOND: number;
|
|
510
|
-
declare const MILISECOND: number;
|
|
511
|
-
declare const CENTISECOND: number;
|
|
512
|
-
declare const DECISECOND: number;
|
|
513
|
-
declare const MINUTE: number;
|
|
514
|
-
declare const HOUR: number;
|
|
515
|
-
declare const DAY: number;
|
|
516
|
-
declare const YEAR: number;
|
|
517
|
-
declare const MONTH: number;
|
|
518
|
-
declare const SECONDS_PER_MINUTE: number;
|
|
519
|
-
declare const SECONDS_PER_HOUR: number;
|
|
520
|
-
declare const SECONDS_PER_DAY: number;
|
|
521
|
-
declare const PI: number;
|
|
522
|
-
declare const PI2: number;
|
|
523
|
-
declare const METERS_PER_KM = 1000;
|
|
524
|
-
declare const METERS_PER_MILE = 1609.34;
|
|
525
|
-
declare const METERS_PER_FOOT = 0.3048;
|
|
526
|
-
declare const KMS_PER_METER: number;
|
|
527
|
-
declare const MILES_PER_METER: number;
|
|
528
|
-
declare const FEET_PER_METER: number;
|
|
529
|
-
declare const MIN_IN_S: number;
|
|
530
|
-
declare const HOUR_IN_S: number;
|
|
531
|
-
declare const DAY_IN_S: number;
|
|
532
|
-
declare const YEAR_IN_S: number;
|
|
533
|
-
declare const MONTH_IN_S: number;
|
|
534
|
-
declare const MiPerH_TO_MPerS: number;
|
|
535
|
-
declare const MPerS_TO_MiPerH: number;
|
|
536
|
-
|
|
537
|
-
declare function isTimeInterval(timeObj: number, interval: number): boolean;
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* Recursively traverse the object and convert BigInts to numbers or strings.
|
|
541
|
-
*
|
|
542
|
-
* @param {object|array} obj - The object to traverse
|
|
543
|
-
* @param {boolean} convertToNumber - Whether to convert BigInt to Number (default is true)
|
|
544
|
-
* @returns {object|array} - The transformed object
|
|
545
|
-
*/
|
|
546
|
-
declare function convertBigInts(obj: any, convertToNumber?: boolean): any;
|
|
547
|
-
|
|
548
|
-
declare function cleanText(input: any): any;
|
|
549
|
-
declare function cleanArray(obj: any): unknown[];
|
|
550
|
-
declare function getCleanArray(obj: any): unknown[];
|
|
551
|
-
declare function formatNumber<T>(value: T): string | T;
|
|
552
|
-
|
|
553
|
-
declare function ensure_list(obj: any): any[];
|
|
554
|
-
declare function ensure_number(x: any): number;
|
|
555
|
-
declare function ensure_string(obj: any): string;
|
|
556
|
-
declare function ensurelist(obj: any): any[];
|
|
557
|
-
declare function assureList(obj: any): any[];
|
|
558
|
-
declare function assure_list(obj: any): any[];
|
|
559
|
-
declare function ensureList(obj: any): any[];
|
|
560
|
-
declare function assurelist(obj: any): any[];
|
|
561
|
-
declare function ensurenumber(x: any): number;
|
|
562
|
-
declare function assureNumber(x: any): number;
|
|
563
|
-
declare function ensureNumber(x: any): number;
|
|
564
|
-
declare function assurenumber(x: any): number;
|
|
565
|
-
declare function assure_number(x: any): number;
|
|
566
|
-
declare function ensurestring(obj: any): string;
|
|
567
|
-
declare function ensureString(obj: any): string;
|
|
568
|
-
declare function assureString(obj: any): string;
|
|
569
|
-
declare function assurestring(obj: any): string;
|
|
570
|
-
declare function assure_string(obj: any): string;
|
|
571
|
-
declare function assurearray(obj: any): any[];
|
|
572
|
-
declare function ensurearray(obj: any): any[];
|
|
573
|
-
declare function ensure_array(obj: any): any[];
|
|
574
|
-
declare function ensureArray(obj: any): any[];
|
|
575
|
-
declare function assure_array(obj: any): any[];
|
|
576
|
-
declare function assureArray(obj: any): any[];
|
|
577
|
-
|
|
578
|
-
declare function get_key_value<T extends object>(obj: T, key: string): any;
|
|
579
|
-
declare function get<T extends object>(obj: T | null | undefined, keys: string | string[], defaultValue?: any): any;
|
|
580
|
-
declare function findKeyValue(obj: Record<string, any>, keyToFind: string): any;
|
|
581
|
-
declare function omitKeys<T extends object, K extends keyof T>(obj: T, ...keys: K[]): Omit<T, K>;
|
|
582
|
-
/**
|
|
583
|
-
* Extracts necessary properties from the insertValue to prevent circular references.
|
|
584
|
-
*
|
|
585
|
-
* @param insertValue - The original RPC result.
|
|
586
|
-
* @returns A new object with only the required properties.
|
|
587
|
-
*/
|
|
588
|
-
declare function extractInsertData(insertValue: any): any;
|
|
589
|
-
declare function loadInnerJson(data: any): any;
|
|
590
|
-
|
|
591
|
-
declare function isType(obj: any, type: string): boolean;
|
|
592
|
-
declare function isStrInString(obj: any, string: any): boolean;
|
|
593
|
-
declare function getChar(i: number, string: any): string | undefined;
|
|
594
|
-
declare function getAlphaNum(obj: any): string | undefined;
|
|
595
|
-
declare function getNums(): string;
|
|
596
|
-
declare function isNum(obj: any): boolean;
|
|
597
|
-
declare function getAlphas(): string;
|
|
598
|
-
|
|
599
|
-
/** ---- Types ---- */
|
|
600
|
-
type MimeByExt = Record<string, string>;
|
|
601
|
-
type MediaMap = Record<string, MimeByExt>;
|
|
602
|
-
type MediaCategory = keyof typeof MIME_TYPES;
|
|
603
|
-
interface MediaOptions {
|
|
604
|
-
/** Alias to mirror the Python **kwargs['media_types'] behavior */
|
|
605
|
-
media_types?: Iterable<string> | string[] | null;
|
|
606
|
-
}
|
|
607
|
-
/** ---- Data: large but explicit, mirrors your Python mapping ---- */
|
|
608
|
-
declare const MIME_TYPES: {
|
|
609
|
-
readonly image: {
|
|
610
|
-
readonly ".jpg": "image/jpeg";
|
|
611
|
-
readonly ".jpeg": "image/jpeg";
|
|
612
|
-
readonly ".png": "image/png";
|
|
613
|
-
readonly ".gif": "image/gif";
|
|
614
|
-
readonly ".bmp": "image/bmp";
|
|
615
|
-
readonly ".tiff": "image/tiff";
|
|
616
|
-
readonly ".webp": "image/webp";
|
|
617
|
-
readonly ".svg": "image/svg+xml";
|
|
618
|
-
readonly ".ico": "image/vnd.microsoft.icon";
|
|
619
|
-
readonly ".heic": "image/heic";
|
|
620
|
-
readonly ".psd": "image/vnd.adobe.photoshop";
|
|
621
|
-
readonly ".raw": "image/x-raw";
|
|
622
|
-
};
|
|
623
|
-
readonly video: {
|
|
624
|
-
readonly ".mp4": "video/mp4";
|
|
625
|
-
readonly ".webm": "video/webm";
|
|
626
|
-
readonly ".ogg": "video/ogg";
|
|
627
|
-
readonly ".mov": "video/quicktime";
|
|
628
|
-
readonly ".avi": "video/x-msvideo";
|
|
629
|
-
readonly ".mkv": "video/x-matroska";
|
|
630
|
-
readonly ".flv": "video/x-flv";
|
|
631
|
-
readonly ".wmv": "video/x-ms-wmv";
|
|
632
|
-
readonly ".3gp": "video/3gpp";
|
|
633
|
-
readonly ".ts": "video/mp2t";
|
|
634
|
-
readonly ".mpeg": "video/mpeg";
|
|
635
|
-
readonly ".mpg": "video/mpg";
|
|
636
|
-
};
|
|
637
|
-
readonly audio: {
|
|
638
|
-
readonly ".mp3": "audio/mpeg";
|
|
639
|
-
readonly ".wav": "audio/wav";
|
|
640
|
-
readonly ".flac": "audio/flac";
|
|
641
|
-
readonly ".aac": "audio/aac";
|
|
642
|
-
readonly ".ogg": "audio/ogg";
|
|
643
|
-
readonly ".m4a": "audio/mp4";
|
|
644
|
-
readonly ".opus": "audio/opus";
|
|
645
|
-
};
|
|
646
|
-
readonly document: {
|
|
647
|
-
readonly ".pdf": "application/pdf";
|
|
648
|
-
readonly ".doc": "application/msword";
|
|
649
|
-
readonly ".docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
650
|
-
readonly ".odt": "application/vnd.oasis.opendocument.text";
|
|
651
|
-
readonly ".txt": "text/plain";
|
|
652
|
-
readonly ".rtf": "application/rtf";
|
|
653
|
-
readonly ".md": "text/markdown";
|
|
654
|
-
readonly ".markdown": "text/markdown";
|
|
655
|
-
readonly ".tex": "application/x-tex";
|
|
656
|
-
readonly ".log": "text/plain";
|
|
657
|
-
readonly ".json": "application/json";
|
|
658
|
-
readonly ".xml": "application/xml";
|
|
659
|
-
readonly ".yaml": "application/x-yaml";
|
|
660
|
-
readonly ".yml": "application/x-yaml";
|
|
661
|
-
readonly ".ini": "text/plain";
|
|
662
|
-
readonly ".cfg": "text/plain";
|
|
663
|
-
readonly ".toml": "application/toml";
|
|
664
|
-
readonly ".csv": "text/csv";
|
|
665
|
-
readonly ".tsv": "text/tab-separated-values";
|
|
666
|
-
};
|
|
667
|
-
readonly presentation: {
|
|
668
|
-
readonly ".ppt": "application/vnd.ms-powerpoint";
|
|
669
|
-
readonly ".pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
670
|
-
readonly ".odp": "application/vnd.oasis.opendocument.presentation";
|
|
671
|
-
};
|
|
672
|
-
readonly spreadsheet: {
|
|
673
|
-
readonly ".xls": "application/vnd.ms-excel";
|
|
674
|
-
readonly ".xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
|
|
675
|
-
readonly ".ods": "application/vnd.oasis.opendocument.spreadsheet";
|
|
676
|
-
readonly ".csv": "text/csv";
|
|
677
|
-
readonly ".tsv": "text/tab-separated-values";
|
|
678
|
-
};
|
|
679
|
-
readonly code: {
|
|
680
|
-
readonly ".py": "text/x-python";
|
|
681
|
-
readonly ".java": "text/x-java-source";
|
|
682
|
-
readonly ".c": "text/x-c";
|
|
683
|
-
readonly ".cpp": "text/x-c++";
|
|
684
|
-
readonly ".h": "text/x-c";
|
|
685
|
-
readonly ".hpp": "text/x-c++";
|
|
686
|
-
readonly ".js": "application/javascript";
|
|
687
|
-
readonly ".cjs": "application/javascript";
|
|
688
|
-
readonly ".mjs": "application/javascript";
|
|
689
|
-
readonly ".jsx": "application/javascript";
|
|
690
|
-
readonly ".ts": "application/typescript";
|
|
691
|
-
readonly ".tsx": "application/typescript";
|
|
692
|
-
readonly ".rb": "text/x-ruby";
|
|
693
|
-
readonly ".php": "application/x-php";
|
|
694
|
-
readonly ".go": "text/x-go";
|
|
695
|
-
readonly ".rs": "text/rust";
|
|
696
|
-
readonly ".swift": "text/x-swift";
|
|
697
|
-
readonly ".kt": "text/x-kotlin";
|
|
698
|
-
readonly ".sh": "application/x-shellscript";
|
|
699
|
-
readonly ".bash": "application/x-shellscript";
|
|
700
|
-
readonly ".ps1": "application/x-powershell";
|
|
701
|
-
readonly ".sql": "application/sql";
|
|
702
|
-
readonly ".yml": "application/x-yaml";
|
|
703
|
-
readonly ".coffee": "text/coffeescript";
|
|
704
|
-
readonly ".lua": "text/x-lua";
|
|
705
|
-
};
|
|
706
|
-
readonly archive: {
|
|
707
|
-
readonly ".zip": "application/zip";
|
|
708
|
-
readonly ".tar": "application/x-tar";
|
|
709
|
-
readonly ".gz": "application/gzip";
|
|
710
|
-
readonly ".tgz": "application/gzip";
|
|
711
|
-
readonly ".bz2": "application/x-bzip2";
|
|
712
|
-
readonly ".xz": "application/x-xz";
|
|
713
|
-
readonly ".rar": "application/vnd.rar";
|
|
714
|
-
readonly ".7z": "application/x-7z-compressed";
|
|
715
|
-
readonly ".iso": "application/x-iso9660-image";
|
|
716
|
-
readonly ".dmg": "application/x-apple-diskimage";
|
|
717
|
-
readonly ".jar": "application/java-archive";
|
|
718
|
-
readonly ".war": "application/java-archive";
|
|
719
|
-
readonly ".whl": "application/python-wheel";
|
|
720
|
-
readonly ".egg": "application/python-egg";
|
|
721
|
-
};
|
|
722
|
-
readonly font: {
|
|
723
|
-
readonly ".ttf": "font/ttf";
|
|
724
|
-
readonly ".otf": "font/otf";
|
|
725
|
-
readonly ".woff": "font/woff";
|
|
726
|
-
readonly ".woff2": "font/woff2";
|
|
727
|
-
readonly ".eot": "application/vnd.ms-fontobject";
|
|
728
|
-
};
|
|
729
|
-
readonly executable: {
|
|
730
|
-
readonly ".exe": "application/vnd.microsoft.portable-executable";
|
|
731
|
-
readonly ".dll": "application/vnd.microsoft.portable-executable";
|
|
732
|
-
readonly ".bin": "application/octet-stream";
|
|
733
|
-
readonly ".deb": "application/vnd.debian.binary-package";
|
|
734
|
-
readonly ".rpm": "application/x-rpm";
|
|
735
|
-
};
|
|
736
|
-
};
|
|
737
|
-
/** Mirror of MEDIA_TYPES in Python: category -> Set of extensions */
|
|
738
|
-
declare const MEDIA_TYPES: Record<MediaCategory, Set<string>>;
|
|
739
|
-
/** ---- API (Python parity) ---- */
|
|
740
|
-
/**
|
|
741
|
-
* Return a sub-map of MEDIA_TYPES for the given categories.
|
|
742
|
-
* If categories is falsy, returns all categories.
|
|
743
|
-
*/
|
|
744
|
-
declare function getMediaMap(categories?: Iterable<string> | string[] | null, opts?: MediaOptions): Partial<Record<MediaCategory, Set<string>>>;
|
|
745
|
-
/**
|
|
746
|
-
* Return a flat, sorted list of all extensions for the given categories.
|
|
747
|
-
*/
|
|
748
|
-
declare function getMediaExts(categories?: Iterable<string> | string[] | null, opts?: MediaOptions): string[];
|
|
749
|
-
/**
|
|
750
|
-
* Given a file path or extension, return its media category (e.g. "image") or null.
|
|
751
|
-
* Mirrors Python's confirm_type.
|
|
752
|
-
*/
|
|
753
|
-
declare function confirmType(pathOrExt: string, categories?: Iterable<string> | string[] | null, opts?: MediaOptions): MediaCategory | null;
|
|
754
|
-
/**
|
|
755
|
-
* True if the given file path or extension belongs to one of the categories.
|
|
756
|
-
*/
|
|
757
|
-
declare function isMediaType(pathOrExt: string, categories?: Iterable<string> | string[] | null, opts?: MediaOptions): boolean;
|
|
758
|
-
/**
|
|
759
|
-
* Look up the MIME type by extension; fall back to 'application/octet-stream'.
|
|
760
|
-
*/
|
|
761
|
-
declare function getMimeType(pathOrExt: string): string;
|
|
762
|
-
declare function getAllFileTypesSync(directory: string, categories?: Iterable<string> | string[] | null, opts?: MediaOptions): string[];
|
|
763
|
-
declare function getAllFileTypes(directory: string, categories?: Iterable<string> | string[] | null, opts?: MediaOptions): Promise<string[]>;
|
|
764
|
-
/** Optional convenience re-exports that mirror your Python names */
|
|
765
|
-
declare const get_all_file_types: typeof getAllFileTypes;
|
|
766
|
-
declare const get_media_map: typeof getMediaMap;
|
|
767
|
-
declare const get_media_exts: typeof getMediaExts;
|
|
768
|
-
declare const confirm_type: typeof confirmType;
|
|
769
|
-
declare const is_media_type: typeof isMediaType;
|
|
770
|
-
declare const get_mime_type: typeof getMimeType;
|
|
771
|
-
|
|
772
|
-
declare function getIfNone<T>(obj: T | undefined | null, fallback: T): T;
|
|
773
|
-
/**
|
|
774
|
-
* Merges non-null values from multiple dictionaries.
|
|
775
|
-
*/
|
|
776
|
-
declare function mergeNotNullValues<T extends Record<string, any>>(dictA: T, dictB?: Partial<T>, dictC?: Partial<T>, dictD?: Partial<T>, dictE?: Partial<T>): T;
|
|
777
|
-
/**
|
|
778
|
-
* Converts an empty object to null.
|
|
779
|
-
*/
|
|
780
|
-
declare function emptyObjectToNull<T>(value: T): T | null;
|
|
781
|
-
|
|
782
|
-
declare function loadConfig(filePath?: string | null): Promise<AppConfig>;
|
|
783
|
-
/**
|
|
784
|
-
* getConfig(): Promise<AppConfig>
|
|
785
|
-
* getConfig(key): Promise<AppConfig[K]>
|
|
786
|
-
*/
|
|
787
|
-
declare function getConfig(): Promise<AppConfig>;
|
|
788
|
-
declare function getConfig<K extends keyof AppConfig>(key: K): Promise<AppConfig[K]>;
|
|
789
|
-
|
|
790
|
-
/**
|
|
791
|
-
* Processes keywords by checking if keywords is a string and splitting it.
|
|
792
|
-
* Then cleans each keyword using `eatAll` with a set of characters to remove.
|
|
793
|
-
*
|
|
794
|
-
* @param keywords - The keywords as a comma-separated string or as an array.
|
|
795
|
-
* @returns An array of cleaned keywords.
|
|
796
|
-
*/
|
|
797
|
-
declare function processKeywords(keywords: string | string[]): string[];
|
|
798
|
-
/**
|
|
799
|
-
* Constructs a keyword string where each keyword is prefixed with a hash (#).
|
|
800
|
-
*
|
|
801
|
-
* @param keywords - An array of keywords.
|
|
802
|
-
* @returns A string with each keyword prefixed by '#'.
|
|
803
|
-
*/
|
|
804
|
-
declare function get_keyword_string(keywords: any): string;
|
|
805
|
-
|
|
806
|
-
declare function exceedsMbLimit(limitMb: number, payloadMb: number): boolean;
|
|
807
|
-
declare function safeJsonSizeInMb(value: unknown): number;
|
|
808
|
-
declare function dataSizeInMb(data: unknown): number;
|
|
809
|
-
declare function getJsonSizeInMb(json: unknown): number;
|
|
810
|
-
declare function dataSize(data: any): number;
|
|
811
|
-
|
|
812
|
-
export { API_PREFIX, ATTOSECOND, BASE_URL, CENTISECOND, DAY, DAY_IN_S, DECISECOND, DEV_PREFIX, DIST_ALIASES, DIST_FACTORS, DOMAIN_NAME, DistanceConverter, FEET_PER_METER, FEMTOSECOND, HOUR, HOUR_IN_S, KMS_PER_METER, MEDIA_TYPES, METERS_PER_FOOT, METERS_PER_KM, METERS_PER_MILE, MICROSECOND, MILES_PER_METER, MILISECOND, MIME_TYPES, MINUTE, MIN_IN_S, MONTH, MONTH_IN_S, MPerS_TO_MiPerH, MiPerH_TO_MPerS, NANOSECOND, PI, PI2, PICOSECOND, PROD_PREFIX, PROTOCOL, SECOND, SECONDS_PER_DAY, SECONDS_PER_HOUR, SECONDS_PER_MINUTE, SUB_DIR, SpeedConverter, TIME_ALIASES, TIME_FACTORS, TimeConverter, YEAR, YEAR_IN_S, ZEPTOSECOND, alertit, assureArray, assureList, assureNumber, assureString, assure_array, assure_list, assure_number, assure_string, assurearray, assurelist, assurenumber, assurestring, callStorage, callWindowMethod, canonDist, canonTime, capitalize, capitalize_str, checkResponse, cleanArray, cleanText, confirmType, confirm_type, convertBigInts, convertDistance, convertSpeed, convertTime, create_list_string, dataSize, dataSizeInMb, decodeJwt, distanceToMeters, eatAll, eatElse, eatInner, eatOuter, eatall, eatinner, eatouter, emptyObjectToNull, ends_in_quotes, ensureArray, ensureList, ensureNumber, ensureString, ensure_array, ensure_list, ensure_number, ensure_string, ensurearray, ensurelist, ensurenumber, ensurestring, exceedsMbLimit, exponential, extractInsertData, fetchIndexHtml, fetchIndexHtmlContainer, fetchIt, findKeyValue, fmt, formatNumber, fromMeters, fromMps, fromSeconds, geAuthsUtilsDirectory, geBackupsUtilsDirectory, geConstantsUtilsDirectory, geEnvUtilsDirectory, geFetchUtilsDirectory, geFileUtilsDirectory, gePathUtilsDirectory, geStaticDirectory, geStringUtilsDirectory, geTypeUtilsDirectory, get, getAbsDir, getAbsPath, getAllFileTypes, getAllFileTypesSync, getAlphaNum, getAlphas, getBaseDir, getBasename, getBody, getChar, getCleanArray, getComponentsUtilsDirectory, getConfig, getConfigContent, getConfigVar, getDbConfigsPath, getDirname, getDistDir, getDocumentProp, getEnvDir, getEnvPath, getExtname, getFetchVars, getFilename, getFunctionsDir, getFunctionsUtilsDirectory, getHeaders, getHooksUtilsDirectory, getHtmlDirectory, getIfNone, getJsonSizeInMb, getLibUtilsDirectory, getMediaExts, getMediaMap, getMethod, getMimeType, getNums, getPublicDir, getResult, getSafeDocument, getSafeLocalStorage, getSafeWindow, getSchemasDirPath, getSchemasPath, getSplitext, getSrcDir, getSubstring, getWindowHost, getWindowProp, get_all_file_types, get_basename, get_dirname, get_extname, get_filename, get_full_path, get_full_url, get_key_value, get_keyword_string, get_media_exts, get_media_map, get_mime_type, get_relative_path, get_splitext, get_window, get_window_location, get_window_parts, get_window_pathname, getbasename, getdirname, getextname, getfilename, getsplitext, isFiniteNum, isMediaType, isNum, isStrInString, isTimeInterval, isTokenExpired, isType, isZero, is_media_type, loadConfig, loadInnerJson, makePath, make_path, make_sanitized_path, makepath, mergeNotNullValues, metersToDistance, mpsToSpeed, normalizeUrl, omitKeys, parseResult, pathJoin, path_join, path_to_url, pathjoin, processKeywords, readJsonFile, roundPercentage, safeDivide, safeGlobalProp, safeJsonSizeInMb, safeMultiply, safeNums, safeStorage, sanitizeFilename, sanitizeString, secondsToTime, speedToMps, stripPrefixes, stripQuotes, timeToSeconds, toMeters, toSeconds, truncateString, tryEatPrefix, tryParse, urlJoin, url_to_path, urljoin, velocityFromMs, velocityToMs };
|
|
813
|
-
export type { ApiRow, AppConfig, CanonDist, CanonTime, ConvertDistance, ConvertSpeed, ConvertTime, Day, DistanceUnit, FetchVariables, FileItem, FileListResponse, Foot, Hour, InputProps, JwtPayload, Kilometer, LoginFormProps, LoginProps, LogoutButtonProps, MediaCategory, MediaMap, MediaOptions, Meter, Mile, MimeByExt, Minute, OutDist, OutDistance, OutSpeed, OutSpeedType, OutSpeeds, OutTime, OutTimeType, OutTimes, Promise$1 as Promise, Second, StartVelIn, TargetAltIn, TargetVelIn, TimeUnit, UnitConverter, UrlKey, VelocityUnit };
|