mnfst-types 0.1.6 → 0.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnfst-types",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "Generate TypeScript types for a Manifest project from manifest.json and sample data",
5
5
  "type": "module",
6
6
  "bin": {
@@ -139,45 +139,53 @@ export interface ManifestLocale {
139
139
  set(locale: string): void;
140
140
  }
141
141
 
142
- /** `$toast` from the toasts plugin. */
143
- export interface ManifestToast {
144
- (message: string, opts?: { type?: 'info' | 'success' | 'warning' | 'error'; duration?: number }): void;
145
- info(message: string, opts?: Record<string, unknown>): void;
146
- success(message: string, opts?: Record<string, unknown>): void;
147
- warning(message: string, opts?: Record<string, unknown>): void;
148
- error(message: string, opts?: Record<string, unknown>): void;
149
- dismiss(id?: string): void;
150
- }
151
-
152
- /** `$colors` from the themes plugin. */
153
- export interface ManifestTheme {
154
- readonly current: 'light' | 'dark' | 'system';
155
- set(theme: 'light' | 'dark' | 'system'): void;
156
- toggle(): void;
142
+ /** One toast flavor: callable, with `.dismiss` (adds a close button) and `.fixed` (sticky) variants. */
143
+ export interface ManifestToastVariant {
144
+ (message: string, opts?: Record<string, unknown>): void;
145
+ dismiss(message: string, opts?: Record<string, unknown>): void;
146
+ fixed(message: string, opts?: Record<string, unknown>): void;
147
+ }
148
+
149
+ /** `$toast` from the toasts plugin. Typed variants: `$toast.brand(...)`, `$toast.positive.dismiss(...)`. */
150
+ export interface ManifestToast extends ManifestToastVariant {
151
+ brand: ManifestToastVariant;
152
+ accent: ManifestToastVariant;
153
+ positive: ManifestToastVariant;
154
+ negative: ManifestToastVariant;
157
155
  }
158
156
 
159
- /** `$colors` from the colors plugin. */
160
- export interface ManifestColors {
161
- [name: string]: string | ManifestColors;
157
+ /** `$color` from the color plugin — the current light/dark/system color mode. */
158
+ export interface ManifestColor {
159
+ current: 'light' | 'dark' | 'system' | string;
162
160
  }
163
161
 
164
- /** `$colorpicker` from the colorpicker plugin. */
162
+ /** `$colorpicker` from the colorpicker plugin. Loose by design. */
165
163
  export interface ManifestColorpicker {
166
- open(opts?: Record<string, unknown>): void;
167
- close(): void;
164
+ (id?: string): Record<string, unknown>;
168
165
  [extra: string]: unknown;
169
166
  }
170
167
 
171
- /** `$url` from the url-parameters plugin: read/write URL query params reactively. */
168
+ /** One URL query parameter handle from `$url.<name>` (reactive). */
169
+ export interface ManifestUrlParam {
170
+ /** Current value (get/set; empty string when absent). */
171
+ value: string;
172
+ /** First value when the param repeats. */
173
+ readonly first: string;
174
+ /** All values for a repeating param. */
175
+ readonly all: string[];
176
+ set(value: string): void;
177
+ add(value: string): void;
178
+ remove(value?: string): void;
179
+ clear(): void;
180
+ }
181
+
182
+ /** `$url` from the url-parameters plugin: `$url.tab.value`, `$url.tag.add('x')`, ... */
172
183
  export interface ManifestUrl {
173
- get(name: string): string | null;
174
- set(name: string, value: string | null): void;
175
- has(name: string): boolean;
176
- [name: string]: unknown;
184
+ [param: string]: ManifestUrlParam;
177
185
  }
178
186
 
179
- /** `$route` magic — true if the current route matches the given pattern. */
180
- export type ManifestRoute = (pattern: string) => boolean;
187
+ /** `$route` magic — the current route path (e.g. '/docs/elements'). */
188
+ export type ManifestRoute = string;
181
189
 
182
190
  /**
183
191
  * `$modify('attr')` — exposed in component HTML. Returns the value of an
@@ -188,6 +196,376 @@ export type ManifestModify = (attr: string) => string | undefined;
188
196
  /** `$try(fn)` — run a callback and swallow any thrown error, returning undefined on failure. */
189
197
  export type ManifestTry = <T>(fn: () => T) => T | undefined;
190
198
 
199
+ /** `$pay` from the payments plugin: callable to start checkout, plus portal/state helpers. */
200
+ export interface ManifestPay {
201
+ (ref: string, payload?: Record<string, unknown>): Promise<unknown>;
202
+ portal(ref?: string, payload?: Record<string, unknown>): Promise<unknown>;
203
+ refresh(): Promise<unknown>;
204
+ register(name: string, adapter: unknown): void;
205
+ readonly state: Record<string, unknown> | undefined;
206
+ readonly loading: boolean | undefined;
207
+ [extra: string]: unknown;
208
+ }
209
+
210
+ /** A conversation handle returned by `$chat.open(...)`. Loose by design. */
211
+ export interface ManifestChatHandle {
212
+ readonly messages: unknown[];
213
+ readonly participants: unknown[];
214
+ readonly typing: unknown[];
215
+ readonly me: unknown;
216
+ [extra: string]: unknown;
217
+ }
218
+
219
+ /** `$chat` from the chat plugin — adapter-based conversation projection. */
220
+ export interface ManifestChat {
221
+ open(conversationId: string, opts?: Record<string, unknown>): ManifestChatHandle;
222
+ merge(handles: ManifestChatHandle[], opts?: Record<string, unknown>): ManifestChatHandle;
223
+ adapter(name: string, factory?: unknown): unknown;
224
+ flatten(tree: unknown): unknown[];
225
+ /** Shared revision counter — trackable even before any handle resolves. */
226
+ readonly version: number;
227
+ [extra: string]: unknown;
228
+ }
229
+
230
+ /** One `$status.<name>` entry. */
231
+ export interface ManifestStatusEntry {
232
+ readonly state: string;
233
+ [extra: string]: unknown;
234
+ }
235
+
236
+ /** `$status` from the status plugin: `$status.api.state`, iterable, stringifies to the overall state. */
237
+ export interface ManifestStatus extends Iterable<ManifestStatusEntry> {
238
+ readonly [name: string]: any;
239
+ }
240
+
241
+ /** `$presence` from the Appwrite presences plugin. */
242
+ export interface ManifestPresence {
243
+ start(opts?: Record<string, unknown>): Promise<unknown>;
244
+ stop(): void;
245
+ set(values: Record<string, unknown>): Promise<unknown>;
246
+ clear(): Promise<unknown>;
247
+ of(userId: string): unknown;
248
+ all(): unknown[];
249
+ readonly records: Record<string, unknown>;
250
+ readonly list: unknown[];
251
+ readonly ready: boolean;
252
+ readonly error: unknown;
253
+ readonly me: unknown;
254
+ }
255
+
256
+ /** `$date(id?)` from the datepicker plugin — the picker API for the nearest (or given) instance. */
257
+ export type ManifestDate = (id?: string) => Record<string, unknown>;
258
+
259
+ /** `$chart(id?)` from the charts plugin — the chart API for the nearest (or given) instance. */
260
+ export type ManifestChart = (id?: string) => Record<string, unknown>;
261
+
262
+ /** `$export(opts)` from the export plugin — export the page or a data source (pdf/csv/json/...). */
263
+ export type ManifestExport = (opts?: {
264
+ format?: string;
265
+ filename?: string;
266
+ source?: string;
267
+ data?: unknown;
268
+ [extra: string]: unknown;
269
+ }) => Promise<unknown>;
270
+
271
+ /** `$import(opts)` from the import plugin — pick a local file and parse it (json/csv). Resolves the parsed data, or null when the dialog is dismissed. */
272
+ export type ManifestImport = (opts?: {
273
+ format?: 'json' | 'csv';
274
+ /** Data source to replace with the parsed content. */
275
+ source?: string;
276
+ /** Override the file input's accept list. */
277
+ accept?: string;
278
+ [extra: string]: unknown;
279
+ }) => Promise<unknown>;
280
+
281
+ /** `$device` from the utilities plugin (enriched by the device plugin when present). */
282
+ export interface ManifestDevice {
283
+ readonly os: string;
284
+ readonly touch: boolean;
285
+ readonly online: boolean;
286
+ readonly standalone: boolean;
287
+ readonly native: boolean;
288
+ readonly platform: string;
289
+ }
290
+
291
+ /** `$share` from the device plugin — native sheet, web share, or clipboard fallback. */
292
+ export type ManifestShare = (opts?: { title?: string; text?: string; url?: string }) =>
293
+ Promise<{ shared: boolean; method: string; cancelled?: boolean }>;
294
+
295
+ /** `$push` from the device plugin — push/notification permissions and token. */
296
+ export interface ManifestPush {
297
+ /** Ask for permission, on your schedule (never prompted on load). */
298
+ request(): Promise<'granted' | 'denied' | 'prompt' | 'unsupported' | string>;
299
+ /** Register with the platform push service (no-op on the web). */
300
+ register(): Promise<unknown>;
301
+ onToken(handler: (token: string) => void): void;
302
+ onReceive(handler: (notification: unknown) => void): void;
303
+ onTap(handler: (notification: unknown) => void): void;
304
+ readonly permission: string;
305
+ readonly token: string | null;
306
+ [extra: string]: unknown;
307
+ }
308
+
309
+ /** `$secure` from the device plugin — secure key-value storage (native keychain or fallback). */
310
+ export interface ManifestSecure {
311
+ get(key: string): Promise<string | null>;
312
+ set(key: string, value: string): Promise<void>;
313
+ remove(key: string): Promise<void>;
314
+ keys(): Promise<string[]>;
315
+ clear(): Promise<void>;
316
+ use(adapter: unknown): void;
317
+ }
318
+
319
+ /** `$links` from the device plugin — deep/universal link handling. */
320
+ export interface ManifestLinks {
321
+ /** Take over an inbound link: link.url is the full URL, link.path the route it maps to. */
322
+ on(handler: (link: { url: string; path: string }) => void): void;
323
+ open(url: string): void;
324
+ readonly last: string | null;
325
+ }
326
+
327
+ /** `$app` from the device plugin — foreground/background state. */
328
+ export interface ManifestApp {
329
+ readonly active: boolean;
330
+ onChange(handler: (active: boolean) => void): void;
331
+ }
332
+
333
+ /** `$haptics` from the device plugin — haptic feedback with web vibration fallback. */
334
+ export interface ManifestHaptics {
335
+ impact(style?: 'LIGHT' | 'MEDIUM' | 'HEAVY' | string): Promise<unknown>;
336
+ notification(type?: 'SUCCESS' | 'WARNING' | 'ERROR' | string): Promise<unknown>;
337
+ selection(): Promise<unknown>;
338
+ vibrate(ms?: number): Promise<unknown> | unknown;
339
+ [extra: string]: unknown;
340
+ }
341
+
342
+ /** `$biometric` from the device plugin. */
343
+ export interface ManifestBiometric {
344
+ available(): Promise<boolean>;
345
+ verify(opts?: Record<string, unknown>): Promise<unknown>;
346
+ }
347
+
348
+ /** `$camera` from the device plugin. */
349
+ export interface ManifestCamera {
350
+ photo(opts?: Record<string, unknown>): Promise<unknown>;
351
+ pick(opts?: Record<string, unknown>): Promise<unknown>;
352
+ }
353
+
354
+ /** Edit action names for `$edit.can()` and per-action locks. */
355
+ export type ManifestEditAction = 'move' | 'remove' | 'duplicate' | 'text' | 'attrs' | 'size';
356
+ /** `can()` also answers 'class' (the class list; component nodes allow only this) and copy/cut/paste. */
357
+
358
+ /** Class controls on `$edit.classes`. `el` defaults to `$edit.target`. */
359
+ export interface ManifestEditClasses {
360
+ add(cls: string, el?: Element): boolean;
361
+ remove(cls: string, el?: Element): boolean;
362
+ toggle(cls: string, el?: Element, force?: boolean): boolean;
363
+ has(cls: string, el?: Element): boolean;
364
+ /** Replace the static class list. */
365
+ set(value: string, el?: Element): boolean;
366
+ /** The static classes (bound :class classes excluded). */
367
+ list(el?: Element): string[];
368
+ }
369
+
370
+ /** Element editor (`x-edit`) — opt-in plugin. Modifiers: `.text` `.move` `.size`
371
+ * `.data` (default text + move), `.lock[.action]`, `.gated`, `.persist`, `.bare`,
372
+ * `.theme`, `.cssvar`. Every edit is logged; actions default to `$edit.target`. */
373
+ export interface ManifestEdit {
374
+ /** True while `.gated` areas are editable. */
375
+ active: boolean;
376
+ canUndo: boolean;
377
+ canRedo: boolean;
378
+ /** Bumps on every change to the log or target; read it to make a binding re-evaluate. */
379
+ version: number;
380
+ /** Set a handler to route patches somewhere other than the dev server. */
381
+ onPublish: ((patches: unknown[], state: { log: unknown[]; cursor: number }) => unknown) | null;
382
+ toggle(): void;
383
+ on(): void;
384
+ off(): void;
385
+ undo(): Promise<void>;
386
+ redo(): Promise<void>;
387
+ /** Source files that changed since the page loaded, from the last refused publish (also an
388
+ * `edit:stale` event on document, detail `{ files }`), or a reload held back because it
389
+ * would lose unpublished edits. */
390
+ stale: string[];
391
+ /** Edits that could not be applied because the source changed under them (also an
392
+ * `edit:conflict` event on document, detail `{ conflicts }`, and a console warning).
393
+ * `element` names what was edited (tag and opening text, or the region for layout);
394
+ * `value` what the edit held; `reason` says what happened in words.
395
+ * - A text or attribute edit whose element changed: `prop` is the edited property.
396
+ * - Layout (`prop: 'structure'`): kept when only unmoved children changed text in place;
397
+ * dropped when a moved, added or removed child changed, with `value`
398
+ * `{ changed: [{ was, now }], moved: [...], copies: [{ of, html, text }] }` so typed
399
+ * content can be recovered. */
400
+ conflicts: Array<{ region: string; key: string; element: string; prop: string; value: unknown; before: unknown; reason: string }>;
401
+ /** Empty `conflicts`. Those of `.persist` regions are kept across reloads until this is called. */
402
+ clearConflicts(): void;
403
+ /** Send every area's patches; on success the history is cleared (the source now holds it).
404
+ * `rebase: true` takes the current source as the base (writes over external changes). */
405
+ publish(opts?: { rebase?: boolean }): Promise<unknown>;
406
+ /** The resolved source patches for every area, without sending them. */
407
+ patches(): unknown[];
408
+ /** The raw delta log — persist it yourself to move edits between devices. */
409
+ export(): { log: unknown[]; cursor: number };
410
+ /** The piece a right-click landed on (set before any menu opens), or assignable. */
411
+ target: Element | null;
412
+ /** Whether an action applies to `el` (default `$edit.target`): capability and locks. */
413
+ can(action: ManifestEditAction | 'class' | 'copy' | 'cut' | 'paste', el?: Element | null): boolean;
414
+ /** Lock `el` and its subtree for one action, or all when omitted. Logged. A component host
415
+ * (see `block`) locks by its host key, for all its roots and what is in them. */
416
+ lock(el?: Element | null, action?: ManifestEditAction): boolean;
417
+ unlock(el?: Element | null, action?: ManifestEditAction): boolean;
418
+ copy(el?: Element): boolean;
419
+ cut(el?: Element): boolean;
420
+ paste(el?: Element): boolean;
421
+ duplicate(el?: Element): boolean;
422
+ remove(el?: Element): boolean;
423
+ /** Move a piece into a container (element or area key), before `before` or at the end. */
424
+ move(el: Element | null, dest: Element | string, before?: Element | null): boolean;
425
+ /** Nest a piece into the container before it. */
426
+ nest(el?: Element): boolean;
427
+ /** Move a piece out of its container, after it. */
428
+ unnest(el?: Element): boolean;
429
+ /** The piece containing a node, or null. In a static area a component instance is one
430
+ * piece, its host (its first rendered root; the rest follow it): it moves, duplicates
431
+ * (a new instance) and is removed as one, and its markup is not edited from here. */
432
+ block(node: Element): Element | null;
433
+ /** Set an attribute: a string sets it, `true` sets it empty, `null`/`false` removes it. */
434
+ attr(name: string, value: string | boolean | null, el?: Element): boolean;
435
+ classes: ManifestEditClasses;
436
+ /** Component scope of `el`'s area (default `$edit.target`): `scope(el)` reads it.
437
+ * Instance overrides apply to an area that wraps exactly one component with no x-edit region
438
+ * of its own; a component among other content is a host piece of a static area instead, and
439
+ * a component's own region is edited in its own file. */
440
+ scope(el?: Element | null): 'instance' | 'main' | null;
441
+ /** Set the component scope of `el`'s area (default `$edit.target`); false if it has none. */
442
+ scope(value: 'instance' | 'main', el?: Element | null): boolean;
443
+ /** Revert a component element's instance overrides (the area element reverts all). */
444
+ revert(el?: Element): boolean;
445
+ }
446
+
447
+ /** Rich text editor (`x-rich-text`): the area this element sits in, or the last focused one. */
448
+ export interface ManifestRichText {
449
+ /** The stored value, in the area's format. Assigning replaces the document and resets undo history. */
450
+ value: string;
451
+ focus(): void;
452
+ /** The href at the caret; assign to set it, assign '' to unlink. */
453
+ link: string;
454
+ /** Document-wide styles (font, size, leading, align, color, background) as CSS custom
455
+ * properties on the area; not part of the stored value. Assign `{}` to clear. */
456
+ all: Record<string, string>;
457
+ /** Select the whole document. */
458
+ selectAll(): void;
459
+ /** The current selection and its geometry, or null. Also emitted as a `rich-text:selection`
460
+ * event and as --rich-text-selection-* custom properties. */
461
+ selection: {
462
+ collapsed: boolean; text: string;
463
+ x: number; y: number; width: number; height: number;
464
+ top: number; bottom: number; left: number; right: number;
465
+ } | null;
466
+ /** Apply a command. Commands are HTML tag names ('strong', 'h2', 'ul', 'a', 'table', …) plus
467
+ * 'indent', 'outdent', 'align', 'color', 'background', 'font', 'size', 'leading', 'checklist',
468
+ * 'unlink', 'clear', 'undo', 'redo', 'block' and the table operations. Every command is also
469
+ * a method: `$rich.strong()`, `$rich.table(3, 2)` (columns, rows). */
470
+ run(command: string, arg?: unknown): void;
471
+ /** Whether that command is active at the caret. */
472
+ active(command: string): boolean;
473
+ /** Whether that command is available here (format, .inline, caret). */
474
+ can(command: string): boolean;
475
+ /** Read the content as markdown regardless of the storage format. */
476
+ markdown(): string;
477
+ /** Read the content as sanitized HTML regardless of the storage format. */
478
+ html(): string;
479
+
480
+ // Inline tags: toggle on the selection, or arm for the next typed text
481
+ strong(): void; b(): void; em(): void; i(): void; s(): void; del(): void; code(): void;
482
+ bdi(): void; cite(): void; ins(): void; kbd(): void; mark(): void; q(): void; samp(): void;
483
+ small(): void; span(): void; sub(): void; sup(): void; u(): void; var(): void;
484
+ /** `title` attribute (html only). */
485
+ abbr(title?: string): void;
486
+ /** `title` attribute (html only). */
487
+ dfn(title?: string): void;
488
+ /** Direction, default 'rtl' (html only). */
489
+ bdo(dir?: 'ltr' | 'rtl' | 'auto'): void;
490
+ /** Machine-readable `value` (html only). */
491
+ data(value?: string): void;
492
+ /** `datetime` attribute (html only). */
493
+ time(datetime?: string): void;
494
+ /** Link the selection; '' unlinks. */
495
+ a(href?: string): void;
496
+ unlink(): void;
497
+ br(): void;
498
+ /** Break opportunity (html only). */
499
+ wbr(): void;
500
+ img(src: string, alt?: string): void;
501
+
502
+ // Block tags: convert the block (again returns to p)
503
+ p(): void; h1(): void; h2(): void; h3(): void; h4(): void; h5(): void; h6(): void;
504
+ blockquote(): void; pre(): void; address(): void;
505
+ ul(): void; ol(): void; li(): void; checklist(): void; hr(): void;
506
+ figure(): void; figcaption(): void; dl(): void; dt(): void; dd(): void;
507
+ /** Any block tag by name, e.g. block('h2'). */
508
+ block(tag: string): void;
509
+
510
+ /** Insert a columns × rows table (default 3 × 3). */
511
+ table(columns?: number, rows?: number): void;
512
+ 'row-before'(): void; 'row-after'(): void; 'row-remove'(): void;
513
+ 'column-before'(): void; 'column-after'(): void; 'column-remove'(): void;
514
+ 'table-remove'(): void; 'table-header'(): void; merge(): void; split(): void;
515
+
516
+ indent(): void; outdent(): void;
517
+ align(value?: 'start' | 'center' | 'end' | 'justify' | string): void;
518
+ leading(value: string): void;
519
+ color(value: string): void;
520
+ background(value: string): void;
521
+ font(value: string): void;
522
+ size(value: string | number): void;
523
+ clear(): void;
524
+ undo(): void;
525
+ redo(): void;
526
+ }
527
+
528
+ /** Options for `ManifestRichText.attach()`. */
529
+ export interface ManifestRichTextAttachOptions {
530
+ /** 'block' (default) or 'inline' (single line: no block commands, Enter fires `rich-text:enter`). */
531
+ mode?: 'block' | 'inline';
532
+ /** Inline html only: `<br>` line breaks are kept, Shift+Enter inserts one, pasted blocks become lines. */
533
+ breaks?: boolean;
534
+ /** 'break': Enter inserts a line break too, instead of firing `rich-text:enter`. Needs `breaks` and the 'html' format. */
535
+ enter?: 'break';
536
+ /** false: `.all` controls and `$rich.all` are unavailable (no area-wide --rich-text-* styles). Default true. */
537
+ all?: boolean;
538
+ /** Storage format: 'markdown' (default), 'html' or 'plain'. */
539
+ format?: 'markdown' | 'html' | 'plain';
540
+ /** Initial value; omitted, the element's existing markup is the content. */
541
+ value?: string;
542
+ /** No markdown autoformat while typing. */
543
+ literal?: boolean;
544
+ /** Called with the stored value after every change. */
545
+ onChange?(value: string): void;
546
+ }
547
+
548
+ /** Returned by `ManifestRichText.attach()`: the `$rich` surface plus detach(). */
549
+ export interface ManifestRichTextHandle extends ManifestRichText {
550
+ el: Element;
551
+ /** Remove editing and restore the element's own contenteditable/role/aria-multiline. */
552
+ detach(): void;
553
+ /** Markup of the newest step in the field's undo history (a pending typing burst is recorded first). */
554
+ newest(): string;
555
+ }
556
+
557
+ /**
558
+ * Manifest's custom-element/attribute authoring surface (documentation aid —
559
+ * these are HTML attributes, not JS globals). Element styles pair with most.
560
+ */
561
+ export type ManifestDirective =
562
+ | 'x-route' | 'x-anchors'
563
+ | 'x-icon' | 'x-svg' | 'x-markdown' | 'x-code' | 'x-code-group'
564
+ | 'x-toast' | 'x-tooltip' | 'x-carousel' | 'x-virtual' | 'x-computed' | 'x-defer'
565
+ | 'x-chart' | 'x-date' | 'x-color' | 'x-colorpicker' | 'x-combobox'
566
+ | 'x-export' | 'x-import' | 'x-pay' | 'x-files' | 'x-data-files'
567
+ | 'x-edit' | 'x-rich-text';
568
+
191
569
  // ---------------------------------------------------------------------------
192
570
  // Global declarations (what Alpine exposes inside `x-data`, `x-show`, etc.)
193
571
  // ---------------------------------------------------------------------------
@@ -195,26 +573,67 @@ export type ManifestTry = <T>(fn: () => T) => T | undefined;
195
573
  declare global {
196
574
  /** Project data sources registered in manifest.json. */
197
575
  const $x: ManifestSources;
198
- /** Match the current route against a pattern (e.g. `$route('/about')`). */
576
+ /** The current route path (compare or .startsWith against it). */
199
577
  const $route: ManifestRoute;
200
578
  /** Read a parent component attribute (Manifest's prop mechanism). */
201
579
  const $modify: ManifestModify;
202
580
  /** Run a callback safely, returning undefined on error. */
203
581
  const $try: ManifestTry;
204
- /** Appwrite auth plugin (only present when the plugin is loaded). */
582
+ /**
583
+ * Cached derivation for `x-data` / `Alpine.data` scopes: `rows: $computed(function () { return this.items.filter(…) })`.
584
+ * Recomputed once per flush when a tracked dependency changes; reads as a plain property with a stable identity in between.
585
+ */
586
+ const $computed: <T>(fn: (this: any) => T) => T;
587
+ /** Appwrite auth plugin (present when the plugin is loaded). */
205
588
  const $auth: ManifestAuth;
206
589
  /** Localization plugin. */
207
590
  const $locale: ManifestLocale;
208
591
  /** Toasts plugin. */
209
592
  const $toast: ManifestToast;
210
- /** Themes plugin. */
211
- const $colors: ManifestTheme;
212
- /** Colors plugin. */
213
- const $colors: ManifestColors;
593
+ /** Color-mode plugin (`$color.current = 'dark'`). */
594
+ const $color: ManifestColor;
214
595
  /** Colorpicker plugin. */
215
596
  const $colorpicker: ManifestColorpicker;
216
- /** URL parameters plugin. */
597
+ /** URL parameters plugin (`$url.tab.value`). */
217
598
  const $url: ManifestUrl;
599
+ /** Payments plugin. */
600
+ const $pay: ManifestPay;
601
+ /** Chat plugin. */
602
+ const $chat: ManifestChat;
603
+ /** Status plugin. */
604
+ const $status: ManifestStatus;
605
+ /** Appwrite presences plugin. */
606
+ const $presence: ManifestPresence;
607
+ /** Datepicker plugin. */
608
+ const $date: ManifestDate;
609
+ /** Charts plugin. */
610
+ const $chart: ManifestChart;
611
+ /** Export plugin. */
612
+ const $export: ManifestExport;
613
+ /** Import plugin. */
614
+ const $import: ManifestImport;
615
+ /** Element editor (edit plugin; opt-in). */
616
+ const $edit: ManifestEdit;
617
+ /** Rich text editor (rich-text plugin; loaded on use). */
618
+ const $rich: ManifestRichText;
619
+ /** Device/platform info (utilities; enriched by the device plugin). */
620
+ const $device: ManifestDevice;
621
+ /** Native share (device plugin). */
622
+ const $share: ManifestShare;
623
+ /** Push permissions (device plugin). */
624
+ const $push: ManifestPush;
625
+ /** Secure storage (device plugin). */
626
+ const $secure: ManifestSecure;
627
+ /** Deep links (device plugin). */
628
+ const $links: ManifestLinks;
629
+ /** App foreground state (device plugin). */
630
+ const $app: ManifestApp;
631
+ /** Haptics (device plugin). */
632
+ const $haptics: ManifestHaptics;
633
+ /** Biometric auth (device plugin). */
634
+ const $biometric: ManifestBiometric;
635
+ /** Camera (device plugin). */
636
+ const $camera: ManifestCamera;
218
637
 
219
638
  /** Window-level Manifest namespace exposed by the loader. */
220
639
  interface Window {
@@ -222,9 +641,34 @@ declare global {
222
641
  loadPlugin(name: string, version?: string): Promise<unknown>;
223
642
  loadTailwind(version?: string): Promise<unknown>;
224
643
  getPluginUrl(name: string, version?: string): string;
644
+ /** Defer a closed container built at runtime (call before Alpine.initTree). */
645
+ defer?(el: Element): unknown;
646
+ /** App-shell service worker diagnostics; kill() unregisters and clears its caches. */
647
+ sw?: { registered: boolean; version: string | null; kill(): Promise<void> };
648
+ /** The two-line same-origin /sw.js stub pinned to a framework version. */
649
+ swStub?(version?: string): string;
225
650
  };
226
651
  Alpine?: unknown;
227
652
  __manifestLoaded?: unknown;
653
+ /** Rich text engine (rich-text plugin). */
654
+ ManifestRichText?: {
655
+ attach(el: Element, options?: ManifestRichTextAttachOptions): ManifestRichTextHandle | null;
656
+ toMarkdown(root: Element): string;
657
+ fromMarkdown(markdown: string): string;
658
+ sanitize(html: string, allowBlocks?: boolean, keepStyle?: boolean): string;
659
+ commands(): string[];
660
+ };
661
+ }
662
+
663
+ /**
664
+ * Fired when the utilities runtime sees a class the baked sheet (and
665
+ * `manifest.json`'s `utilities.safelist`/`patterns`) doesn't cover, after
666
+ * publish stamped that sheet as covering every class — see
667
+ * manifest.utilities.static.js. `engineLoaded` is true once the lazily
668
+ * loaded Tailwind engine has taken over, false if that load failed.
669
+ */
670
+ interface WindowEventMap {
671
+ 'manifest:utilities-uncovered': CustomEvent<{ classes: string[]; engineLoaded: boolean }>;
228
672
  }
229
673
  }
230
674