@manyducks.co/dolla 2.0.0-alpha.8 → 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 (108) hide show
  1. package/README.md +222 -512
  2. package/dist/core/app.d.ts +24 -0
  3. package/dist/core/context.d.ts +147 -0
  4. package/dist/core/env.d.ts +3 -0
  5. package/dist/core/hooks.d.ts +70 -0
  6. package/dist/core/hooks.test.d.ts +1 -0
  7. package/dist/core/index.d.ts +25 -0
  8. package/dist/core/logger.d.ts +42 -0
  9. package/dist/core/logger.test.d.ts +0 -0
  10. package/dist/core/markup.d.ts +82 -0
  11. package/dist/core/markup.test.d.ts +0 -0
  12. package/dist/core/nodes/_markup.d.ts +36 -0
  13. package/dist/core/nodes/dom.d.ts +13 -0
  14. package/dist/core/nodes/dynamic.d.ts +22 -0
  15. package/dist/core/nodes/element.d.ts +27 -0
  16. package/dist/core/nodes/portal.d.ts +18 -0
  17. package/dist/core/nodes/repeat.d.ts +27 -0
  18. package/dist/core/nodes/view.d.ts +25 -0
  19. package/dist/core/ref.d.ts +19 -0
  20. package/dist/core/ref.test.d.ts +1 -0
  21. package/dist/core/signals.d.ts +100 -0
  22. package/dist/core/signals.test.d.ts +1 -0
  23. package/dist/{views → core/views}/default-crash-view.d.ts +11 -4
  24. package/dist/core/views/for.d.ts +21 -0
  25. package/dist/core/views/fragment.d.ts +7 -0
  26. package/dist/core/views/portal.d.ts +16 -0
  27. package/dist/core/views/show.d.ts +25 -0
  28. package/dist/fragment-BahD_BJA.js +7 -0
  29. package/dist/fragment-BahD_BJA.js.map +1 -0
  30. package/dist/{modules/http.d.ts → http/index.d.ts} +3 -5
  31. package/dist/http.js +150 -0
  32. package/dist/http.js.map +1 -0
  33. package/dist/i18n/index.d.ts +134 -0
  34. package/dist/i18n.js +309 -0
  35. package/dist/i18n.js.map +1 -0
  36. package/dist/index-DRJlxs-Q.js +535 -0
  37. package/dist/index-DRJlxs-Q.js.map +1 -0
  38. package/dist/index.js +160 -1386
  39. package/dist/index.js.map +1 -1
  40. package/dist/jsx-dev-runtime.d.ts +3 -2
  41. package/dist/jsx-dev-runtime.js +5 -12
  42. package/dist/jsx-dev-runtime.js.map +1 -1
  43. package/dist/jsx-runtime.d.ts +4 -3
  44. package/dist/jsx-runtime.js +9 -15
  45. package/dist/jsx-runtime.js.map +1 -1
  46. package/dist/logger-Aqi9m1CF.js +565 -0
  47. package/dist/logger-Aqi9m1CF.js.map +1 -0
  48. package/dist/markup-8jNhoqDe.js +1089 -0
  49. package/dist/markup-8jNhoqDe.js.map +1 -0
  50. package/dist/router/hooks.d.ts +2 -0
  51. package/dist/router/index.d.ts +3 -0
  52. package/dist/router/router.d.ts +166 -0
  53. package/dist/{routing.d.ts → router/router.utils.d.ts} +17 -3
  54. package/dist/router/router.utils.test.d.ts +1 -0
  55. package/dist/router.js +6 -0
  56. package/dist/router.js.map +1 -0
  57. package/dist/typeChecking-5kmX0ulW.js +65 -0
  58. package/dist/typeChecking-5kmX0ulW.js.map +1 -0
  59. package/dist/typeChecking.d.ts +2 -98
  60. package/dist/typeChecking.test.d.ts +1 -0
  61. package/dist/types.d.ts +97 -25
  62. package/dist/utils.d.ts +25 -3
  63. package/docs/buildless.md +132 -0
  64. package/docs/components.md +238 -0
  65. package/docs/hooks.md +356 -0
  66. package/docs/http.md +178 -0
  67. package/docs/i18n.md +220 -0
  68. package/docs/index.md +10 -0
  69. package/docs/markup.md +136 -0
  70. package/docs/mixins.md +176 -0
  71. package/docs/ref.md +77 -0
  72. package/docs/router.md +281 -0
  73. package/docs/setup.md +137 -0
  74. package/docs/signals.md +262 -0
  75. package/docs/stores.md +113 -0
  76. package/docs/views.md +356 -0
  77. package/index.d.ts +2 -2
  78. package/notes/atomic.md +452 -0
  79. package/notes/elimination.md +33 -0
  80. package/notes/observable.md +180 -0
  81. package/notes/scratch.md +350 -18
  82. package/notes/splitting.md +5 -0
  83. package/package.json +29 -15
  84. package/vite.config.js +5 -11
  85. package/build.js +0 -34
  86. package/dist/index.d.ts +0 -21
  87. package/dist/markup.d.ts +0 -108
  88. package/dist/modules/dolla.d.ts +0 -111
  89. package/dist/modules/language.d.ts +0 -41
  90. package/dist/modules/render.d.ts +0 -17
  91. package/dist/modules/router.d.ts +0 -152
  92. package/dist/nodes/cond.d.ts +0 -26
  93. package/dist/nodes/html.d.ts +0 -31
  94. package/dist/nodes/observer.d.ts +0 -29
  95. package/dist/nodes/outlet.d.ts +0 -22
  96. package/dist/nodes/portal.d.ts +0 -19
  97. package/dist/nodes/repeat.d.ts +0 -34
  98. package/dist/nodes/text.d.ts +0 -19
  99. package/dist/passthrough-9kwwjgWk.js +0 -1279
  100. package/dist/passthrough-9kwwjgWk.js.map +0 -1
  101. package/dist/state.d.ts +0 -101
  102. package/dist/view.d.ts +0 -65
  103. package/dist/views/passthrough.d.ts +0 -5
  104. package/notes/context-vars.md +0 -21
  105. package/notes/readme-scratch.md +0 -222
  106. package/notes/route-middleware.md +0 -42
  107. package/tests/state.test.js +0 -135
  108. /package/dist/{routing.test.d.ts → core/context.test.d.ts} +0 -0
