mnfst 0.5.275 → 0.5.277

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.
@@ -2,7 +2,7 @@
2
2
 
3
3
  (function () {
4
4
 
5
- const MANIFEST_BUILD_VERSION = '0.5.275';
5
+ const MANIFEST_BUILD_VERSION = '0.5.277';
6
6
 
7
7
  /* Manifest Data Sources - Appwrite Integration */
8
8
 
@@ -195,6 +195,17 @@ async function loadTableRows(databaseId, tableId, queries = [], { requireAuth =
195
195
  }
196
196
  }
197
197
 
198
+ // One page of a table with Appwrite's count: { rows, total }
199
+ async function loadTablePage(databaseId, tableId, queries = [], { requireAuth = true } = {}) {
200
+ const services = await getAppwriteDataServices();
201
+ if (!services?.tablesDB) {
202
+ throw new Error('[Manifest Data] Appwrite TablesDB service not available');
203
+ }
204
+ if (requireAuth) await verifyAuthenticated();
205
+ const response = await services.tablesDB.listRows({ databaseId, tableId, queries });
206
+ return { rows: response.rows || [], total: typeof response.total === 'number' ? response.total : null };
207
+ }
208
+
198
209
  // Get a single row from Appwrite table
199
210
  async function getTableRow(databaseId, tableId, rowId) {
200
211
  const services = await getAppwriteDataServices();
@@ -679,6 +690,7 @@ async function getFilePreview(bucketId, fileId, widthOrOptions = null, height =
679
690
  window.ManifestDataAppwrite = {
680
691
  getAppwriteDataServices,
681
692
  loadTableRows,
693
+ loadTablePage,
682
694
  getTableRow,
683
695
  createRow,
684
696
  updateRow,
@@ -1642,6 +1654,8 @@ window.ManifestDataQueries = {
1642
1654
 
1643
1655
  /* Manifest Data Sources - Pagination (Appwrite) */
1644
1656
 
1657
+ const PAGE_LIMIT = 4999;
1658
+
1645
1659
  // Resolve the source's table or bucket
1646
1660
  async function resolvePagedSource(dataSourceName) {
1647
1661
  const manifest = await window.ManifestDataConfig.ensureManifest();
@@ -1686,6 +1700,7 @@ async function fetchPage(dataSourceName, baseQueries, pageQueries, limit) {
1686
1700
 
1687
1701
  // First page, cursor-based. Returns { items, cursor, total, hasMore }
1688
1702
  async function getFirstPage(dataSourceName, limit, baseQueries = []) {
1703
+ limit = Math.min(limit, PAGE_LIMIT); // the extra row must fit Appwrite's 5000
1689
1704
  const { rows, total, extra } = await fetchPage(dataSourceName, baseQueries, [], limit);
1690
1705
  const items = rows.slice(0, limit);
1691
1706
  return { items, cursor: items.length ? items[items.length - 1].$id : null, total, hasMore: extra };
@@ -1693,6 +1708,7 @@ async function getFirstPage(dataSourceName, limit, baseQueries = []) {
1693
1708
 
1694
1709
  // Next page after a cursor. Returns { items, cursor, total, hasMore }
1695
1710
  async function getNextPage(dataSourceName, cursor, limit, baseQueries = []) {
1711
+ limit = Math.min(limit, PAGE_LIMIT); // the extra row must fit Appwrite's 5000
1696
1712
  if (!cursor) {
1697
1713
  throw new Error('[Manifest Data] Cursor is required for next page');
1698
1714
  }
@@ -1703,6 +1719,7 @@ async function getNextPage(dataSourceName, cursor, limit, baseQueries = []) {
1703
1719
 
1704
1720
  // Previous page before a cursor. hasMore: rows exist before this page. Returns { items, cursor, total, hasMore }
1705
1721
  async function getPrevPage(dataSourceName, cursor, limit, baseQueries = []) {
1722
+ limit = Math.min(limit, PAGE_LIMIT); // the extra row must fit Appwrite's 5000
1706
1723
  if (!cursor) {
1707
1724
  throw new Error('[Manifest Data] Cursor is required for previous page');
1708
1725
  }
@@ -1714,6 +1731,7 @@ async function getPrevPage(dataSourceName, cursor, limit, baseQueries = []) {
1714
1731
 
1715
1732
  // Specific page (1-based), offset-based. Returns { items, page, total, totalPages, hasMore }
1716
1733
  async function getPage(dataSourceName, pageNumber, limit, baseQueries = []) {
1734
+ limit = Math.min(limit, PAGE_LIMIT); // the extra row must fit Appwrite's 5000
1717
1735
  if (!pageNumber || pageNumber < 1) {
1718
1736
  throw new Error('[Manifest Data] Page number must be >= 1');
1719
1737
  }
package/lib/manifest.d.ts CHANGED
@@ -17,7 +17,7 @@
17
17
  /** Appwrite-style query expression returned by helper builders. */
18
18
  export type ManifestQueryExpr = string;
19
19
 
20
- /** Appwrite-style query helpers used with `$query([...])`. */
20
+ /** Appwrite-style query helpers. */
21
21
  export interface ManifestQuery {
22
22
  equal(field: string, value: unknown): ManifestQueryExpr;
23
23
  notEqual(field: string, value: unknown): ManifestQueryExpr;
@@ -41,81 +41,211 @@ export interface ManifestQuery {
41
41
  cursorBefore(id: string): ManifestQueryExpr;
42
42
  }
43
43
 
44
+ /** A column of row type `T` (or a dot path into a relationship). Any string when `T` is loose. */
45
+ export type ManifestColumn<T> = string extends keyof T ? string : (keyof T & string) | `${keyof T & string}.${string}`;
46
+
47
+ type ManifestCompare = 'equal' | 'notEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'greaterThanEqual'
48
+ | 'lessThan' | 'lessThanOrEqual' | 'lessThanEqual' | 'contains' | 'startsWith' | 'endsWith' | 'search';
49
+
50
+ /** One `$query` expression: `[method, column, ...values]`. Column names are checked against the row type. */
51
+ export type ManifestQueryTuple<T = any> =
52
+ | [ManifestCompare, ManifestColumn<T>, ...unknown[]]
53
+ | ['between', ManifestColumn<T>, unknown, unknown]
54
+ | ['isNull' | 'isNotNull' | 'orderAsc' | 'orderDesc', ManifestColumn<T>]
55
+ | ['orderRandom']
56
+ | ['limit' | 'offset', number]
57
+ | ['cursorAfter' | 'cursorBefore', string]
58
+ | ['or', ManifestQueryTuple<T>[]];
59
+
44
60
  /** State flags exposed on every data source (array or object). */
45
61
  export interface ManifestSourceState {
46
- /** True while the source is fetching for the first time or after a mutation. */
62
+ /** True during a fetch or mutation. */
47
63
  readonly $loading: boolean;
48
64
  /** Last error from a load or mutation, or null. */
49
- readonly $error: Error | string | null;
50
- /** True once initial load has completed (success or failure). */
65
+ readonly $error: string | null;
66
+ /** True once the source has settled (loaded, or resolved empty because its scope can't apply). */
51
67
  readonly $ready: boolean;
52
- }
68
+ /** True while cached rows show and fresh data is still loading. */
69
+ readonly $stale: boolean;
70
+ /** Resolves once fresh data has landed. */
71
+ readonly $fresh: Promise<void>;
72
+ }
73
+
74
+ /** Fields Appwrite adds to every row. */
75
+ export interface ManifestRowSystem {
76
+ $id: string;
77
+ $createdAt: string;
78
+ $updatedAt: string;
79
+ $sequence?: number;
80
+ $permissions?: string[];
81
+ $tableId?: string;
82
+ $databaseId?: string;
83
+ /** Files linked to the row when the source configures `storage`. */
84
+ $files?: ManifestFile[];
85
+ }
86
+
87
+ /** A file row from an Appwrite bucket source. */
88
+ export interface ManifestFile {
89
+ $id: string;
90
+ name: string;
91
+ mimeType: string;
92
+ sizeOriginal: number;
93
+ $createdAt: string;
94
+ $updatedAt: string;
95
+ readonly $url?: string;
96
+ readonly $isImage?: boolean;
97
+ readonly $isPdf?: boolean;
98
+ readonly $formattedSize?: string | null;
99
+ readonly $thumbnailUrl?: string | null;
100
+ }
101
+
102
+ /** Search weights: `{ title: 3, body: 1 }`. */
103
+ export type ManifestSearchWeights<T> = Partial<Record<ManifestColumn<T>, number>>;
53
104
 
54
105
  /** Operators available on array-shaped sources (CSV tabular, JSON arrays, Appwrite tables). */
55
106
  export interface ManifestArrayOps<T> {
56
- /** Substring match across the given fields. Returns matching items. */
57
- $search(term: string, ...fields: (keyof T & string)[]): T[];
58
- /**
59
- * Local sources: filter by an array of `Manifest.query.*` expressions and array methods.
60
- * Appwrite sources: server-side query, returns a Promise.
61
- */
62
- $query(expressions: ManifestQueryExpr[]): T[] | Promise<T[]>;
63
- /** Look up a single row whose `id` matches the current route param, if any. */
64
- $route(path?: string): T | undefined;
107
+ /** Substring match across the given fields, or a ranked search with field weights. */
108
+ $search(term: string, ...fields: ManifestColumn<T>[]): ManifestArraySource<T>;
109
+ $search(term: string, weights: ManifestSearchWeights<T>): ManifestArraySource<T>;
110
+ /** Local sources: filter synchronously (chainable with `$search`). */
111
+ $query(queries: ManifestQueryTuple<T>[]): ManifestArraySource<T>;
112
+ /** The row whose `field` matches a segment of the current URL. */
113
+ $route(field?: ManifestColumn<T>): T | undefined;
65
114
  }
66
115
 
67
- /** Mutations available on Appwrite-table sources. */
116
+ /** A cursor page from `$first`, `$next` and `$prev`. */
117
+ export interface ManifestCursorPage<T> {
118
+ items: T[];
119
+ cursor: string | null;
120
+ total: number;
121
+ hasMore: boolean;
122
+ }
123
+
124
+ /** An offset page from `$page`. */
125
+ export interface ManifestOffsetPage<T> {
126
+ items: T[];
127
+ page: number;
128
+ total: number;
129
+ totalPages: number;
130
+ hasMore: boolean;
131
+ }
132
+
133
+ /** `$update` list form: one entry per row. */
134
+ export type ManifestUpdateList<T> = Array<{ id?: string; $id?: string; data: Partial<T> }>;
135
+
136
+ /** Options for `$duplicate` on table rows: field overrides plus copy controls. */
137
+ export type ManifestDuplicateOptions<T> = Partial<T> & { newRowId?: string; files?: 'duplicate' | 'same' | 'none' };
138
+
139
+ /** Reads, mutations and paging on Appwrite-table sources. */
68
140
  export interface ManifestAppwriteTableOps<T> {
69
- $create(values: Partial<T>): Promise<T>;
70
- $update(id: string, values: Partial<T>): Promise<T>;
71
- $delete(id: string): Promise<void>;
72
- $duplicate(id: string, overrides?: Partial<T>): Promise<T>;
141
+ /** Server-side query with expressions or a named query from manifest.json; replaces the source's rows. */
142
+ $query(queriesOrName: ManifestQueryTuple<T>[] | string): Promise<T[]>;
143
+ $create(values: Partial<T>, rowId?: string): Promise<T>;
144
+ /** One row by id, several by ids, or a list of `{ id, data }` (no second argument). */
145
+ $update<I extends string | string[] | ManifestUpdateList<T>>(
146
+ target: I,
147
+ ...values: 0 extends (1 & I) ? [values?: Partial<T>] : I extends ManifestUpdateList<T> ? [] : [values: Partial<T>]
148
+ ): Promise<0 extends (1 & I) ? T : I extends string ? T : T[]>;
149
+ $delete(id: string): Promise<T>;
150
+ $delete(ids: string[]): Promise<T[]>;
151
+ $duplicate(id: string, options?: ManifestDuplicateOptions<T>): Promise<T>;
152
+ $first(limit?: number): Promise<ManifestCursorPage<T>>;
153
+ $next(cursor: string, limit?: number): Promise<ManifestCursorPage<T>>;
154
+ $prev(cursor: string, limit?: number): Promise<ManifestCursorPage<T>>;
155
+ $page(page: number, limit?: number): Promise<ManifestOffsetPage<T>>;
156
+ $reload(): Promise<void>;
157
+ /** Realtime events skipped by the growth cap since the last load. */
158
+ readonly $realtimeOverflow: number;
159
+ /** Loads the next page into the source (`paging` sources only); resolves with the rows added. */
160
+ $more(): Promise<number>;
161
+ /** Whether `$more()` can load another page; false at the end or at `max`. */
162
+ readonly $hasMore: boolean;
163
+ /** Appwrite's count for the current filters, or null when not requested. */
164
+ readonly $total: number | null;
165
+ /** True when `$total` hit Appwrite's counting ceiling. */
166
+ readonly $totalCapped: boolean;
167
+ /** Whether a write to row `id` is still unconfirmed. */
168
+ $saving(id: string): boolean;
169
+ /** Rows with an unconfirmed write. */
170
+ readonly $pending: number;
171
+ }
172
+
173
+ /** Detail of `manifest:data-mutation-success` / `manifest:data-mutation-error` on window. */
174
+ export interface ManifestMutationDetail {
175
+ mutationId: string;
176
+ type: 'create' | 'update' | 'delete';
177
+ dataSourceName: string;
178
+ entryId?: string;
179
+ result?: unknown;
180
+ error?: unknown;
73
181
  }
74
182
 
75
183
  /** Operations available on Appwrite-bucket (storage) sources. */
76
184
  export interface ManifestAppwriteBucketOps {
77
- $url(fileId: string): string;
78
- $preview(fileId: string, opts?: Record<string, unknown>): string;
79
- $download(fileId: string): string;
80
- $openUrl(fileId: string): void;
81
- $openPreview(fileId: string): void;
82
- $openDownload(fileId: string): void;
83
- $upload(file: File | Blob, opts?: Record<string, unknown>): Promise<{ $id: string }>;
185
+ $url(fileId: string, token?: string): string;
186
+ $preview(fileId: string, options?: Record<string, unknown>, token?: string): string;
187
+ $download(fileId: string, token?: string): string;
188
+ $openUrl(fileId: string, token?: string): void;
189
+ $openPreview(fileId: string, options?: Record<string, unknown>, token?: string): void;
190
+ $openDownload(fileId: string, filename?: string, token?: string): void;
191
+ $create(file: File | Blob, fileId?: string, permissions?: string[], onProgress?: (progress: unknown) => void): Promise<ManifestFile>;
192
+ $upload(file: File | Blob, opts?: Record<string, unknown>): Promise<ManifestFile>;
84
193
  $remove(fileId: string): Promise<void>;
85
- $filesFor(parentId: string, fieldName?: string): unknown[];
194
+ $delete(fileId: string | string[]): Promise<unknown>;
195
+ $duplicate(fileId: string, options?: { newName?: string; newFileId?: string }): Promise<ManifestFile>;
196
+ $filesFor(parentId: string, fieldName?: string): ManifestFile[];
197
+ $first(limit?: number): Promise<ManifestCursorPage<ManifestFile>>;
198
+ $next(cursor: string, limit?: number): Promise<ManifestCursorPage<ManifestFile>>;
199
+ $prev(cursor: string, limit?: number): Promise<ManifestCursorPage<ManifestFile>>;
200
+ $page(page: number, limit?: number): Promise<ManifestOffsetPage<ManifestFile>>;
86
201
  $unlinkFrom(parentId: string, fileId: string): Promise<void>;
87
202
  $removeFrom(parentId: string, fileId: string): Promise<void>;
88
203
  }
89
204
 
90
205
  /**
91
- * The shape returned by `$x.<source>` for an array-of-rows source.
92
- * Behaves as a regular `T[]` (supports `map`, `filter`, `find`, etc.) plus
93
- * Manifest operators and state flags.
206
+ * `$x.<source>` for an array-of-rows source (CSV tabular, JSON arrays).
207
+ * Behaves as a regular `T[]` plus Manifest operators and state flags.
94
208
  */
95
209
  export type ManifestArraySource<T> =
96
210
  & ReadonlyArray<T>
97
211
  & ManifestSourceState
98
- & ManifestArrayOps<T>
99
- & Partial<ManifestAppwriteTableOps<T>>;
212
+ & ManifestArrayOps<T>;
100
213
 
101
- /** The shape returned by `$x.<source>` for an object-shaped source (CSV key-value, JSON object, YAML map). */
214
+ /** `$x.<source>` for an Appwrite table: rows plus server-side queries, mutations and paging. */
215
+ export type ManifestTableSource<T> =
216
+ & ReadonlyArray<T>
217
+ & ManifestSourceState
218
+ & Omit<ManifestArrayOps<T>, '$query'>
219
+ & ManifestAppwriteTableOps<T>;
220
+
221
+ /** `$x.<source>` for an object-shaped source (CSV key-value, JSON object, YAML map). */
102
222
  export type ManifestObjectSource<T> = T & ManifestSourceState;
103
223
 
104
- /** The shape returned by `$x.<source>` for an Appwrite storage bucket. */
105
- export type ManifestBucketSource = ManifestSourceState & ManifestAppwriteBucketOps;
224
+ /** `$x.<source>` for an Appwrite storage bucket. */
225
+ export type ManifestBucketSource = ReadonlyArray<ManifestFile> & ManifestSourceState & ManifestAppwriteBucketOps;
106
226
 
107
- // ---------------------------------------------------------------------------
108
- // Magic globals registered by Manifest plugins
109
- // ---------------------------------------------------------------------------
227
+ /**
228
+ * Precise row types, keyed by data source name. Declare them to override the
229
+ * column names `npx mnfst-types` reads from the contract:
230
+ *
231
+ * declare module 'mnfst' { interface ManifestRows { tasks: Task } }
232
+ */
233
+ export interface ManifestRows { }
234
+
235
+ /** The row type for source `K`: a declared `ManifestRows` entry, else `Fallback`. */
236
+ export type ManifestRowFor<K extends string, Fallback> = K extends keyof ManifestRows ? ManifestRows[K] & ManifestRowSystem : Fallback;
110
237
 
111
238
  /**
112
- * Project-specific data sources, keyed by the names declared in `manifest.json`'s
113
- * `data` property. Augmented by `npx mnfst-types` from manifest.json + sample
114
- * data (declarations appended below the AUGMENTATION marker).
239
+ * Project data sources, keyed by the names in `manifest.json`'s `data`.
240
+ * `npx mnfst-types` fills this in below the AUGMENTATION marker.
115
241
  */
116
- export interface ManifestSources {
117
- [sourceName: string]: ManifestArraySource<any> | ManifestObjectSource<any> | ManifestBucketSource;
118
- }
242
+ export interface ManifestSources { }
243
+
244
+ /** `$x` itself: the sources plus runtime registration and persistence controls. */
245
+ export type ManifestData = ManifestSources & {
246
+ $register(name: string, data: unknown[] | Record<string, unknown>): void;
247
+ $wipe(target?: string | { all: true }): Promise<void>;
248
+ };
119
249
 
120
250
  /** `$auth` from the Appwrite auth plugin. Loose by design — auth API is broad. */
121
251
  export interface ManifestAuth {
@@ -194,7 +324,7 @@ export type ManifestRoute = string;
194
324
  export type ManifestModify = (attr: string) => string | undefined;
195
325
 
196
326
  /** `$try(fn)` — run a callback and swallow any thrown error, returning undefined on failure. */
197
- export type ManifestTry = <T>(fn: () => T) => T | undefined;
327
+ export type ManifestTry = <T>(fn: () => T | Promise<T>, errorVar?: string) => Promise<T | undefined>;
198
328
 
199
329
  /** `$pay` from the payments plugin: callable to start checkout, plus portal/state helpers. */
200
330
  export interface ManifestPay {
@@ -587,13 +717,105 @@ export interface ManifestSubmitDetail {
587
717
  message: string;
588
718
  }
589
719
 
720
+ // ---------------------------------------------------------------------------
721
+ // App modules: components, stores and magics on `this`
722
+ // ---------------------------------------------------------------------------
723
+
724
+ /**
725
+ * Alpine stores, keyed by name. Declare them so `$store.<name>` is checked:
726
+ *
727
+ * declare module 'mnfst' { interface ManifestStores { session: Session } }
728
+ */
729
+ export interface ManifestStores { [name: string]: any }
730
+
731
+ /** Declared stores keep their types; any other name is `any` until it's declared. */
732
+ export type ManifestStoreMap = ManifestStores;
733
+
734
+ /** Magics available on `this` inside an Alpine component (Alpine's own plus Manifest's). */
735
+ export interface ManifestMagics {
736
+ $el: HTMLElement;
737
+ $root: HTMLElement;
738
+ $refs: Record<string, any>;
739
+ $store: ManifestStoreMap;
740
+ $data: Record<string, any>;
741
+ $watch(property: string, callback: (value: any, oldValue: any) => void): void;
742
+ $dispatch(event: string, detail?: unknown): void;
743
+ $nextTick(callback?: () => void): Promise<void>;
744
+ $id(name: string, key?: string | number): string;
745
+ $x: ManifestData;
746
+ $route: ManifestRoute;
747
+ $modify: ManifestModify;
748
+ $try: ManifestTry;
749
+ $computed<T>(fn: (scope: any) => T): T;
750
+ $auth: ManifestAuth;
751
+ $locale: ManifestLocale;
752
+ $toast: ManifestToast;
753
+ $color: ManifestColor;
754
+ $colorpicker: ManifestColorpicker;
755
+ $url: ManifestUrl;
756
+ $pay: ManifestPay;
757
+ $chat: ManifestChat;
758
+ $status: ManifestStatus;
759
+ $presence: ManifestPresence;
760
+ $date: ManifestDate;
761
+ $chart: ManifestChart;
762
+ $export: ManifestExport;
763
+ $import: ManifestImport;
764
+ $edit: ManifestEdit;
765
+ $rich: ManifestRichText;
766
+ $device: ManifestDevice;
767
+ $share: ManifestShare;
768
+ $push: ManifestPush;
769
+ $secure: ManifestSecure;
770
+ $links: ManifestLinks;
771
+ $app: ManifestApp;
772
+ $haptics: ManifestHaptics;
773
+ $biometric: ManifestBiometric;
774
+ $camera: ManifestCamera;
775
+ }
776
+
777
+ /** Lifecycle hooks Alpine calls on a component. */
778
+ export interface ManifestComponentHooks {
779
+ init?(): void | Promise<void>;
780
+ destroy?(): void;
781
+ }
782
+
783
+ /**
784
+ * A component's state with `this` typed as that state plus every magic.
785
+ * Pair with an identity helper so `T` is inferred from the returned object:
786
+ *
787
+ * /** @template T @param {() => import('mnfst').ManifestComponent<T>} fn *\/
788
+ * export const component = (fn) => fn
789
+ */
790
+ export type ManifestComponent<T> = T & ManifestComponentHooks & ThisType<T & ManifestMagics>;
791
+
792
+ /** The `Alpine` global, as app modules use it. */
793
+ export interface ManifestAlpine {
794
+ data<T>(name: string, factory: (...args: any[]) => T): void;
795
+ store<T>(name: string, value: T & ThisType<T>): void;
796
+ store<K extends string>(name: K): ManifestStores[K];
797
+ magic(name: string, callback: (el: HTMLElement, options: unknown) => unknown): void;
798
+ directive(name: string, callback: (...args: any[]) => unknown): unknown;
799
+ nextTick(callback?: () => void): Promise<void>;
800
+ effect(callback: () => void): unknown;
801
+ reactive<T extends object>(value: T): T;
802
+ raw<T>(value: T): T;
803
+ evaluate(el: Element, expression: string): unknown;
804
+ initTree(el: Element): void;
805
+ $data(el: Element): Record<string, any>;
806
+ }
807
+
590
808
  // ---------------------------------------------------------------------------
591
809
  // Global declarations (what Alpine exposes inside `x-data`, `x-show`, etc.)
592
810
  // ---------------------------------------------------------------------------
593
811
 
594
812
  declare global {
595
813
  /** Project data sources registered in manifest.json. */
596
- const $x: ManifestSources;
814
+ const $x: ManifestData;
815
+ /** Alpine stores. */
816
+ const $store: ManifestStoreMap;
817
+ /** Alpine, loaded by Manifest; reach it inside `alpine:init`. */
818
+ const Alpine: ManifestAlpine;
597
819
  /** The current route path (compare or .startsWith against it). */
598
820
  const $route: ManifestRoute;
599
821
  /** Read a parent component attribute (Manifest's prop mechanism). */
@@ -669,7 +891,7 @@ declare global {
669
891
  /** The two-line same-origin /sw.js stub pinned to a framework version. */
670
892
  swStub?(version?: string): string;
671
893
  };
672
- Alpine?: unknown;
894
+ Alpine?: ManifestAlpine;
673
895
  __manifestLoaded?: unknown;
674
896
  /** Pending work that will still change the page; mnfst-render's auto settle won't snapshot early while count > 0. */
675
897
  ManifestPending?: {
@@ -700,6 +922,16 @@ declare global {
700
922
  'submit:error': CustomEvent<ManifestSubmitDetail>;
701
923
  }
702
924
 
925
+ interface WindowEventMap {
926
+ 'manifest:data-mutation-success': CustomEvent<ManifestMutationDetail>;
927
+ 'manifest:data-mutation-error': CustomEvent<ManifestMutationDetail>;
928
+ }
929
+
930
+ /** x-virtual: the last rendered row neared the end of the list (bubbles). */
931
+ interface HTMLElementEventMap {
932
+ 'virtual-end': CustomEvent<{ length: number }>;
933
+ }
934
+
703
935
  /**
704
936
  * Fired when the utilities runtime sees a class the baked sheet (and
705
937
  * `manifest.json`'s `utilities.safelist`/`patterns`) doesn't cover, after
@@ -720,6 +952,7 @@ declare global {
720
952
  // ---------------------------------------------------------------------------
721
953
 
722
954
  // (No project augmentations yet — run `npx mnfst-types` to generate.)
955
+ export interface ManifestSources { [sourceName: string]: any }
723
956
 
724
957
  // ---------------------------------------------------------------------------
725
958
  // AUGMENTATION:end