ilha 0.14.2 → 0.14.4

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.
@@ -1,32 +0,0 @@
1
- import "effect/Scope";
2
- import { AtomRegistry } from "effect/unstable/reactivity/AtomRegistry";
3
- import { Effect, Stream } from "effect";
4
- import { Atom } from "effect/unstable/reactivity";
5
- //#region src/types.d.ts
6
- type JsonText = string | number | bigint | boolean | null | undefined;
7
- type View = VNode | JsonText | AtomHandle<any> | Stream.Stream<View, any, any> | GeneratorFn | Component | View[] | Iterable<View>;
8
- declare const Fragment: unique symbol;
9
- type Fragment = typeof Fragment;
10
- interface VNode {
11
- readonly $$ilha: 1;
12
- readonly type: string | Fragment | ((props: Record<string, unknown>) => unknown);
13
- readonly props: Record<string, unknown>;
14
- readonly children: View[];
15
- readonly key?: string | number;
16
- }
17
- type GeneratorFn = (this: void, ...args: any[]) => Generator<Yielded, View | void, unknown>;
18
- type Yielded = View | Instruction<any> | Effect.Effect<any, any, any>;
19
- interface Instruction<A, E = unknown> extends Iterable<Instruction<A, E>, A>, PromiseLike<A> {
20
- readonly $$ilhaOp: 1;
21
- readonly effect: Effect.Effect<A, E, AtomRegistry>;
22
- }
23
- type Component = (() => View | void | Promise<View | void>) | GeneratorFn;
24
- interface AtomHandle<A> {
25
- readonly $$atom: 1;
26
- readonly atom: Atom.Atom<A>;
27
- (): A;
28
- set(next: A): void;
29
- update(f: (current: A) => A): void;
30
- }
31
- //#endregion
32
- export { VNode as a, Instruction as i, Component as n, View as o, Fragment as r, Yielded as s, AtomHandle as t };
@@ -1,37 +0,0 @@
1
- //#region src/types.ts
2
- const Fragment = Symbol("ilha.Fragment");
3
-
4
- //#endregion
5
- //#region src/vnode.ts
6
- function h(type, props, ...rest) {
7
- const p = { ...props };
8
- const fromProps = p.children;
9
- delete p.children;
10
- const children = flatten([...fromProps === void 0 ? [] : [fromProps], ...rest]);
11
- const key = p.key;
12
- delete p.key;
13
- return {
14
- $$ilha: 1,
15
- type,
16
- props: p,
17
- children,
18
- key
19
- };
20
- }
21
- function flatten(xs) {
22
- const out = [];
23
- for (const x of xs) if (Array.isArray(x)) out.push(...flatten(x));
24
- else out.push(x);
25
- return out;
26
- }
27
- function isVNode(x) {
28
- return typeof x === "object" && x !== null && x.$$ilha === 1;
29
- }
30
- function isSetupFn(x) {
31
- if (typeof x !== "function") return false;
32
- const n = x.constructor?.name;
33
- return n === "GeneratorFunction" || n === "AsyncFunction";
34
- }
35
-
36
- //#endregion
37
- export { Fragment as i, isSetupFn as n, isVNode as r, h as t };
@@ -1,20 +0,0 @@
1
- import { a as VNode, o as View, r as Fragment } from "./types-Cie0Ihl6.js";
2
- //#region src/jsx-types.d.ts
3
- declare namespace JSX {
4
- type Element = View;
5
- type ElementType = string | ((props: Record<string, unknown>) => View | Promise<View | void> | Generator<unknown, View | void, unknown>);
6
- interface IntrinsicElements {
7
- [tag: string]: {
8
- ref?: (el: globalThis.Element | null) => void;
9
- [key: string]: unknown;
10
- };
11
- }
12
- interface ElementChildrenAttribute {
13
- children: {};
14
- }
15
- }
16
- //#endregion
17
- //#region src/vnode.d.ts
18
- declare function h(type: string | Fragment | ((props: Record<string, unknown>) => unknown), props: Record<string, unknown> | null | undefined, ...rest: View[]): VNode;
19
- //#endregion
20
- export { JSX as n, h as t };