@flightdev/ui 2.0.0

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.
Files changed (118) hide show
  1. package/.turbo/turbo-build.log +81 -0
  2. package/.turbo/turbo-lint.log +40 -0
  3. package/.turbo/turbo-typecheck.log +4 -0
  4. package/LICENSE +21 -0
  5. package/README.md +92 -0
  6. package/TESTING.md +124 -0
  7. package/dist/adapter-MMD-iHNx.d.ts +424 -0
  8. package/dist/adapters/tier-1/angular.d.ts +60 -0
  9. package/dist/adapters/tier-1/angular.js +2 -0
  10. package/dist/adapters/tier-1/index.d.ts +7 -0
  11. package/dist/adapters/tier-1/index.js +7 -0
  12. package/dist/adapters/tier-1/qwik.d.ts +55 -0
  13. package/dist/adapters/tier-1/qwik.js +2 -0
  14. package/dist/adapters/tier-1/react.d.ts +67 -0
  15. package/dist/adapters/tier-1/react.js +2 -0
  16. package/dist/adapters/tier-1/solid.d.ts +45 -0
  17. package/dist/adapters/tier-1/solid.js +2 -0
  18. package/dist/adapters/tier-1/svelte.d.ts +48 -0
  19. package/dist/adapters/tier-1/svelte.js +2 -0
  20. package/dist/adapters/tier-1/vue.d.ts +47 -0
  21. package/dist/adapters/tier-1/vue.js +2 -0
  22. package/dist/adapters/tier-2/index.d.ts +7 -0
  23. package/dist/adapters/tier-2/index.js +7 -0
  24. package/dist/adapters/tier-2/inferno.d.ts +31 -0
  25. package/dist/adapters/tier-2/inferno.js +2 -0
  26. package/dist/adapters/tier-2/lit.d.ts +34 -0
  27. package/dist/adapters/tier-2/lit.js +2 -0
  28. package/dist/adapters/tier-2/marko.d.ts +59 -0
  29. package/dist/adapters/tier-2/marko.js +2 -0
  30. package/dist/adapters/tier-2/mithril.d.ts +31 -0
  31. package/dist/adapters/tier-2/mithril.js +2 -0
  32. package/dist/adapters/tier-2/preact.d.ts +33 -0
  33. package/dist/adapters/tier-2/preact.js +2 -0
  34. package/dist/adapters/tier-2/stencil.d.ts +52 -0
  35. package/dist/adapters/tier-2/stencil.js +2 -0
  36. package/dist/adapters/tier-3/alpine.d.ts +73 -0
  37. package/dist/adapters/tier-3/alpine.js +2 -0
  38. package/dist/adapters/tier-3/hotwire.d.ts +71 -0
  39. package/dist/adapters/tier-3/hotwire.js +2 -0
  40. package/dist/adapters/tier-3/htmx.d.ts +88 -0
  41. package/dist/adapters/tier-3/htmx.js +2 -0
  42. package/dist/adapters/tier-3/index.d.ts +7 -0
  43. package/dist/adapters/tier-3/index.js +7 -0
  44. package/dist/adapters/tier-3/petite-vue.d.ts +56 -0
  45. package/dist/adapters/tier-3/petite-vue.js +2 -0
  46. package/dist/adapters/tier-3/stimulus.d.ts +63 -0
  47. package/dist/adapters/tier-3/stimulus.js +2 -0
  48. package/dist/adapters/tier-3/vanilla.d.ts +63 -0
  49. package/dist/adapters/tier-3/vanilla.js +2 -0
  50. package/dist/chunk-2SNQ6PTM.js +217 -0
  51. package/dist/chunk-3D4XMIZI.js +136 -0
  52. package/dist/chunk-3HU6GSQ4.js +125 -0
  53. package/dist/chunk-4PZDNFL7.js +148 -0
  54. package/dist/chunk-5IBLFTYL.js +114 -0
  55. package/dist/chunk-64JZJ7OK.js +142 -0
  56. package/dist/chunk-7ZJI3QU2.js +132 -0
  57. package/dist/chunk-CE4FJHQJ.js +133 -0
  58. package/dist/chunk-DTCAUBH5.js +87 -0
  59. package/dist/chunk-NTASPOHG.js +106 -0
  60. package/dist/chunk-OI2AMQLG.js +152 -0
  61. package/dist/chunk-Q7HUE44H.js +106 -0
  62. package/dist/chunk-QH3LOWXU.js +155 -0
  63. package/dist/chunk-QIVAK6BH.js +103 -0
  64. package/dist/chunk-V34XPVGK.js +103 -0
  65. package/dist/chunk-VK7ZPMO7.js +221 -0
  66. package/dist/chunk-X6CNUW6T.js +136 -0
  67. package/dist/chunk-XTDK7ME5.js +382 -0
  68. package/dist/chunk-YFGSHW5S.js +121 -0
  69. package/dist/chunk-ZAJVSE7J.js +90 -0
  70. package/dist/core/index.d.ts +161 -0
  71. package/dist/core/index.js +2 -0
  72. package/dist/index.d.ts +103 -0
  73. package/dist/index.js +71 -0
  74. package/docs/ADAPTERS.md +946 -0
  75. package/docs/PATTERNS.md +836 -0
  76. package/package.json +229 -0
  77. package/src/adapters/tier-1/angular.ts +223 -0
  78. package/src/adapters/tier-1/index.ts +12 -0
  79. package/src/adapters/tier-1/qwik.ts +177 -0
  80. package/src/adapters/tier-1/react.ts +330 -0
  81. package/src/adapters/tier-1/solid.ts +222 -0
  82. package/src/adapters/tier-1/svelte.ts +211 -0
  83. package/src/adapters/tier-1/vue.ts +234 -0
  84. package/src/adapters/tier-2/index.ts +12 -0
  85. package/src/adapters/tier-2/inferno.ts +149 -0
  86. package/src/adapters/tier-2/lit.ts +191 -0
  87. package/src/adapters/tier-2/marko.ts +199 -0
  88. package/src/adapters/tier-2/mithril.ts +152 -0
  89. package/src/adapters/tier-2/preact.ts +133 -0
  90. package/src/adapters/tier-2/stencil.ts +214 -0
  91. package/src/adapters/tier-3/alpine.ts +218 -0
  92. package/src/adapters/tier-3/hotwire.ts +254 -0
  93. package/src/adapters/tier-3/htmx.ts +263 -0
  94. package/src/adapters/tier-3/index.ts +12 -0
  95. package/src/adapters/tier-3/petite-vue.ts +163 -0
  96. package/src/adapters/tier-3/stimulus.ts +233 -0
  97. package/src/adapters/tier-3/vanilla.ts +252 -0
  98. package/src/ambient.d.ts +310 -0
  99. package/src/core/adapter.ts +366 -0
  100. package/src/core/index.ts +56 -0
  101. package/src/core/registry.ts +518 -0
  102. package/src/core/types.ts +461 -0
  103. package/src/htmx.ts +134 -0
  104. package/src/index.ts +263 -0
  105. package/test/__mocks__/stencil-core.ts +19 -0
  106. package/test/__mocks__/stencil-hydrate.ts +15 -0
  107. package/test/adapters/tier-1.test.ts +206 -0
  108. package/test/adapters/tier-2.test.ts +175 -0
  109. package/test/adapters/tier-3.test.ts +284 -0
  110. package/test/contracts/adapter.contract.ts +293 -0
  111. package/test/core/core.test.ts +310 -0
  112. package/test/errors/error-handling.test.ts +454 -0
  113. package/test/integration/htmx.integration.test.ts +246 -0
  114. package/test/integration/react.integration.test.ts +271 -0
  115. package/test/integration/registry.integration.test.ts +308 -0
  116. package/tsconfig.json +22 -0
  117. package/tsup.config.ts +93 -0
  118. package/vitest.config.ts +101 -0
