@aegis-framework/artemis 0.4.1 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +555 -96
- package/dist/artemis.browser.js +2 -2
- package/dist/artemis.browser.js.map +19 -18
- package/dist/artemis.js +2 -2
- package/dist/artemis.js.map +18 -17
- package/dist/types/DOM.d.ts +190 -207
- package/dist/types/DOM.d.ts.map +1 -1
- package/dist/types/Debug.d.ts +73 -2
- package/dist/types/Debug.d.ts.map +1 -1
- package/dist/types/FileSystem.d.ts +55 -38
- package/dist/types/FileSystem.d.ts.map +1 -1
- package/dist/types/Form.d.ts +41 -16
- package/dist/types/Form.d.ts.map +1 -1
- package/dist/types/Platform.d.ts +62 -63
- package/dist/types/Platform.d.ts.map +1 -1
- package/dist/types/Preload.d.ts +70 -11
- package/dist/types/Preload.d.ts.map +1 -1
- package/dist/types/Request.d.ts +111 -47
- package/dist/types/Request.d.ts.map +1 -1
- package/dist/types/Space.d.ts +19 -6
- package/dist/types/Space.d.ts.map +1 -1
- package/dist/types/SpaceAdapter/IndexedDB.d.ts +10 -7
- package/dist/types/SpaceAdapter/IndexedDB.d.ts.map +1 -1
- package/dist/types/SpaceAdapter/LocalStorage.d.ts +18 -8
- package/dist/types/SpaceAdapter/LocalStorage.d.ts.map +1 -1
- package/dist/types/SpaceAdapter/RemoteStorage.d.ts +15 -2
- package/dist/types/SpaceAdapter/RemoteStorage.d.ts.map +1 -1
- package/dist/types/SpaceAdapter/SessionStorage.d.ts +21 -2
- package/dist/types/SpaceAdapter/SessionStorage.d.ts.map +1 -1
- package/dist/types/SpaceAdapter/types.d.ts +32 -1
- package/dist/types/SpaceAdapter/types.d.ts.map +1 -1
- package/dist/types/Text.d.ts +34 -23
- package/dist/types/Text.d.ts.map +1 -1
- package/dist/types/Util.d.ts +18 -14
- package/dist/types/Util.d.ts.map +1 -1
- package/dist/types/browser.d.ts.map +1 -1
- package/package.json +10 -11
package/dist/types/Text.d.ts
CHANGED
|
@@ -3,45 +3,56 @@
|
|
|
3
3
|
* Text
|
|
4
4
|
* ==============================
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
export interface CapitalizeOptions {
|
|
7
|
+
preserveCase?: boolean;
|
|
8
|
+
}
|
|
9
9
|
export declare class Text {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Capitalize the first letter of each word.
|
|
12
12
|
*
|
|
13
|
-
* @param text - Text
|
|
14
|
-
* @
|
|
13
|
+
* @param text - Text to capitalize
|
|
14
|
+
* @param options - Capitalization options
|
|
15
|
+
* @returns Capitalized text
|
|
15
16
|
*/
|
|
16
|
-
static capitalize(text: string): string;
|
|
17
|
+
static capitalize(text: string, options?: CapitalizeOptions): string;
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* @param key - Key part of the string
|
|
21
|
-
* @param text - Full string to extract the suffix from
|
|
22
|
-
* @returns Suffix
|
|
19
|
+
* Get the currently selected text in the document.
|
|
23
20
|
*/
|
|
24
|
-
static
|
|
21
|
+
static selection(): string;
|
|
25
22
|
/**
|
|
26
|
-
* Get the
|
|
23
|
+
* Get the text after a given key/substring.
|
|
27
24
|
*
|
|
28
|
-
* @
|
|
25
|
+
* @param key - The substring to search for
|
|
26
|
+
* @param text - The text to search in
|
|
27
|
+
* @returns Text after the key, or empty string if not found
|
|
29
28
|
*/
|
|
30
|
-
static
|
|
29
|
+
static suffix(key: string, text: string): string;
|
|
31
30
|
/**
|
|
32
|
-
*
|
|
31
|
+
* Get the text before a given key/substring.
|
|
33
32
|
*
|
|
34
|
-
* @param key -
|
|
35
|
-
* @param text -
|
|
36
|
-
* @returns
|
|
33
|
+
* @param key - The substring to search for
|
|
34
|
+
* @param text - The text to search in
|
|
35
|
+
* @returns Text before the key, or empty string if not found
|
|
37
36
|
*/
|
|
38
37
|
static prefix(key: string, text: string): string;
|
|
39
38
|
/**
|
|
40
|
-
*
|
|
39
|
+
* Convert text to a URL-friendly slug.
|
|
41
40
|
*
|
|
42
|
-
* @param text -
|
|
43
|
-
* @returns
|
|
41
|
+
* @param text - Text to convert
|
|
42
|
+
* @returns URL-friendly slug
|
|
44
43
|
*/
|
|
45
44
|
static friendly(text: string): string;
|
|
45
|
+
/**
|
|
46
|
+
* Truncate text to a maximum length with ellipsis.
|
|
47
|
+
*
|
|
48
|
+
* @param text - Text to truncate
|
|
49
|
+
* @param maxLength - Maximum length (including ellipsis)
|
|
50
|
+
* @param ellipsis - Ellipsis string to append (default: '...')
|
|
51
|
+
*/
|
|
52
|
+
static truncate(text: string, maxLength: number, ellipsis?: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* Check if a string is empty or contains only whitespace.
|
|
55
|
+
*/
|
|
56
|
+
static isBlank(text: string | null | undefined): boolean;
|
|
46
57
|
}
|
|
47
58
|
//# sourceMappingURL=Text.d.ts.map
|
package/dist/types/Text.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/Text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"Text.d.ts","sourceRoot":"","sources":["../../src/Text.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,qBAAa,IAAI;IAEf;;;;;;OAMG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB,GAAG,MAAM;IAUxE;;OAEG;IACH,MAAM,CAAC,SAAS,IAAI,MAAM;IAI1B;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAUhD;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAUhD;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAYrC;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAc,GAAG,MAAM;IAQlF;;OAEG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO;CAGzD"}
|
package/dist/types/Util.d.ts
CHANGED
|
@@ -3,29 +3,33 @@
|
|
|
3
3
|
* Util
|
|
4
4
|
* ==============================
|
|
5
5
|
*/
|
|
6
|
-
/**
|
|
7
|
-
* Callable function type
|
|
8
|
-
*/
|
|
9
6
|
export type Callable<T = unknown> = (...args: unknown[]) => T | Promise<T>;
|
|
10
|
-
/**
|
|
11
|
-
* Provides diverse utility functions
|
|
12
|
-
*/
|
|
13
7
|
export declare class Util {
|
|
14
8
|
/**
|
|
15
|
-
* Calls
|
|
16
|
-
* async and sync functions.
|
|
9
|
+
* Calls a function and ensures it returns a Promise.
|
|
17
10
|
*
|
|
18
11
|
* @param callable - The function to run
|
|
19
|
-
* @param context - The
|
|
20
|
-
* @param args -
|
|
21
|
-
* @returns A promise that resolves to the result of the function
|
|
12
|
+
* @param context - The `this` context
|
|
13
|
+
* @param args - Arguments to pass
|
|
22
14
|
*/
|
|
23
15
|
static callAsync<T = unknown>(callable: Callable<T>, context: unknown, ...args: unknown[]): Promise<T>;
|
|
24
16
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* @returns Generated UUID
|
|
17
|
+
* Generates a UUID v4.
|
|
28
18
|
*/
|
|
29
19
|
static uuid(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Debounce a function call.
|
|
22
|
+
*
|
|
23
|
+
* @param fn - Function to debounce
|
|
24
|
+
* @param delay - Delay in milliseconds
|
|
25
|
+
*/
|
|
26
|
+
static debounce<T extends (...args: unknown[]) => unknown>(fn: T, delay: number): (...args: Parameters<T>) => void;
|
|
27
|
+
/**
|
|
28
|
+
* Throttle a function call.
|
|
29
|
+
*
|
|
30
|
+
* @param fn - Function to throttle
|
|
31
|
+
* @param limit - Minimum time between calls in milliseconds
|
|
32
|
+
*/
|
|
33
|
+
static throttle<T extends (...args: unknown[]) => unknown>(fn: T, limit: number): (...args: Parameters<T>) => void;
|
|
30
34
|
}
|
|
31
35
|
//# sourceMappingURL=Util.d.ts.map
|
package/dist/types/Util.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../src/Util.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH
|
|
1
|
+
{"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../src/Util.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,QAAQ,CAAC,CAAC,GAAG,OAAO,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAE3E,qBAAa,IAAI;IACf;;;;;;OAMG;WACU,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC;IAQ5G;;OAEG;IACH,MAAM,CAAC,IAAI,IAAI,MAAM;IAoBrB;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI;IAclH;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI;CAanH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/browser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAEnC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,OAAO,EAAE,OAAO,OAAO,CAAC;KACzB;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aegis-framework/artemis",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Aegis Framework Javascript Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/artemis.js",
|
|
@@ -37,25 +37,25 @@
|
|
|
37
37
|
"library"
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
|
-
"build": "
|
|
40
|
+
"build": "bun run clean && bun run lint && bun run check && bun run build:module && bun run build:legacy && bun run build:types",
|
|
41
41
|
"build:module": "bun build ./src/index.ts --target browser --format esm --outdir ./dist --sourcemap=linked --minify && mv ./dist/index.js ./dist/artemis.js && mv ./dist/index.js.map ./dist/artemis.js.map && sed -i 's/index.js.map/artemis.js.map/' ./dist/artemis.js",
|
|
42
42
|
"build:legacy": "bun build ./src/browser.ts --target browser --format esm --outdir ./dist --sourcemap=linked --minify && mv ./dist/browser.js ./dist/artemis.browser.js && mv ./dist/browser.js.map ./dist/artemis.browser.js.map && sed -i 's/browser.js.map/artemis.browser.js.map/' ./dist/artemis.browser.js",
|
|
43
43
|
"build:types": "tsc --emitDeclarationOnly --declarationDir ./dist/types",
|
|
44
44
|
"check": "tsc --noEmit",
|
|
45
45
|
"lint": "eslint ./src/**/*.ts",
|
|
46
46
|
"clean": "rm -rf dist",
|
|
47
|
-
"test": "
|
|
47
|
+
"test": "bun test/index.html"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@babel/eslint-parser": "^7.28.5",
|
|
51
|
-
"@eslint/js": "^9.39.
|
|
52
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
53
|
-
"@typescript-eslint/parser": "^8.
|
|
54
|
-
"bun": "^1.3.
|
|
55
|
-
"eslint": "^9.39.
|
|
51
|
+
"@eslint/js": "^9.39.2",
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "^8.50.0",
|
|
53
|
+
"@typescript-eslint/parser": "^8.50.0",
|
|
54
|
+
"bun": "^1.3.5",
|
|
55
|
+
"eslint": "^9.39.2",
|
|
56
56
|
"http-server": "^14.1.1",
|
|
57
57
|
"typescript": "^5.9.3",
|
|
58
|
-
"typescript-eslint": "^8.
|
|
58
|
+
"typescript-eslint": "^8.50.0"
|
|
59
59
|
},
|
|
60
60
|
"files": [
|
|
61
61
|
"dist/",
|
|
@@ -63,6 +63,5 @@
|
|
|
63
63
|
"README.md",
|
|
64
64
|
"package.json"
|
|
65
65
|
],
|
|
66
|
-
"browserslist": "> 0.5%, last 2 versions, not dead"
|
|
67
|
-
"packageManager": "yarn@4.12.0"
|
|
66
|
+
"browserslist": "> 0.5%, last 2 versions, not dead"
|
|
68
67
|
}
|