@mintjamsinc/ichigojs 0.1.1 → 0.1.3
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/ichigo.esm.js +216 -41
- package/dist/ichigo.esm.js.map +1 -1
- package/dist/ichigo.esm.min.js +1 -1
- package/dist/ichigo.esm.min.js.map +1 -1
- package/dist/ichigo.umd.js +216 -41
- package/dist/ichigo.umd.js.map +1 -1
- package/dist/ichigo.umd.min.js +1 -1
- package/dist/ichigo.umd.min.js.map +1 -1
- package/dist/types/ichigo/VBindingsInit.d.ts +5 -0
- package/dist/types/ichigo/VNode.d.ts +11 -1
- package/dist/types/ichigo/VNodeInit.d.ts +5 -0
- package/dist/types/ichigo/util/ReactiveProxy.d.ts +6 -5
- package/dist/types/ichigo/util/VLogManager.d.ts +15 -0
- package/dist/types/ichigo/util/VLogger.d.ts +31 -0
- package/package.json +2 -2
@@ -1,3 +1,4 @@
|
|
1
|
+
import { VApplication } from "./VApplication";
|
1
2
|
import { VBindings } from "./VBindings";
|
2
3
|
/**
|
3
4
|
* Initialization arguments for bindings.
|
@@ -12,4 +13,8 @@ export interface VBindingsInit {
|
|
12
13
|
* @param identifier The identifier that changed.
|
13
14
|
*/
|
14
15
|
onChange?: (identifier: string) => void;
|
16
|
+
/**
|
17
|
+
* The virtual application instance, if any.
|
18
|
+
*/
|
19
|
+
vApplication?: VApplication;
|
15
20
|
}
|
@@ -84,6 +84,14 @@ export declare class VNode {
|
|
84
84
|
*/
|
85
85
|
get dependentIdentifiers(): string[];
|
86
86
|
get preparableIdentifiers(): string[];
|
87
|
+
/**
|
88
|
+
* The DOM path of this virtual node.
|
89
|
+
* This is a string representation of the path from the root to this node,
|
90
|
+
* using the node names and their indices among siblings with the same name.
|
91
|
+
* For example: "DIV[0]/SPAN[1]/#text[0]"
|
92
|
+
* @return The DOM path as a string.
|
93
|
+
*/
|
94
|
+
get domPath(): string;
|
87
95
|
/**
|
88
96
|
* Updates the virtual node and its children based on the current bindings.
|
89
97
|
* This method evaluates any expressions in text nodes and applies effectors from directives.
|
@@ -107,9 +115,11 @@ export declare class VNode {
|
|
107
115
|
/**
|
108
116
|
* Adds a dependent virtual node that relies on this node's bindings.
|
109
117
|
* @param dependent The dependent virtual node to add.
|
118
|
+
* @param dependentIdentifiers The identifiers that the dependent node relies on.
|
119
|
+
* If not provided, the dependent node's own identifiers will be used.
|
110
120
|
* @returns A list of closers to unregister the dependency, or undefined if no dependency was added.
|
111
121
|
*/
|
112
|
-
addDependent(dependent: VNode): VCloser[] | undefined;
|
122
|
+
addDependent(dependent: VNode, dependentIdentifiers?: string[] | undefined): VCloser[] | undefined;
|
113
123
|
/**
|
114
124
|
* Cleans up any resources used by this virtual node.
|
115
125
|
* This method is called when the virtual node is no longer needed.
|
@@ -22,4 +22,9 @@ export interface VNodeInit {
|
|
22
22
|
* This is optional and may be undefined if there are no bindings.
|
23
23
|
*/
|
24
24
|
bindings?: VBindings;
|
25
|
+
/**
|
26
|
+
* The set of identifiers that this node depends on.
|
27
|
+
* This is optional and may be undefined if there are no dependent identifiers.
|
28
|
+
*/
|
29
|
+
dependentIdentifiers?: string[];
|
25
30
|
}
|
@@ -3,19 +3,20 @@
|
|
3
3
|
*/
|
4
4
|
export declare class ReactiveProxy {
|
5
5
|
/**
|
6
|
-
* A WeakMap to store the
|
7
|
-
* This
|
6
|
+
* A WeakMap to store the proxy for each target object and path combination.
|
7
|
+
* This prevents creating multiple proxies for the same object accessed from different paths.
|
8
8
|
*/
|
9
|
-
private static
|
9
|
+
private static proxyCache;
|
10
10
|
/**
|
11
11
|
* Creates a reactive proxy for the given object.
|
12
12
|
* The proxy will call the onChange callback whenever a property is modified.
|
13
13
|
*
|
14
14
|
* @param target The object to make reactive.
|
15
|
-
* @param onChange Callback function to call when the object changes. Receives the changed
|
15
|
+
* @param onChange Callback function to call when the object changes. Receives the full path of the changed property.
|
16
|
+
* @param path The current path in the object tree (used internally for nested objects).
|
16
17
|
* @returns A reactive proxy of the target object.
|
17
18
|
*/
|
18
|
-
static create<T extends object>(target: T, onChange: (
|
19
|
+
static create<T extends object>(target: T, onChange: (changedPath?: string) => void, path?: string): T;
|
19
20
|
/**
|
20
21
|
* Checks if the given object is a reactive proxy.
|
21
22
|
*
|
@@ -1,9 +1,24 @@
|
|
1
1
|
import { VLogger } from "./VLogger";
|
2
2
|
import { LogLevel } from "./LogLevel";
|
3
|
+
/**
|
4
|
+
* Manages loggers and their log levels.
|
5
|
+
*/
|
3
6
|
export declare class VLogManager {
|
4
7
|
#private;
|
5
8
|
constructor(logLevel?: LogLevel);
|
9
|
+
/**
|
10
|
+
* Sets the log level for all loggers.
|
11
|
+
* @param level The log level to set.
|
12
|
+
*/
|
6
13
|
set logLevel(level: LogLevel);
|
14
|
+
/**
|
15
|
+
* Gets the current log level.
|
16
|
+
*/
|
7
17
|
get logLevel(): LogLevel;
|
18
|
+
/**
|
19
|
+
* Gets a logger by name, creating it if it doesn't exist.
|
20
|
+
* @param name The name of the logger.
|
21
|
+
* @returns The logger instance.
|
22
|
+
*/
|
8
23
|
getLogger(name: string): VLogger;
|
9
24
|
}
|
@@ -1,9 +1,40 @@
|
|
1
1
|
import { VLogManager } from "./VLogManager";
|
2
|
+
/**
|
3
|
+
* A simple logger class for virtual applications.
|
4
|
+
*/
|
2
5
|
export declare class VLogger {
|
3
6
|
#private;
|
4
7
|
constructor(name: string, logManager: VLogManager);
|
8
|
+
/**
|
9
|
+
* Indicates whether the debug level is enabled.
|
10
|
+
*/
|
11
|
+
get isDebugEnabled(): boolean;
|
12
|
+
/**
|
13
|
+
* Indicates whether the info level is enabled.
|
14
|
+
*/
|
15
|
+
get isInfoEnabled(): boolean;
|
16
|
+
/**
|
17
|
+
* Indicates whether the warn level is enabled.
|
18
|
+
*/
|
19
|
+
get isWarnEnabled(): boolean;
|
20
|
+
/**
|
21
|
+
* Logs a debug message.
|
22
|
+
* @param message The message to log.
|
23
|
+
*/
|
5
24
|
debug(message: string): void;
|
25
|
+
/**
|
26
|
+
* Logs an info message.
|
27
|
+
* @param message The message to log.
|
28
|
+
*/
|
6
29
|
info(message: string): void;
|
30
|
+
/**
|
31
|
+
* Logs a warn message.
|
32
|
+
* @param message The message to log.
|
33
|
+
*/
|
7
34
|
warn(message: string): void;
|
35
|
+
/**
|
36
|
+
* Logs an error message.
|
37
|
+
* @param message The message to log.
|
38
|
+
*/
|
8
39
|
error(message: string): void;
|
9
40
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@mintjamsinc/ichigojs",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.3",
|
4
4
|
"description": "ichigo.js - Simple and intuitive reactive framework. Lightweight, fast, and user-friendly virtual DOM library",
|
5
5
|
"main": "./dist/ichigo.umd.js",
|
6
6
|
"module": "./dist/ichigo.esm.js",
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"homepage": "https://github.com/mintjamsinc/ichigojs#readme",
|
12
12
|
"repository": {
|
13
13
|
"type": "git",
|
14
|
-
"url": "https://github.com/mintjamsinc/ichigojs.git"
|
14
|
+
"url": "git+https://github.com/mintjamsinc/ichigojs.git"
|
15
15
|
},
|
16
16
|
"bugs": {
|
17
17
|
"url": "https://github.com/mintjamsinc/ichigojs/issues"
|