@mintjamsinc/ichigojs 0.1.10 → 0.1.11

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.
@@ -42,7 +42,13 @@ export declare class VApplication {
42
42
  get functionDependencies(): Record<string, string[]>;
43
43
  /**
44
44
  * Mounts the application.
45
- * @param selectors The CSS selectors to identify the root element.
45
+ * @param target The CSS selector string or HTMLElement to mount the application to.
46
46
  */
47
- mount(selectors: string): void;
47
+ mount(target: string | HTMLElement): void;
48
+ /**
49
+ * Creates a child application instance with the same registries.
50
+ * @param options The application options for the child.
51
+ * @returns The created child application instance.
52
+ */
53
+ createChildApp(options: VApplicationOptions): VApplication;
48
54
  }
@@ -1,2 +1,25 @@
1
+ /**
2
+ * Represents a reusable component definition.
3
+ */
1
4
  export declare class VComponent {
5
+ /**
6
+ * The unique identifier for the component.
7
+ */
8
+ readonly id: string;
9
+ /**
10
+ * The function that creates a new instance of the component.
11
+ */
12
+ readonly createInstance: (props?: any) => any;
13
+ /**
14
+ * The optional template ID for the component.
15
+ * If not specified, defaults to the component ID.
16
+ */
17
+ readonly templateID?: string;
18
+ /**
19
+ * Creates a new component definition.
20
+ * @param id The unique identifier for the component.
21
+ * @param createInstance The function that creates a new instance of the component.
22
+ * @param templateID The optional template ID for the component.
23
+ */
24
+ constructor(id: string, createInstance: (props?: any) => any, templateID?: string);
2
25
  }
@@ -1,2 +1,37 @@
1
+ import { VComponent } from './VComponent';
2
+ /**
3
+ * A registry for managing component definitions.
4
+ */
1
5
  export declare class VComponentRegistry {
6
+ #private;
7
+ /**
8
+ * Registers a new component.
9
+ * @param id The unique identifier for the component.
10
+ * @param createInstance The function that creates a new instance of the component.
11
+ * @param templateID The optional template ID for the component.
12
+ * @returns True if the component was registered, false if a component with the same ID already exists.
13
+ */
14
+ register(id: string, createInstance: (props?: any) => any, templateID?: string): boolean;
15
+ /**
16
+ * Checks if a component with the given ID exists.
17
+ * @param id The component ID to check.
18
+ * @returns True if the component exists, false otherwise.
19
+ */
20
+ has(id: string): boolean;
21
+ /**
22
+ * Gets a component by its ID.
23
+ * @param id The component ID to retrieve.
24
+ * @returns The component definition, or undefined if not found.
25
+ */
26
+ get(id: string): VComponent | undefined;
27
+ /**
28
+ * Removes a component from the registry.
29
+ * @param id The component ID to remove.
30
+ * @returns True if the component was removed, false if it didn't exist.
31
+ */
32
+ unregister(id: string): boolean;
33
+ /**
34
+ * Clears all registered components.
35
+ */
36
+ clear(): void;
2
37
  }
@@ -23,5 +23,7 @@ export declare enum StandardDirectiveName {
23
23
  /** Intersection observer directives. */
24
24
  V_INTERSECTION = "v-intersection",
25
25
  /** Performance observer directives. */
26
- V_PERFORMANCE = "v-performance"
26
+ V_PERFORMANCE = "v-performance",
27
+ /** Component directive. */
28
+ V_COMPONENT = "v-component"
27
29
  }
@@ -0,0 +1,81 @@
1
+ import { VDirective } from './VDirective';
2
+ import { VNode } from '../VNode';
3
+ import { VDirectiveParseContext } from './VDirectiveParseContext';
4
+ import { VBindingsPreparer } from '../VBindingsPreparer';
5
+ import { VDOMUpdater } from '../VDOMUpdater';
6
+ /**
7
+ * Directive for rendering components.
8
+ * Usage: <div v-component="componentId" :options="props"></div>
9
+ *
10
+ * The :options binding is used to pass properties to the component.
11
+ * Example:
12
+ * <div v-component="my-component" :options="{message: 'Hello'}"></div>
13
+ */
14
+ export declare class VComponentDirective implements VDirective {
15
+ #private;
16
+ constructor(context: VDirectiveParseContext);
17
+ /**
18
+ * @inheritdoc
19
+ */
20
+ get name(): string;
21
+ /**
22
+ * @inheritdoc
23
+ */
24
+ get vNode(): VNode;
25
+ /**
26
+ * @inheritdoc
27
+ */
28
+ get needsAnchor(): boolean;
29
+ /**
30
+ * @inheritdoc
31
+ */
32
+ get bindingsPreparer(): VBindingsPreparer | undefined;
33
+ /**
34
+ * @inheritdoc
35
+ */
36
+ get domUpdater(): VDOMUpdater | undefined;
37
+ /**
38
+ * @inheritdoc
39
+ */
40
+ get templatize(): boolean;
41
+ /**
42
+ * @inheritdoc
43
+ */
44
+ get dependentIdentifiers(): string[];
45
+ /**
46
+ * @inheritdoc
47
+ */
48
+ get onMount(): (() => void) | undefined;
49
+ /**
50
+ * @inheritdoc
51
+ */
52
+ get onMounted(): (() => void) | undefined;
53
+ /**
54
+ * @inheritdoc
55
+ */
56
+ get onUpdate(): (() => void) | undefined;
57
+ /**
58
+ * @inheritdoc
59
+ */
60
+ get onUpdated(): (() => void) | undefined;
61
+ /**
62
+ * @inheritdoc
63
+ */
64
+ get onUnmount(): (() => void) | undefined;
65
+ /**
66
+ * @inheritdoc
67
+ */
68
+ get onUnmounted(): (() => void) | undefined;
69
+ /**
70
+ * @inheritdoc
71
+ */
72
+ destroy(): void;
73
+ /**
74
+ * Renders the component.
75
+ */
76
+ private renderComponent;
77
+ /**
78
+ * Cleans up the component.
79
+ */
80
+ private cleanupComponent;
81
+ }
@@ -1 +1,3 @@
1
1
  export { VDOM } from './ichigo/VDOM';
2
+ export { VComponent } from './ichigo/components/VComponent';
3
+ export { VComponentRegistry } from './ichigo/components/VComponentRegistry';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintjamsinc/ichigojs",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
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",