@@ -0,0 +1,252 @@
1
+ /**
2
+ * @flightdev/ui - Vanilla Web Components Adapter (Tier 3)
3
+ *
4
+ * Pure Web Components adapter - no framework, just standards.
5
+ *
6
+ * @module @flightdev/ui/vanilla
7
+ * @version 2.0.0
8
+ */
9
+
10
+ import { BaseUIAdapter } from '../../core/adapter.js';
11
+ import type {
12
+ AdapterCapabilities,
13
+ Component,
14
+ RenderContext,
15
+ RenderResult,
16
+ Island,
17
+ IslandOptions,
18
+ } from '../../core/types.js';
19
+
20
+ // ============================================================================
21
+ // Types
22
+ // ============================================================================
23
+
24
+ export interface VanillaAdapterOptions {
25
+ /** Enable declarative shadow DOM */
26
+ declarativeShadowDom?: boolean;
27
+
28
+ /** Polyfill for older browsers */
29
+ polyfill?: boolean;
30
+ }
31
+
32
+ // ============================================================================
33
+ // Vanilla Adapter
34
+ // ============================================================================
35
+
36
+ export class VanillaAdapter extends BaseUIAdapter {
37
+ readonly id = 'vanilla';
38
+ readonly name = 'Vanilla Web Components';
39
+ readonly framework = 'vanilla';
40
+ readonly frameworkVersion = 'ES2022+';
41
+ readonly tier = 'tier-3' as const;
42
+
43
+ override readonly capabilities: AdapterCapabilities = {
44
+ streaming: false,
45
+ partialHydration: false,
46
+ islands: true, // Web Components ARE islands
47
+ resumable: false,
48
+ ssg: true,
49
+ csr: true,
50
+ serverComponents: false,
51
+ };
52
+
53
+ constructor(private options: VanillaAdapterOptions = {}) {
54
+ super();
55
+ }
56
+
57
+ async renderToString(
58
+ component: Component,
59
+ _context?: RenderContext
60
+ ): Promise<RenderResult> {
61
+ const startTime = performance.now();
62
+
63
+ let html: string;
64
+
65
+ if (typeof component.component === 'string') {
66
+ // Component is a tag name
67
+ const tagName = component.component;
68
+ const props = component.props ?? {};
69
+
70
+ const attrs = Object.entries(props)
71
+ .map(([key, value]) => {
72
+ const attrName = key.replace(/([A-Z])/g, '-$1').toLowerCase();
73
+ return `${attrName}="${this.escapeHtml(String(value))}"`;
74
+ })
75
+ .join(' ');
76
+
77
+ html = `<${tagName} ${attrs}></${tagName}>`;
78
+ } else if (typeof component.component === 'function') {
79
+ html = (component.component as (props: unknown) => string)(component.props ?? {});
80
+ } else {
81
+ throw new Error(
82
+ '[Flight/Vanilla] Components must be tag names or template functions.'
83
+ );
84
+ }
85
+
86
+ return {
87
+ html,
88
+ hydrationData: {
89
+ props: component.props,
90
+ componentId: component.id ?? this.generateId(),
91
+ },
92
+ timing: this.createTiming(startTime),
93
+ };
94
+ }
95
+
96
+ override createIsland(
97
+ component: unknown,
98
+ props?: Record<string, unknown>,
99
+ options?: IslandOptions
100
+ ): Island {
101
+ const tagName = component as string;
102
+ const id = this.generateId();
103
+
104
+ const attrs = Object.entries(props ?? {})
105
+ .map(([key, value]) => {
106
+ const attrName = key.replace(/([A-Z])/g, '-$1').toLowerCase();
107
+ return `${attrName}="${this.escapeHtml(String(value))}"`;
108
+ })
109
+ .join(' ');
110
+
111
+ const placeholder = `
112
+ <${tagName}
113
+ ${attrs}
114
+ data-flight-island="${id}"
115
+ data-flight-hydrate="${options?.hydrate ?? 'load'}"
116
+ ></${tagName}>
117
+ `.trim();
118
+
119
+ return {
120
+ id,
121
+ component,
122
+ props,
123
+ options: options ?? { hydrate: 'load' },
124
+ placeholder,
125
+ };
126
+ }
127
+
128
+ override getHydrationScript(_result: RenderResult): string {
129
+ const { polyfill = false } = this.options;
130
+
131
+ let scripts = `
132
+ <!-- Flight/Vanilla Web Components -->
133
+ <script>
134
+ window.__FLIGHT_ADAPTER__ = 'vanilla';
135
+ </script>
136
+ `;
137
+
138
+ if (polyfill) {
139
+ scripts += `
140
+ <script src="https://unpkg.com/@webcomponents/webcomponentsjs@2.8.0/webcomponents-loader.js"></script>
141
+ `;
142
+ }
143
+
144
+ return scripts.trim();
145
+ }
146
+
147
+ override getClientEntry(): string {
148
+ return `
149
+ // Vanilla Web Components Client Entry
150
+ // Components self-register when their scripts are loaded
151
+
152
+ export function hydrate() {
153
+ // Web Components auto-upgrade when defined
154
+ console.log('[Flight/Vanilla] Web Components ready');
155
+ }
156
+
157
+ // Helper to define a custom element
158
+ export function define(tagName, elementClass) {
159
+ if (!customElements.get(tagName)) {
160
+ customElements.define(tagName, elementClass);
161
+ }
162
+ }
163
+
164
+ // Wait for a component to be defined
165
+ export function whenDefined(tagName) {
166
+ return customElements.whenDefined(tagName);
167
+ }
168
+
169
+ // Upgrade all elements matching a selector
170
+ export function upgradeAll(selector = '*') {
171
+ document.querySelectorAll(selector).forEach(el => {
172
+ customElements.upgrade(el);
173
+ });
174
+ }
175
+ `.trim();
176
+ }
177
+ }
178
+
179
+ // ============================================================================
180
+ // Template Helpers
181
+ // ============================================================================
182
+
183
+ /**
184
+ * Create a custom element with declarative shadow DOM
185
+ */
186
+ export function shadowRoot(content: string, mode: 'open' | 'closed' = 'open'): string {
187
+ return `<template shadowrootmode="${mode}">${content}</template>`;
188
+ }
189
+
190
+ /**
191
+ * Create a slot element
192
+ */
193
+ export function slot(name?: string): string {
194
+ return name ? `<slot name="${name}"></slot>` : '<slot></slot>';
195
+ }
196
+
197
+ /**
198
+ * Create a basic custom element class string (for inline scripts)
199
+ */
200
+ export function createElementClass(tagName: string, options: {
201
+ connectedCallback?: string;
202
+ observedAttributes?: string[];
203
+ template?: string;
204
+ } = {}): string {
205
+ const className = tagName
206
+ .split('-')
207
+ .map(s => s.charAt(0).toUpperCase() + s.slice(1))
208
+ .join('');
209
+
210
+ return `
211
+ class ${className} extends HTMLElement {
212
+ ${options.observedAttributes ? `static observedAttributes = ${JSON.stringify(options.observedAttributes)};` : ''}
213
+
214
+ constructor() {
215
+ super();
216
+ ${options.template ? `
217
+ this.attachShadow({ mode: 'open' });
218
+ this.shadowRoot.innerHTML = \`${options.template}\`;
219
+ ` : ''}
220
+ }
221
+
222
+ connectedCallback() {
223
+ ${options.connectedCallback ?? ''}
224
+ }
225
+ }
226
+
227
+ customElements.define('${tagName}', ${className});
228
+ `.trim();
229
+ }
230
+
231
+ // ============================================================================
232
+ // Factory Function
233
+ // ============================================================================
234
+
235
+ /**
236
+ * Create a Vanilla Web Components UI adapter.
237
+ *
238
+ * @example
239
+ * ```typescript
240
+ * import { vanilla } from '@flightdev/ui/vanilla';
241
+ * import { defineUI } from '@flightdev/ui';
242
+ *
243
+ * export default defineUI(vanilla({
244
+ * declarativeShadowDom: true,
245
+ * }));
246
+ * ```
247
+ */
248
+ export function vanilla(options?: VanillaAdapterOptions): VanillaAdapter {
249
+ return new VanillaAdapter(options);
250
+ }
251
+
252
+ export default vanilla;
@@ -0,0 +1,310 @@
1
+ /**
2
+ * Type declarations for UI framework peer dependencies
3
+ * Following 2026 best practices: specific types instead of any
4
+ */
5
+
6
+ // ============================================================================
7
+ // Node.js Types (for SSR)
8
+ // ============================================================================
9
+
10
+ declare namespace NodeJS {
11
+ interface WritableStream {
12
+ write(chunk: unknown): boolean;
13
+ end(cb?: () => void): void;
14
+ on(event: string, listener: (...args: unknown[]) => void): this;
15
+ }
16
+ }
17
+
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
+ declare const Buffer: any;
20
+
21
+ // ============================================================================
22
+ // React
23
+ // ============================================================================
24
+
25
+ declare namespace React {
26
+ type ComponentType<P = object> = (props: P) => ReactNode;
27
+ type ReactNode = string | number | boolean | null | undefined | ReactElement;
28
+ interface ReactElement {
29
+ type: string | ComponentType;
30
+ props: Record<string, unknown>;
31
+ key: string | number | null;
32
+ }
33
+ }
34
+
35
+ declare module 'react' {
36
+ export type ComponentType<P = object> = React.ComponentType<P>;
37
+ export type ReactNode = React.ReactNode;
38
+ export type ReactElement = React.ReactElement;
39
+
40
+ export function createElement<P extends object>(
41
+ type: string | ComponentType<P>,
42
+ props?: P | null,
43
+ ...children: ReactNode[]
44
+ ): ReactElement;
45
+ }
46
+
47
+ declare module 'react-dom/server' {
48
+ import type { ReactElement } from 'react';
49
+
50
+ export function renderToString(element: ReactElement): string;
51
+ export function renderToStaticMarkup(element: ReactElement): string;
52
+
53
+ export interface PipeableStream {
54
+ pipe<T extends NodeJS.WritableStream>(destination: T): T;
55
+ abort(): void;
56
+ }
57
+
58
+ export interface RenderToPipeableStreamOptions {
59
+ onShellReady?: () => void;
60
+ onShellError?: (error: Error) => void;
61
+ onAllReady?: () => void;
62
+ onError?: (error: Error) => void;
63
+ }
64
+
65
+ export function renderToPipeableStream(
66
+ element: ReactElement,
67
+ options?: RenderToPipeableStreamOptions
68
+ ): PipeableStream;
69
+
70
+ // Web Streams API version (for Node.js 18+, Deno, Edge runtimes)
71
+ export interface RenderToReadableStreamOptions {
72
+ signal?: AbortSignal;
73
+ onError?: (error: unknown) => void;
74
+ nonce?: string;
75
+ bootstrapScriptContent?: string;
76
+ bootstrapScripts?: string[];
77
+ bootstrapModules?: string[];
78
+ }
79
+
80
+ export function renderToReadableStream(
81
+ element: ReactElement,
82
+ options?: RenderToReadableStreamOptions
83
+ ): Promise<ReadableStream<Uint8Array>>;
84
+ }
85
+
86
+ declare module 'react-dom/client' {
87
+ import type { ReactElement } from 'react';
88
+
89
+ export interface Root {
90
+ render(children: ReactElement): void;
91
+ unmount(): void;
92
+ }
93
+
94
+ export function hydrateRoot(container: Element | null, children: ReactElement): Root;
95
+ export function createRoot(container: Element | null): Root;
96
+ }
97
+
98
+ // ============================================================================
99
+ // Vue 3
100
+ // ============================================================================
101
+
102
+ declare module 'vue' {
103
+ export interface App<T = unknown> {
104
+ mount(selector: string | Element): T;
105
+ unmount(): void;
106
+ }
107
+
108
+ export type Component = object;
109
+
110
+ export function createSSRApp(rootComponent: Component, rootProps?: object): App;
111
+ export function createApp(rootComponent: Component, rootProps?: object): App;
112
+ }
113
+
114
+ declare module 'vue/server-renderer' {
115
+ import type { App } from 'vue';
116
+
117
+ export function renderToString(app: App): Promise<string>;
118
+ export function renderToWebStream(app: App): ReadableStream<Uint8Array>;
119
+ }
120
+
121
+ // ============================================================================
122
+ // Angular
123
+ // ============================================================================
124
+
125
+ declare module '@angular/platform-server' {
126
+ export function renderApplication(
127
+ bootstrap: (document: string, url: string) => Promise<unknown>,
128
+ options: { document: string; url: string }
129
+ ): Promise<string>;
130
+ }
131
+
132
+ declare module '@angular/platform-browser' {
133
+ export function provideClientHydration(...features: unknown[]): unknown;
134
+ export function withIncrementalHydration(): unknown;
135
+ export function withEventReplay(): unknown;
136
+ }
137
+
138
+ // ============================================================================
139
+ // Solid.js
140
+ // ============================================================================
141
+
142
+ declare module 'solid-js' {
143
+ export type JSXElement = object;
144
+ }
145
+
146
+ declare module 'solid-js/web' {
147
+ export function renderToString(fn: () => object): Promise<string>;
148
+ export function hydrate(fn: () => object, node: Element | null): void;
149
+ export function render(fn: () => object, node: Element | null): void;
150
+
151
+ export interface StreamResult {
152
+ readable: ReadableStream<Uint8Array>;
153
+ done: Promise<void>;
154
+ }
155
+
156
+ export function renderToStream(fn: () => object): StreamResult;
157
+ }
158
+
159
+ // ============================================================================
160
+ // Svelte
161
+ // ============================================================================
162
+
163
+ declare module 'svelte' {
164
+ export interface SvelteComponent {
165
+ render(props?: object): {
166
+ html: string;
167
+ head?: string;
168
+ css?: { code: string };
169
+ };
170
+ }
171
+
172
+ export function mount<T>(
173
+ component: T,
174
+ options: { target: Element; props?: object }
175
+ ): unknown;
176
+
177
+ export function hydrate<T>(
178
+ component: T,
179
+ options: { target: Element; props?: object }
180
+ ): unknown;
181
+ }
182
+
183
+ declare module 'svelte/server' {
184
+ export function render<T>(
185
+ component: T,
186
+ options: { props?: object }
187
+ ): { body: string; head: string };
188
+ }
189
+
190
+ // ============================================================================
191
+ // Qwik
192
+ // ============================================================================
193
+
194
+ declare module '@builder.io/qwik/server' {
195
+ export interface RenderToStringResult {
196
+ html: string;
197
+ }
198
+
199
+ export function renderToString(
200
+ component: () => unknown,
201
+ options?: { containerTagName?: string }
202
+ ): Promise<RenderToStringResult>;
203
+ }
204
+
205
+ // ============================================================================
206
+ // Tier 2 Frameworks
207
+ // ============================================================================
208
+
209
+ declare namespace preact {
210
+ type FunctionComponent<P = object> = (props: P) => unknown;
211
+ }
212
+
213
+ declare module 'preact' {
214
+ export function h(
215
+ type: string | preact.FunctionComponent,
216
+ props?: object,
217
+ ...children: unknown[]
218
+ ): object;
219
+ }
220
+
221
+ declare module 'preact-render-to-string' {
222
+ export default function renderToString(vnode: object): string;
223
+ export function renderToString(vnode: object): string;
224
+ }
225
+
226
+ declare module 'lit' {
227
+ export function html(strings: TemplateStringsArray, ...values: unknown[]): unknown;
228
+ }
229
+
230
+ declare module '@lit-labs/ssr' {
231
+ export function render(template: unknown): Iterable<string>;
232
+ }
233
+
234
+ declare module '@lit-labs/ssr/lib/render-result.js' {
235
+ export function collectResult(result: Iterable<string>): Promise<string>;
236
+ }
237
+
238
+ declare module 'marko' { }
239
+
240
+ declare module '@stencil/core/hydrate' {
241
+ export interface RenderToStringResult {
242
+ html: string;
243
+ diagnostics: unknown[];
244
+ }
245
+
246
+ export interface RenderToStringOptions {
247
+ fullDocument?: boolean;
248
+ serializeShadowRoot?: 'declarative-shadow-dom' | undefined;
249
+ prettyHtml?: boolean;
250
+ }
251
+
252
+ export function renderToString(
253
+ html: string,
254
+ options?: RenderToStringOptions
255
+ ): Promise<RenderToStringResult>;
256
+ }
257
+
258
+ declare namespace mithril {
259
+ type Component<P = object> = {
260
+ view: (vnode: { attrs: P }) => unknown;
261
+ };
262
+ }
263
+
264
+ declare module 'mithril' {
265
+ export default function m(
266
+ selector: string | mithril.Component,
267
+ attrs?: object,
268
+ ...children: unknown[]
269
+ ): object;
270
+ }
271
+
272
+ declare module 'mithril-node-render' {
273
+ export default function render(vnode: object): Promise<string>;
274
+ }
275
+
276
+ declare namespace inferno {
277
+ type Component<P = object> = (props: P) => unknown;
278
+ }
279
+
280
+ declare module 'inferno-server' {
281
+ export function renderToString(element: object): string;
282
+ }
283
+
284
+ declare module 'inferno-create-element' {
285
+ export function createElement(
286
+ type: string | inferno.Component,
287
+ props?: object,
288
+ ...children: unknown[]
289
+ ): object;
290
+ }
291
+
292
+ declare module 'inferno-hydrate' {
293
+ export function hydrate(element: object, container: Element | null): void;
294
+ }
295
+
296
+ declare module 'inferno' {
297
+ export function render(element: object, container: Element | null): void;
298
+ }
299
+
300
+ // ============================================================================
301
+ // Stream (Node.js)
302
+ // ============================================================================
303
+
304
+ declare module 'stream' {
305
+ export class Readable {
306
+ constructor(options?: { read?: () => void });
307
+ on(event: string, listener: (...args: unknown[]) => void): this;
308
+ pipe<T>(destination: T): T;
309
+ }
310
+ }