eleva 0.1.0-alpha → 1.1.0-alpha

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 CHANGED
@@ -1 +1,409 @@
1
- # eleva
1
+ # Eleva
2
+
3
+ **A minimalist, lightweight, pure vanilla JavaScript frontend runtime framework.**
4
+ _Built with love for native JavaScript—because sometimes, less really is more!_ 😊
5
+
6
+ [![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
7
+ [![Version](https://img.shields.io/npm/v/eleva.svg?style=flat)](https://www.npmjs.com/package/eleva)
8
+ ![100% Javascript](https://img.shields.io/github/languages/top/TarekRaafat/eleva?color=yellow)
9
+ ![Zero Dependencies](https://img.shields.io/badge/Dependencies-0-green.svg)
10
+ [![Minified Size](https://badgen.net/bundlephobia/min/eleva@latest)](https://bundlephobia.com/package/eleva@latest)
11
+ [![Gzipped Size](https://badgen.net/bundlephobia/minzip/eleva@latest)](https://bundlephobia.com/package/eleva@latest)
12
+
13
+ <!-- [![](https://data.jsdelivr.com/v1/package/npm/eleva/badge)](https://www.jsdelivr.com/package/npm/eleva) -->
14
+
15
+ > **Stability Notice**: This is `v1.1.0-alpha` - APIs may change significantly until the stable release.
16
+ > Not recommended for production use yet. Follow the [versioning guide](#version-guide) for updates.
17
+
18
+ **Version:** `1.1.0-alpha`
19
+
20
+ Welcome to Eleva! This is my humble, experimental playground for a fresh approach to frontend development. Eleva was born out of my genuine passion for pure vanilla JavaScript—no frameworks, no bloat, just the power of native code. I hope you'll have fun exploring, testing, and contributing to make Eleva even better. 🚀
21
+
22
+ ---
23
+
24
+ ## Table of Contents
25
+
26
+ - [Eleva](#eleva)
27
+ - [Table of Contents](#table-of-contents)
28
+ - [Introduction](#introduction)
29
+ - [Design Philosophy](#design-philosophy)
30
+ - [Handcrafted \& Developer-Centric Design](#handcrafted--developer-centric-design)
31
+ - [Features](#features)
32
+ - [When to Use Eleva](#when-to-use-eleva)
33
+ - [Version Strategy](#version-strategy)
34
+ - [Version Guide](#version-guide)
35
+ - [Performance](#performance)
36
+ - [Performance Benchmarks](#performance-benchmarks)
37
+ - [Eleva vs. Popular Frameworks](#eleva-vs-popular-frameworks)
38
+ - [Installation](#installation)
39
+ - [Usage](#usage)
40
+ - [ES Module Example](#es-module-example)
41
+ - [UMD Example](#umd-example)
42
+ - [API Reference](#api-reference)
43
+ - [TemplateEngine](#templateengine)
44
+ - [Signal](#signal)
45
+ - [Emitter](#emitter)
46
+ - [Renderer](#renderer)
47
+ - [Eleva (Core)](#eleva-core)
48
+ - [Development](#development)
49
+ - [Testing](#testing)
50
+ - [Contributing](#contributing)
51
+ - [License](#license)
52
+ - [Contact](#contact)
53
+
54
+ ---
55
+
56
+ ## Introduction
57
+
58
+ Eleva is a lightweight, no-nonsense runtime framework for frontend applications. Built with love for **pure vanilla JavaScript**, Eleva lets you create highly modular and scalable applications without the overhead of large frameworks. I built Eleva to prove that you don't need heavy libraries to build amazing user interfaces—sometimes, the simplest approach is the most powerful.
59
+
60
+ **My Inspiration:**
61
+ The idea behind Eleva comes from a deep appreciation for native JavaScript. I wanted to create a tool that stays true to the language without introducing new syntax or complexity, making it easy to integrate into your projects.
62
+
63
+ **Core Principles:**
64
+
65
+ - **🌱 Minimalism:** Only the essentials, so you can build without clutter.
66
+ - **🔌 Extensibility:** Plug in your own ideas—custom state management, routing, and more.
67
+ - **🚀 Performance:** Fast, efficient, and designed with modern browsers in mind.
68
+ - **🍦 Pure Vanilla:** No dependencies, no magic—just plain JavaScript.
69
+
70
+ ---
71
+
72
+ ## Design Philosophy
73
+
74
+ **Eleva is an unopinionated library.**
75
+
76
+ Unlike many frameworks that enforce a specific project structure or coding paradigm, Eleva provides a minimal core with a flexible plugin system. This means:
77
+
78
+ - **🔄 Flexibility:** Architect your application your way—no rigid structure required.
79
+ - **🎯 Native JavaScript:** Built using pure vanilla JavaScript, Eleva integrates seamlessly with your existing code without unfamiliar syntax.
80
+ - **⚙️ Configurability:** Extend Eleva's functionality with a simple API and optional plugins.
81
+ - **🆓 Freedom:** Decide the best way to implement features without unnecessary constraints.
82
+
83
+ This unopinionated approach makes Eleva versatile and ideal for developers who want full control over their application's design.
84
+
85
+ ---
86
+
87
+ ## Handcrafted & Developer-Centric Design
88
+
89
+ Eleva is built with meticulous attention to detail and a deep passion for pure vanilla JavaScript. Every aspect of its design and architecture is handcrafted with the developer in mind. This makes Eleva not only innovative but also a solid foundation for your projects.
90
+
91
+ - **🎨 Craftsmanship:** Every line of code is written with care, keeping the library lightweight, efficient, and easy to understand.
92
+ - **🛠️ Developer-Centric:** Its intuitive API and minimal core mean you spend less time wrestling with the framework and more time building your application.
93
+ - **🌟 Innovative & Fresh:** Stick to pure vanilla JavaScript and avoid unnecessary abstractions.
94
+ - **🏗️ Solid & Reliable:** Focused on performance and modularity, Eleva scales with your project’s needs.
95
+
96
+ This unique, developer-first approach makes Eleva a standout choice for building high-performance frontend applications without compromising on simplicity or control.
97
+
98
+ ---
99
+
100
+ ## Features
101
+
102
+ - **🧩 Component-Based Architecture:** Create reusable UI components effortlessly.
103
+ - **⚡ Signal-Based Reactivity:** Fine-grained reactivity that updates only what’s needed.
104
+ - **🔔 Event Handling:** Built-in event emitter for robust inter-component communication.
105
+ - **📝 Template Parsing:** Secure and dynamic interpolation with a custom TemplateEngine.
106
+ - **🔄 DOM Diffing & Patching:** High-performance updates without a virtual DOM.
107
+ - **📦 UMD & ES Module Builds:** Supports modern build tools and browser environments.
108
+ - **🤝 Friendly API:** A gentle learning curve for both beginners and seasoned developers.
109
+ - **💎 Tiny Footprint & TypeScript Support:** Approximately ~4 KB minified with built-in TypeScript declarations, to keep your bundle lean and your codebase strongly typed.
110
+
111
+ ---
112
+
113
+ ## When to Use Eleva
114
+
115
+ Eleva is ideal for developers seeking a lightweight, flexible, and high-performance solution for building frontend applications. Here are some scenarios where Eleva shines:
116
+
117
+ - **🚀 Small to Medium Projects:** Perfect for web apps or websites that don’t require the overhead of a full-fledged framework.
118
+ - **⚡ Performance-Critical Applications:** Optimized reactivity and DOM diffing ensure smooth performance without bloat.
119
+ - **🔄 Unopinionated & Flexible:** Architect your application your way with a straightforward API and plugin system.
120
+ - **🎯 Developer-Friendly:** Stick to pure vanilla JavaScript with familiar syntax and built-in TypeScript support.
121
+ - **🧪 Rapid Prototyping:** Quickly prototype ideas with a minimal and extendable framework.
122
+ - **🔌 Extensible:** Easily add features like routing or state management through plugins.
123
+
124
+ ---
125
+
126
+ ## Version Strategy
127
+
128
+ I believe in clear versioning that reflects the maturity of the project:
129
+
130
+ - **Pre-release Versions (Alpha/Beta):** Early versions like `1.1.0-alpha` indicate the API is still evolving. Expect frequent updates and share your feedback!
131
+ - **Semantic Versioning:** Once stable, I’ll follow semantic versioning strictly to clearly communicate any breaking changes.
132
+ - **Fresh Start:** This release (`1.1.0-alpha`) marks a significant update with new features and improvements.
133
+
134
+ ---
135
+
136
+ ## Version Guide
137
+
138
+ I follow [Semantic Versioning (SemVer)](https://semver.org/):
139
+
140
+ - **🔢 Major Version:** Breaking changes or major overhauls (e.g., from `1.0.0` to `2.0.0`).
141
+ - **🔢 Minor Version:** New features in a backward-compatible manner (e.g., from `1.0.0` to `1.1.0`).
142
+ - **🔢 Patch Version:** Backward-compatible bug fixes and minor improvements (e.g., `1.0.1`).
143
+ - **📌 Pre-release Identifiers:** Suffixes like `-alpha`, `-beta`, or `-rc` denote unstable releases (e.g., `1.1.0-alpha`).
144
+
145
+ ---
146
+
147
+ ## Performance
148
+
149
+ Eleva is crafted for performance:
150
+
151
+ - **Lightweight:** Approximately ~4 KB minified and ~1.9 KB gzipped.
152
+ - **Efficient Reactivity:** Signal-based updates ensure only necessary DOM parts are updated.
153
+ - **Optimized Diffing:** Renderer efficiently patches changes without the overhead of a virtual DOM.
154
+ - **No Bloat:** Pure vanilla JavaScript with zero dependencies keeps your project nimble.
155
+
156
+ ---
157
+
158
+ ## Performance Benchmarks
159
+
160
+ Preliminary benchmarks illustrate Eleva’s efficiency compared to popular frameworks:
161
+
162
+ | Framework | Bundle Size (minified) | Initial Load Time | DOM Update Speed |
163
+ | --------- | ---------------------- | ----------------- | ---------------- |
164
+ | **Eleva** | **~4 KB** | **~35 ms** | **~2 ms** |
165
+ | React | ~110 KB | ~100 ms | ~4 ms |
166
+ | Vue | ~80 KB | ~80 ms | ~3 ms |
167
+ | Angular | ~500 KB | ~250 ms | ~6 ms |
168
+
169
+ > ⚠️ **Disclaimer:** Benchmarks are based on internal tests with a minimal counter component and may vary by project and environment.
170
+
171
+ ---
172
+
173
+ ## Eleva vs. Popular Frameworks
174
+
175
+ Eleva offers a refreshing alternative to frameworks like React, Vue, and Angular:
176
+
177
+ - **Simplicity:** No virtual DOM, JSX, or complex state management—just plain JavaScript.
178
+ - **Modularity:** Easily extend via plugins to suit your project’s needs.
179
+ - **Size:** A fraction of the size of mainstream frameworks.
180
+ - **Learning Curve:** Familiar syntax and a clear API make it accessible to all developers.
181
+
182
+ _Note:_ Eleva isn’t trying to replace these giants but provides a lightweight option when you want simplicity and speed. 🌟
183
+
184
+ ---
185
+
186
+ ## Installation
187
+
188
+ Eleva is available on npm. Try it out and share your thoughts!
189
+
190
+ ```bash
191
+ npm install eleva
192
+ ```
193
+
194
+ Or include it directly via CDN:
195
+
196
+ ```html
197
+ <!-- unpkg -->
198
+ <script src="https://unpkg.com/eleva/dist/eleva.min.js"></script>
199
+ ```
200
+
201
+ ```html
202
+ <!-- jsDelivr -->
203
+ <script src="https://cdn.jsdelivr.net/npm/eleva/dist/eleva.min.js"></script>
204
+ ```
205
+
206
+ ---
207
+
208
+ ## Usage
209
+
210
+ ### ES Module Example
211
+
212
+ ```js
213
+ // Import Eleva (using ES modules)
214
+ import Eleva from "eleva";
215
+
216
+ // Create a new Eleva instance
217
+ const app = new Eleva("MyApp");
218
+
219
+ // Define a component
220
+ app.component("HelloWorld", {
221
+ // The setup method is optional; if omitted, an empty state is used.
222
+ setup({ signal }) {
223
+ const count = signal(0);
224
+ return { count };
225
+ },
226
+ template: ({ count }) => `
227
+ <div>
228
+ <h1>Hello, Eleva! 👋</h1>
229
+ <p>Count: ${count}</p>
230
+ <button @click="() => count++">Increment</button>
231
+ </div>
232
+ `,
233
+ });
234
+
235
+ // Mount the component to a DOM element (not a selector).
236
+ app.mount(document.getElementById("app"), "HelloWorld");
237
+ ```
238
+
239
+ ### UMD Example
240
+
241
+ Include Eleva via a script tag and use the global variable:
242
+
243
+ ```html
244
+ <!DOCTYPE html>
245
+ <html lang="en">
246
+ <head>
247
+ <meta charset="UTF-8" />
248
+ <title>Eleva Example</title>
249
+ </head>
250
+ <body>
251
+ <div id="app"></div>
252
+ <script src="https://unpkg.com/eleva/dist/eleva.min.js"></script>
253
+ <script>
254
+ const app = new Eleva("MyApp");
255
+ app.component("HelloWorld", {
256
+ setup({ signal }) {
257
+ const count = signal(0);
258
+ return { count };
259
+ },
260
+ template: ({ count }) => `
261
+ <div>
262
+ <h1>Hello, Eleva! 👋</h1>
263
+ <p>Count: ${count}</p>
264
+ <button @click="() => count++">Increment</button>
265
+ </div>
266
+ `,
267
+ });
268
+ app.mount(document.getElementById("app"), "HelloWorld");
269
+ </script>
270
+ </body>
271
+ </html>
272
+ ```
273
+
274
+ ---
275
+
276
+ ## API Reference
277
+
278
+ ### TemplateEngine
279
+
280
+ - **`TemplateEngine.parse(template, data)`**
281
+ Replaces `{{ expression }}` patterns in the template with evaluated values.
282
+ - **`TemplateEngine.evaluate(expr, data)`**
283
+ Safely evaluates JavaScript expressions within a given context.
284
+
285
+ ### Signal
286
+
287
+ - **`new Signal(value)`**
288
+ Creates a reactive data holder.
289
+ - **`.value` (getter/setter)**
290
+ Get or update the current value and trigger watchers.
291
+ - **`.watch(fn)`**
292
+ Registers a function to run when the value updates.
293
+
294
+ ### Emitter
295
+
296
+ - **`.on(event, handler)`**
297
+ Listen to events.
298
+ - **`.off(event, handler)`**
299
+ Remove event listeners.
300
+ - **`.emit(event, ...args)`**
301
+ Trigger events with additional arguments.
302
+
303
+ ### Renderer
304
+
305
+ - **`patchDOM(container, newHtml)`**
306
+ Efficiently update the DOM.
307
+ - **`diff(oldParent, newParent)`**
308
+ Compare and update DOM trees.
309
+ - **`updateAttributes(oldEl, newEl)`**
310
+ Sync element attributes.
311
+
312
+ ### Eleva (Core)
313
+
314
+ - **`new Eleva(name, config)`**
315
+ Create an Eleva instance.
316
+ - **`.use(plugin, options)`**
317
+ Install plugins.
318
+ - **`.component(name, definition)`**
319
+ Register a component.
320
+ - **`.mount(container, compName, props)`**
321
+ Mount a component to the DOM.
322
+ _Note:_ This method now expects a DOM element (not a CSS selector) and supports both global component names (strings) and direct component definitions (objects). It returns a Promise, ensuring consistent asynchronous handling.
323
+
324
+ For detailed API documentation, please check the [docs](docs/index.md) folder.
325
+
326
+ ---
327
+
328
+ ## Development
329
+
330
+ I welcome developers to dive in and experiment with Eleva! Here’s how to get started locally:
331
+
332
+ 1. **Clone the Repository:**
333
+
334
+ ```bash
335
+ git clone https://github.com/TarekRaafat/eleva.git
336
+ cd eleva
337
+ ```
338
+
339
+ 2. **Install Dependencies:**
340
+
341
+ ```bash
342
+ npm install
343
+ ```
344
+
345
+ 3. **Run in Development Mode (Watch):**
346
+
347
+ ```bash
348
+ npm run dev
349
+ ```
350
+
351
+ 4. **Build for Production:**
352
+
353
+ ```bash
354
+ npm run build
355
+ ```
356
+
357
+ 5. **Generate and Bundle TypeScript Declarations:**
358
+
359
+ ```bash
360
+ npm run build:types
361
+ npm run build:types:bundle
362
+ ```
363
+
364
+ ---
365
+
366
+ ## Testing
367
+
368
+ I use Jest for testing. Run the test suite with:
369
+
370
+ ```bash
371
+ npm test
372
+ ```
373
+
374
+ Contributions to tests are very welcome! 🧪
375
+
376
+ ---
377
+
378
+ ## Contributing
379
+
380
+ I’d love to have you onboard as a contributor! Whether you're adding new features, squashing bugs, or sharing ideas, your input is invaluable. Please check out [CONTRIBUTING](CONTRIBUTING.md) for guidelines on getting started.
381
+
382
+ ---
383
+
384
+ ## License
385
+
386
+ Eleva is open-source and available under the [MIT License](LICENSE).
387
+
388
+ ---
389
+
390
+ ## Contact
391
+
392
+ - **Author:** [Tarek Raafat](https://github.com/TarekRaafat)
393
+ - **Email:** [tarek.m.raafat@gmail.com](mailto:tarek.m.raafat@gmail.com)
394
+ - **Website:** [tarekraafat.com](https://www.tarekraafat.com)
395
+
396
+ ---
397
+
398
+ **Note:** This is an alpha release. I'm still polishing things up, so expect some bumps along the way. Your feedback and contributions will help shape Eleva into something truly amazing. Let’s build something great together! 💪✨
399
+
400
+ ---
401
+
402
+ [![NPM](https://nodei.co/npm/eleva.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/eleva/)
403
+
404
+ ---
405
+
406
+ [Documentation](/docs/index.md) |
407
+ [Examples](/examples) |
408
+ [Changelog](/changelog.md) |
409
+ [GitHub Discussions](https://github.com/TarekRaafat/eleva/discussions)
@@ -0,0 +1,207 @@
1
+ /**
2
+ * @class 🎙️ Emitter
3
+ * @classdesc Robust inter-component communication with event bubbling.
4
+ * Implements a basic publish-subscribe pattern for event handling, allowing components
5
+ * to communicate through custom events.
6
+ */
7
+ declare class Emitter {
8
+ /** @type {Object.<string, Function[]>} */
9
+ events: {
10
+ [x: string]: Function[];
11
+ };
12
+ /**
13
+ * Registers an event handler for the specified event.
14
+ *
15
+ * @param {string} event - The name of the event.
16
+ * @param {function(...any): void} handler - The function to call when the event is emitted.
17
+ */
18
+ on(event: string, handler: (...args: any[]) => void): void;
19
+ /**
20
+ * Removes a previously registered event handler.
21
+ *
22
+ * @param {string} event - The name of the event.
23
+ * @param {function(...any): void} handler - The handler function to remove.
24
+ */
25
+ off(event: string, handler: (...args: any[]) => void): void;
26
+ /**
27
+ * Emits an event, invoking all handlers registered for that event.
28
+ *
29
+ * @param {string} event - The event name.
30
+ * @param {...any} args - Additional arguments to pass to the event handlers.
31
+ */
32
+ emit(event: string, ...args: any[]): void;
33
+ }
34
+
35
+ /**
36
+ * @class 🎨 Renderer
37
+ * @classdesc Handles DOM patching, diffing, and attribute updates.
38
+ * Provides methods for efficient DOM updates by diffing the new and old DOM structures
39
+ * and applying only the necessary changes.
40
+ */
41
+ declare class Renderer {
42
+ /**
43
+ * Patches the DOM of a container element with new HTML content.
44
+ *
45
+ * @param {HTMLElement} container - The container element to patch.
46
+ * @param {string} newHtml - The new HTML content to apply.
47
+ */
48
+ patchDOM(container: HTMLElement, newHtml: string): void;
49
+ /**
50
+ * Diffs two DOM trees (old and new) and applies updates to the old DOM.
51
+ *
52
+ * @param {HTMLElement} oldParent - The original DOM element.
53
+ * @param {HTMLElement} newParent - The new DOM element.
54
+ */
55
+ diff(oldParent: HTMLElement, newParent: HTMLElement): void;
56
+ /**
57
+ * Updates the attributes of an element to match those of a new element.
58
+ *
59
+ * @param {HTMLElement} oldEl - The element to update.
60
+ * @param {HTMLElement} newEl - The element providing the updated attributes.
61
+ */
62
+ updateAttributes(oldEl: HTMLElement, newEl: HTMLElement): void;
63
+ }
64
+
65
+ /**
66
+ * @typedef {Object} ComponentDefinition
67
+ * @property {function(Object<string, any>): (Object<string, any>|Promise<Object<string, any>>)} [setup]
68
+ * A setup function that initializes the component state and returns an object or a promise that resolves to an object.
69
+ * @property {function(Object<string, any>): string} template
70
+ * A function that returns the HTML template string for the component.
71
+ * @property {function(Object<string, any>): string} [style]
72
+ * An optional function that returns scoped CSS styles as a string.
73
+ * @property {Object<string, ComponentDefinition>} [children]
74
+ * An optional mapping of CSS selectors to child component definitions.
75
+ */
76
+ /**
77
+ * @class 🧩 Eleva
78
+ * @classdesc Signal-based component runtime framework with lifecycle hooks, scoped styles, and plugin support.
79
+ * Manages component registration, plugin integration, event handling, and DOM rendering.
80
+ */
81
+ declare class Eleva {
82
+ /**
83
+ * Creates a new Eleva instance.
84
+ *
85
+ * @param {string} name - The name of the Eleva instance.
86
+ * @param {Object<string, any>} [config={}] - Optional configuration for the instance.
87
+ */
88
+ constructor(name: string, config?: {
89
+ [x: string]: any;
90
+ });
91
+ /** @type {string} */
92
+ name: string;
93
+ /** @type {Object<string, any>} */
94
+ config: {
95
+ [x: string]: any;
96
+ };
97
+ /** @type {Object<string, ComponentDefinition>} */
98
+ _components: {
99
+ [x: string]: ComponentDefinition;
100
+ };
101
+ /** @type {Array<Object>} */
102
+ _plugins: Array<Object>;
103
+ /** @private */
104
+ private _lifecycleHooks;
105
+ /** @private {boolean} */
106
+ private _isMounted;
107
+ emitter: Emitter;
108
+ renderer: Renderer;
109
+ /**
110
+ * Integrates a plugin with the Eleva framework.
111
+ *
112
+ * @param {Object} plugin - The plugin object which should have an `install` function.
113
+ * @param {Object<string, any>} [options={}] - Optional options to pass to the plugin.
114
+ * @returns {Eleva} The Eleva instance (for chaining).
115
+ */
116
+ use(plugin: Object, options?: {
117
+ [x: string]: any;
118
+ }): Eleva;
119
+ /**
120
+ * Registers a component with the Eleva instance.
121
+ *
122
+ * @param {string} name - The name of the component.
123
+ * @param {ComponentDefinition} definition - The component definition including setup, template, style, and children.
124
+ * @returns {Eleva} The Eleva instance (for chaining).
125
+ */
126
+ component(name: string, definition: ComponentDefinition): Eleva;
127
+ /**
128
+ * Mounts a registered component to a DOM element.
129
+ *
130
+ * @param {HTMLElement} container - A DOM element where the component will be mounted.
131
+ * @param {string|ComponentDefinition} compName - The name of the component to mount or a component definition.
132
+ * @param {Object<string, any>} [props={}] - Optional properties to pass to the component.
133
+ * @returns {object|Promise<object>} An object representing the mounted component instance, or a Promise that resolves to it for asynchronous setups.
134
+ * @throws {Error} If the container is not found or if the component is not registered.
135
+ */
136
+ mount(container: HTMLElement, compName: string | ComponentDefinition, props?: {
137
+ [x: string]: any;
138
+ }): object | Promise<object>;
139
+ /**
140
+ * Prepares default no-operation lifecycle hook functions.
141
+ *
142
+ * @returns {Object<string, function(): void>} An object with keys for lifecycle hooks mapped to empty functions.
143
+ * @private
144
+ */
145
+ private _prepareLifecycleHooks;
146
+ /**
147
+ * Processes DOM elements for event binding based on attributes starting with "@".
148
+ *
149
+ * @param {HTMLElement} container - The container element in which to search for events.
150
+ * @param {Object<string, any>} context - The current context containing event handler definitions.
151
+ * @private
152
+ */
153
+ private _processEvents;
154
+ /**
155
+ * Injects scoped styles into the component's container.
156
+ *
157
+ * @param {HTMLElement} container - The container element.
158
+ * @param {string} compName - The component name used to identify the style element.
159
+ * @param {function(Object<string, any>): string} [styleFn] - A function that returns CSS styles as a string.
160
+ * @param {Object<string, any>} context - The current context for style interpolation.
161
+ * @private
162
+ */
163
+ private _injectStyles;
164
+ /**
165
+ * Mounts child components within the parent component's container.
166
+ *
167
+ * @param {HTMLElement} container - The parent container element.
168
+ * @param {Object<string, ComponentDefinition>} [children] - An object mapping child component selectors to their definitions.
169
+ * @param {Array<object>} childInstances - An array to store the mounted child component instances.
170
+ * @private
171
+ */
172
+ private _mountChildren;
173
+ }
174
+ type ComponentDefinition = {
175
+ /**
176
+ * A setup function that initializes the component state and returns an object or a promise that resolves to an object.
177
+ */
178
+ setup?: ((arg0: {
179
+ [x: string]: any;
180
+ }) => ({
181
+ [x: string]: any;
182
+ } | Promise<{
183
+ [x: string]: any;
184
+ }>)) | undefined;
185
+ /**
186
+ * A function that returns the HTML template string for the component.
187
+ */
188
+ template: (arg0: {
189
+ [x: string]: any;
190
+ }) => string;
191
+ /**
192
+ * An optional function that returns scoped CSS styles as a string.
193
+ */
194
+ style?: ((arg0: {
195
+ [x: string]: any;
196
+ }) => string) | undefined;
197
+ /**
198
+ * An optional mapping of CSS selectors to child component definitions.
199
+ */
200
+ children?: {
201
+ [x: string]: ComponentDefinition;
202
+ } | undefined;
203
+ };
204
+
205
+ //# sourceMappingURL=index.d.ts.map
206
+
207
+ export { Eleva as default };