@@ -1,111 +0,0 @@
1
- import { createRef, isRef, MarkupNode, type Markup } from "../markup.js";
2
- import { createSettableState, createState, derive, toSettableState, toState, valueOf, watch, type State } from "../state.js";
3
- import { type ViewFunction, type ViewNode } from "../view.js";
4
- import { type CrashViewProps } from "../views/default-crash-view.js";
5
- import { HTTP } from "./http.js";
6
- import { Language } from "./language.js";
7
- import { Render } from "./render.js";
8
- import { Router } from "./router.js";
9
- export type Environment = "development" | "production";
10
- /**
11
- * Log type toggles. Each message category can be turned on or off or enabled only in a specific environment.
12
- */
13
- export type Loggles = {
14
- info: boolean | Environment;
15
- log: boolean | Environment;
16
- warn: boolean | Environment;
17
- error: boolean | Environment;
18
- };
19
- export interface Logger {
20
- info(...args: any[]): void;
21
- log(...args: any[]): void;
22
- warn(...args: any[]): void;
23
- error(...args: any[]): void;
24
- crash(error: Error): void;
25
- }
26
- export interface LoggerErrorContext {
27
- error: Error;
28
- loggerName: string;
29
- uid?: string;
30
- }
31
- export type LoggerOptions = {
32
- /**
33
- * Console object to use for logging (mostly for testing). Uses window.console by default.
34
- */
35
- console?: any;
36
- /**
37
- * Unique ID to print with logs. Makes it easier to track down messages from specific view instances.
38
- */
39
- uid?: string;
40
- };
41
- export declare class Dolla {
42
- #private;
43
- readonly http: HTTP;
44
- readonly language: Language;
45
- readonly render: Render;
46
- readonly router: Router;
47
- constructor();
48
- createState: typeof createState;
49
- createSettableState: typeof createSettableState;
50
- toSettableState: typeof toSettableState;
51
- toState: typeof toState;
52
- valueOf: typeof valueOf;
53
- derive: typeof derive;
54
- watch: typeof watch;
55
- createRef: typeof createRef;
56
- isRef: typeof isRef;
57
- /**
58
- * True when the app is connected to a DOM node and displayed to the user.
59
- */
60
- get isMounted(): boolean;
61
- /**
62
- * Get the current environment that this app is running in.
63
- * Environment affects which log messages will print and how much debugging info is included in the DOM.
64
- */
65
- getEnv(): Environment;
66
- /**
67
- * Sets the environment that this app is running in.
68
- * Environment affects which log messages will print and how much debugging info is included in the DOM.
69
- */
70
- setEnv(value: Environment): void;
71
- /**
72
- * Sets the view that will be shown when the `crash` method is called on any logger.
73
- * When a crash is reported the app will be unmounted and replaced with this crash page.
74
- */
75
- setCrashView(view: ViewFunction<CrashViewProps>): void;
76
- mount(selector: string, view?: ViewFunction<any>): Promise<void>;
77
- mount(element: HTMLElement, view?: ViewFunction<any>): Promise<void>;
78
- unmount(): Promise<void>;
79
- /**
80
- * Registers a `callback` to run after `Dolla.mount` is called, before the app is mounted. If `callback` returns a Promise,
81
- * it will be awaited before mounting finishes. Use this to perform initial setup before the app is displayed to the user.
82
- */
83
- beforeMount(callback: () => void | Promise<void>): void;
84
- /**
85
- * Registers a `callback` to run after the app is mounted.
86
- */
87
- onMount(callback: () => void): void;
88
- /**
89
- * Registers a `callback` to run after `Dolla.unmount` is called, before the app is unmounted. If `callback` returns a Promise,
90
- * it will be awaited before unmounting finishes. Use this to perform cleanup.
91
- */
92
- beforeUnmount(callback: () => void | Promise<void>): void;
93
- /**
94
- * Registers a `callback` to run after the app is unmounted.
95
- */
96
- onUnmount(callback: () => void): void;
97
- /**
98
- * Update log type toggles. Values that are not passed will remain unchanged.
99
- */
100
- setLoggles(options: Partial<Loggles>): void;
101
- setLogFilter(filter: string | RegExp): void;
102
- createLogger(name: string | State<string>, options?: LoggerOptions): Logger;
103
- /**
104
- *
105
- */
106
- constructView<P>(view: ViewFunction<P>, props: P, children?: Markup[]): ViewNode;
107
- /**
108
- *
109
- */
110
- constructMarkup(markup: Markup | Markup[]): MarkupNode;
111
- }
@@ -1,41 +0,0 @@
1
- import { type State } from "../state.js";
2
- import type { Stringable } from "../types.js";
3
- import type { Dolla } from "./dolla.js";
4
- /**
5
- * An object where values are either a translated string or another nested Translation object.
6
- */
7
- type LocalizedStrings = Record<string, string | Record<string, string | Record<string, string | Record<string, string>>>>;
8
- export interface LanguageConfig {
9
- name: string;
10
- /**
11
- * Path to a JSON file with translated strings for this language.
12
- */
13
- path?: string;
14
- /**
15
- * A callback function that returns a Promise that resolves to the translation object for this language.
16
- */
17
- fetch?: () => Promise<LocalizedStrings>;
18
- }
19
- export type LanguageSetupOptions = {
20
- /**
21
- * Default language to load on startup
22
- */
23
- initialLanguage?: string | null;
24
- languages: LanguageConfig[];
25
- };
26
- export declare class Language {
27
- #private;
28
- $current: State<string | undefined>;
29
- constructor(dolla: Dolla);
30
- get supportedLanguages(): string[];
31
- setup(options: LanguageSetupOptions): void;
32
- setLanguage(name: string): Promise<void>;
33
- /**
34
- * Returns a State containing the value at `key`.
35
-
36
- * @param key - Key to the translated value.
37
- * @param values - A map of {{placeholder}} names and the values to replace them with.
38
- */
39
- t(key: string, values?: Record<string, Stringable | State<Stringable>>): State<string>;
40
- }
41
- export {};
@@ -1,17 +0,0 @@
1
- import type { Dolla } from "./dolla.js";
2
- export declare class Render {
3
- #private;
4
- constructor(dolla: Dolla);
5
- /**
6
- * Queues a callback to run in the next render batch.
7
- * Running your DOM mutations in update callbacks reduces layout thrashing.
8
- * Returns a Promise that resolves once the callback has run.
9
- */
10
- update(callback: () => void, key?: string): Promise<void>;
11
- /**
12
- * Queues a callback that reads DOM information to run after the next render batch,
13
- * ensuring all writes have been performed before reading.
14
- * Returns a Promise that resolves once the callback has run.
15
- */
16
- read(callback: () => void): Promise<void>;
17
- }
@@ -1,152 +0,0 @@
1
- import { type Stringable } from "../types.js";
2
- import { ViewNode, type ViewFunction } from "../view.js";
3
- import type { Dolla } from "./dolla.js";
4
- export interface RouteMatchContext {
5
- /**
6
- * Redirects the user to a different route instead of matching the current one.
7
- */
8
- redirect(path: string): void;
9
- }
10
- export interface Route {
11
- /**
12
- * The path or path fragment to match.
13
- */
14
- path: string;
15
- /**
16
- * Path to redirect to when this route is matched, or a callback function that returns such path.
17
- */
18
- redirect?: string | ((ctx: RouteRedirectContext) => string) | ((ctx: RouteRedirectContext) => Promise<string>);
19
- /**
20
- * View to display when this route is matched.
21
- */
22
- view?: ViewFunction<any>;
23
- /**
24
- * Subroutes.
25
- */
26
- routes?: Route[];
27
- /**
28
- * Called after the match is identified but before it is acted on. Use this to set state, load data, etc.
29
- */
30
- beforeMatch?: (ctx: RouteMatchContext) => void | Promise<void>;
31
- }
32
- export interface RouteConfig {
33
- pattern: string;
34
- meta: {
35
- redirect?: string | ((ctx: RouteRedirectContext) => string) | ((ctx: RouteRedirectContext) => Promise<string>);
36
- pattern?: string;
37
- layers?: RouteLayer[];
38
- beforeMatch?: (ctx: RouteMatchContext) => void | Promise<void>;
39
- };
40
- }
41
- export interface RouteLayer {
42
- id: number;
43
- view: ViewFunction<{}>;
44
- }
45
- /**
46
- * Object passed to redirect callbacks. Contains information useful for determining how to redirect.
47
- */
48
- export interface RouteRedirectContext {
49
- /**
50
- * The path as it appears in the URL bar.
51
- */
52
- path: string;
53
- /**
54
- * The pattern that this path was matched with.
55
- */
56
- pattern: string;
57
- /**
58
- * Named route params parsed from `path`.
59
- */
60
- params: Record<string, string | number | undefined>;
61
- /**
62
- * Query params parsed from `path`.
63
- */
64
- query: Record<string, string | number | boolean | undefined>;
65
- }
66
- interface ParsedParams {
67
- [key: string]: string | number | boolean | (string | number | boolean | null)[] | null;
68
- }
69
- interface ParsedQuery extends ParsedParams {
70
- }
71
- export interface NavigateOptions {
72
- /**
73
- * Replace the current item in the history stack instead of adding a new one.
74
- * The back button will send the user to the page they visited before this. Defaults to false.
75
- */
76
- replace?: boolean;
77
- /**
78
- * Preserve existing query params (if any) when navigating. Defaults to false.
79
- */
80
- preserveQuery?: boolean;
81
- }
82
- export declare enum RoutingStyle {
83
- /**
84
- * Constructs routes like "https://www.example.com/#/sub/route" which work without any server-side setup.
85
- * A good choice if your app has no backend.
86
- */
87
- hash = "hash",
88
- /**
89
- * Constructs routes like "https://www.example.com/sub/route" which look nicer (subjective?) than hash routes and are what most users will expect URLs to look like, but require additional backend setup.
90
- * Path routing requires you to configure your backend to redirect to the app's index.html when subpaths are requested.
91
- */
92
- path = "path"
93
- }
94
- export interface RouterSetupOptions {
95
- routes: Route[];
96
- /**
97
- * The routing style to use; "hash" will construct routes like "https://www.example.com/#/sub/route" which work without any server-side setup, while "path" will construct routes that use paths directly.
98
- */
99
- style?: RoutingStyle;
100
- }
101
- export interface RouterElements {
102
- readonly rootElement?: HTMLElement;
103
- readonly rootView?: ViewNode;
104
- }
105
- export declare class Router {
106
- #private;
107
- /**
108
- * The currently matched route pattern, if any.
109
- */
110
- $pattern: import("../state.js").State<string | null>;
111
- /**
112
- * The current URL path.
113
- */
114
- $path: import("../state.js").State<string>;
115
- /**
116
- * The current named path params.
117
- */
118
- $params: import("../state.js").State<ParsedParams>;
119
- /**
120
- * The current query params. Changes to this object will be reflected in the URL.
121
- */
122
- $query: import("../state.js").State<ParsedQuery>;
123
- constructor(dolla: Dolla, elements: RouterElements);
124
- setup(options: RouterSetupOptions): void;
125
- /**
126
- * Navigates to another route.
127
- *
128
- * @example
129
- * navigate("/login"); // navigate to `/login`
130
- * navigate(["/users", 215], { replace: true }); // replace current history entry with `/users/215`
131
- */
132
- go(path: Stringable | Stringable[], options?: NavigateOptions): void;
133
- /**
134
- * Navigate backward. Pass a number of steps to hit the back button that many times.
135
- */
136
- back(steps?: number): void;
137
- /**
138
- * Navigate forward. Pass a number of steps to hit the forward button that many times.
139
- */
140
- forward(steps?: number): void;
141
- }
142
- /**
143
- * Intercepts links within the root node.
144
- *
145
- * This is adapted from https://github.com/choojs/nanohref/blob/master/index.js
146
- *
147
- * @param root - Element under which to intercept link clicks
148
- * @param callback - Function to call when a click event is intercepted
149
- * @param _window - (optional) Override for global window object
150
- */
151
- export declare function catchLinks(root: HTMLElement, callback: (anchor: HTMLAnchorElement) => void, _window?: Window & typeof globalThis): () => void;
152
- export {};
@@ -1,26 +0,0 @@
1
- import { type MarkupNode, type ElementContext, type Markup } from "../markup.js";
2
- import { type State, type StopFunction } from "../state.js";
3
- import { type Renderable } from "../types.js";
4
- export interface ConditionalConfig {
5
- $predicate: State<any>;
6
- thenContent?: Renderable;
7
- elseContent?: Renderable;
8
- elementContext: ElementContext;
9
- }
10
- export declare class Conditional implements MarkupNode {
11
- node: Node;
12
- endNode: Node;
13
- $predicate: State<any>;
14
- stopCallback?: StopFunction;
15
- thenContent?: Markup[];
16
- elseContent?: Markup[];
17
- connectedContent: MarkupNode[];
18
- elementContext: ElementContext;
19
- initialUpdateHappened: boolean;
20
- previousValue?: any;
21
- constructor(config: ConditionalConfig);
22
- get isMounted(): boolean;
23
- mount(parent: Node, after?: Node | undefined): void;
24
- unmount(): void;
25
- update(value: any): void;
26
- }
@@ -1,31 +0,0 @@
1
- import { type ElementContext, type Markup, type MarkupNode, type Ref } from "../markup.js";
2
- import { type StopFunction } from "../state.js";
3
- type HTMLOptions = {
4
- elementContext: ElementContext;
5
- tag: string;
6
- props: Record<string, any>;
7
- children?: Markup[];
8
- };
9
- export declare class HTML implements MarkupNode {
10
- node: HTMLElement | SVGElement;
11
- props: Record<string, any>;
12
- children: MarkupNode[];
13
- stopCallbacks: StopFunction[];
14
- elementContext: ElementContext;
15
- uniqueId: string;
16
- ref?: Ref<any>;
17
- canClickAway: boolean;
18
- get isMounted(): boolean;
19
- constructor({ tag, props, children, elementContext }: HTMLOptions);
20
- mount(parent: Node, after?: Node): void;
21
- unmount(): void;
22
- getUpdateKey(type: string, value: string | number): string;
23
- applyProps(element: HTMLElement | SVGElement, props: Record<string, unknown>): void;
24
- applyStyles(element: HTMLElement | SVGElement, styles: unknown, stopCallbacks: StopFunction[]): () => void;
25
- applyClasses(element: HTMLElement | SVGElement, classes: unknown, stopCallbacks: StopFunction[]): () => void;
26
- }
27
- /**
28
- * Converts a camelCase string to kebab-case.
29
- */
30
- export declare function camelToKebab(value: string): string;
31
- export {};
@@ -1,29 +0,0 @@
1
- import { type ElementContext, type MarkupNode } from "../markup.js";
2
- import { type State } from "../state.js";
3
- import type { Renderable } from "../types.js";
4
- interface ObserverOptions {
5
- elementContext: ElementContext;
6
- states: State<any>[];
7
- renderFn: (...values: any) => Renderable;
8
- }
9
- /**
10
- * Displays dynamic children without a parent element.
11
- */
12
- export declare class Observer implements MarkupNode {
13
- node: Node;
14
- endNode: Node;
15
- connectedViews: MarkupNode[];
16
- renderFn: (...values: any) => Renderable;
17
- elementContext: ElementContext;
18
- observerControls: {
19
- start: () => void;
20
- stop: () => void;
21
- };
22
- get isMounted(): boolean;
23
- constructor({ states, renderFn, elementContext }: ObserverOptions);
24
- mount(parent: Node, after?: Node): void;
25
- unmount(): void;
26
- cleanup(): void;
27
- update(...children: Renderable[]): void;
28
- }
29
- export {};
@@ -1,22 +0,0 @@
1
- import { type MarkupNode, type ElementContext } from "../markup.js";
2
- import { type State, type StopFunction } from "../state.js";
3
- export interface OutletConfig {
4
- $children: State<MarkupNode[]>;
5
- elementContext: ElementContext;
6
- }
7
- /**
8
- * Manages an array of DOMHandles.
9
- */
10
- export declare class Outlet implements MarkupNode {
11
- node: Node;
12
- endNode: Node;
13
- $children: State<MarkupNode[]>;
14
- stopCallback?: StopFunction;
15
- connectedChildren: MarkupNode[];
16
- elementContext: ElementContext;
17
- constructor(config: OutletConfig);
18
- get isMounted(): boolean;
19
- mount(parent: Node, after?: Node | undefined): void;
20
- unmount(): void;
21
- update(newChildren: MarkupNode[]): void;
22
- }
@@ -1,19 +0,0 @@
1
- import { type MarkupNode, type ElementContext } from "../markup.js";
2
- import { type Renderable } from "../types.js";
3
- interface PortalConfig {
4
- content: Renderable;
5
- parent: Node;
6
- elementContext: ElementContext;
7
- }
8
- /**
9
- * Renders content into a specified parent node.
10
- */
11
- export declare class Portal implements MarkupNode {
12
- config: PortalConfig;
13
- handle?: MarkupNode;
14
- get isMounted(): boolean;
15
- constructor(config: PortalConfig);
16
- mount(_parent: Node, _after?: Node): void;
17
- unmount(): void;
18
- }
19
- export {};
@@ -1,34 +0,0 @@
1
- import { type MarkupNode, type ElementContext } from "../markup.js";
2
- import { type State, type Setter, type StopFunction } from "../state.js";
3
- import { type ViewContext, type ViewResult } from "../view.js";
4
- interface RepeatOptions<T> {
5
- elementContext: ElementContext;
6
- $items: State<T[]>;
7
- keyFn: (value: T, index: number) => string | number | symbol;
8
- renderFn: ($value: State<T>, $index: State<number>, ctx: ViewContext) => ViewResult;
9
- }
10
- type ConnectedItem<T> = {
11
- key: any;
12
- $value: State<T>;
13
- setValue: Setter<T>;
14
- $index: State<number>;
15
- setIndex: Setter<number>;
16
- handle: MarkupNode;
17
- };
18
- export declare class Repeat<T> implements MarkupNode {
19
- node: Node;
20
- endNode: Node;
21
- $items: State<T[]>;
22
- stopCallback?: StopFunction;
23
- connectedItems: ConnectedItem<T>[];
24
- elementContext: ElementContext;
25
- renderFn: ($value: State<T>, $index: State<number>, ctx: ViewContext) => ViewResult;
26
- keyFn: (value: T, index: number) => string | number | symbol;
27
- get isMounted(): boolean;
28
- constructor({ elementContext, $items, renderFn, keyFn }: RepeatOptions<T>);
29
- mount(parent: Node, after?: Node): void;
30
- unmount(): void;
31
- _cleanup(): void;
32
- _update(value: T[]): void;
33
- }
34
- export {};
@@ -1,19 +0,0 @@
1
- import { type MarkupNode } from "../markup.js";
2
- import { type MaybeState, type StopFunction } from "../state.js";
3
- interface Stringable {
4
- toString(): string;
5
- }
6
- interface TextOptions {
7
- value: MaybeState<Stringable>;
8
- }
9
- export declare class Text implements MarkupNode {
10
- node: globalThis.Text;
11
- value: MaybeState<Stringable>;
12
- stopCallback?: StopFunction;
13
- get isMounted(): boolean;
14
- constructor({ value }: TextOptions);
15
- mount(parent: Node, after?: Node | null): Promise<void>;
16
- unmount(): Promise<void>;
17
- update(value?: Stringable): void;
18
- }
19
- export {};