mnfst-types 0.1.14 → 0.1.16

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.14",
3
+ "version": "0.1.16",
4
4
  "description": "Generate TypeScript types for a Manifest project from manifest.json and sample data",
5
5
  "type": "module",
6
6
  "bin": {
@@ -248,7 +248,7 @@ export type ManifestData = ManifestSources & {
248
248
  $wipe(target?: string | { all: true }): Promise<void>;
249
249
  };
250
250
 
251
- /** `$auth` from the Appwrite auth plugin. Loose by design — auth API is broad. */
251
+ /** `$auth` from the Appwrite auth module. Loose by design — auth API is broad. */
252
252
  export interface ManifestAuth {
253
253
  readonly current: { $id: string; email?: string; name?: string;[k: string]: unknown } | null;
254
254
  readonly isAuthenticated: boolean;
@@ -263,7 +263,7 @@ export interface ManifestAuth {
263
263
  [extra: string]: unknown;
264
264
  }
265
265
 
266
- /** `$locale` from the localization plugin. */
266
+ /** `$locale` from the localization module. */
267
267
  export interface ManifestLocale {
268
268
  readonly current: string;
269
269
  readonly available: string[];
@@ -277,7 +277,7 @@ export interface ManifestToastVariant {
277
277
  fixed(message: string, opts?: Record<string, unknown>): void;
278
278
  }
279
279
 
280
- /** `$toast` from the toasts plugin. Typed variants: `$toast.brand(...)`, `$toast.positive.dismiss(...)`. */
280
+ /** `$toast` from the toasts module. Typed variants: `$toast.brand(...)`, `$toast.positive.dismiss(...)`. */
281
281
  export interface ManifestToast extends ManifestToastVariant {
282
282
  brand: ManifestToastVariant;
283
283
  accent: ManifestToastVariant;
@@ -285,12 +285,12 @@ export interface ManifestToast extends ManifestToastVariant {
285
285
  negative: ManifestToastVariant;
286
286
  }
287
287
 
288
- /** `$color` from the color plugin — the current light/dark/system color mode. */
288
+ /** `$color` from the color module — the current light/dark/system color mode. */
289
289
  export interface ManifestColor {
290
290
  current: 'light' | 'dark' | 'system' | string;
291
291
  }
292
292
 
293
- /** `$colorpicker` from the colorpicker plugin. Loose by design. */
293
+ /** `$colorpicker` from the colorpicker module. Loose by design. */
294
294
  export interface ManifestColorpicker {
295
295
  (id?: string): Record<string, unknown>;
296
296
  [extra: string]: unknown;
@@ -310,7 +310,7 @@ export interface ManifestUrlParam {
310
310
  clear(): void;
311
311
  }
312
312
 
313
- /** `$url` from the url-parameters plugin: `$url.tab.value`, `$url.tag.add('x')`, ... */
313
+ /** `$url` from the url-parameters module: `$url.tab.value`, `$url.tag.add('x')`, ... */
314
314
  export interface ManifestUrl {
315
315
  [param: string]: ManifestUrlParam;
316
316
  }
@@ -327,7 +327,7 @@ export type ManifestModify = (attr: string) => string | undefined;
327
327
  /** `$try(fn)` — run a callback and swallow any thrown error, returning undefined on failure. */
328
328
  export type ManifestTry = <T>(fn: () => T | Promise<T>, errorVar?: string) => Promise<T | undefined>;
329
329
 
330
- /** `$pay` from the payments plugin: callable to start checkout, plus portal/state helpers. */
330
+ /** `$pay` from the payments module: callable to start checkout, plus portal/state helpers. */
331
331
  export interface ManifestPay {
332
332
  (ref: string, payload?: Record<string, unknown>): Promise<unknown>;
333
333
  portal(ref?: string, payload?: Record<string, unknown>): Promise<unknown>;
@@ -347,7 +347,7 @@ export interface ManifestChatHandle {
347
347
  [extra: string]: unknown;
348
348
  }
349
349
 
350
- /** `$chat` from the chat plugin — adapter-based conversation projection. */
350
+ /** `$chat` from the chat module — adapter-based conversation projection. */
351
351
  export interface ManifestChat {
352
352
  open(conversationId: string, opts?: Record<string, unknown>): ManifestChatHandle;
353
353
  merge(handles: ManifestChatHandle[], opts?: Record<string, unknown>): ManifestChatHandle;
@@ -364,12 +364,12 @@ export interface ManifestStatusEntry {
364
364
  [extra: string]: unknown;
365
365
  }
366
366
 
367
- /** `$status` from the status plugin: `$status.api.state`, iterable, stringifies to the overall state. */
367
+ /** `$status` from the status module: `$status.api.state`, iterable, stringifies to the overall state. */
368
368
  export interface ManifestStatus extends Iterable<ManifestStatusEntry> {
369
369
  readonly [name: string]: any;
370
370
  }
371
371
 
372
- /** `$presence` from the Appwrite presences plugin. */
372
+ /** `$presence` from the Appwrite presences module. */
373
373
  export interface ManifestPresence {
374
374
  start(opts?: Record<string, unknown>): Promise<unknown>;
375
375
  stop(): void;
@@ -384,7 +384,7 @@ export interface ManifestPresence {
384
384
  readonly me: unknown;
385
385
  }
386
386
 
387
- /** `$date(id?)` from the datepicker plugin — the picker API for the nearest (or given) instance. */
387
+ /** `$date(id?)` from the datepicker module — the picker API for the nearest (or given) instance. */
388
388
  export type ManifestDate = (id?: string) => Record<string, unknown>;
389
389
 
390
390
  /** `x-chart` config object (standalone; annotate config objects with it). */
@@ -411,13 +411,15 @@ export interface ManifestChartConfig {
411
411
  max?: number | string | Date;
412
412
  /** Intl.NumberFormat options for tooltip and data-label values; axis ticks add compact notation. */
413
413
  format?: Intl.NumberFormatOptions;
414
+ /** Line/area/combo: label index from which lines are dashed and area fills lighter (e.g. a forecast). */
415
+ dashFrom?: number;
414
416
  [key: string]: unknown;
415
417
  }
416
418
 
417
- /** `$chart(id?)` from the charts plugin — the chart API for the nearest (or given) instance. */
419
+ /** `$chart(id?)` from the charts module — the chart API for the nearest (or given) instance. */
418
420
  export type ManifestChart = (id?: string) => Record<string, unknown>;
419
421
 
420
- /** `$export(opts)` from the export plugin — export the page or a data source (pdf/csv/json/...). */
422
+ /** `$export(opts)` from the export module — export the page or a data source (pdf/csv/json/...). */
421
423
  export type ManifestExport = (opts?: {
422
424
  format?: string;
423
425
  filename?: string;
@@ -426,7 +428,7 @@ export type ManifestExport = (opts?: {
426
428
  [extra: string]: unknown;
427
429
  }) => Promise<unknown>;
428
430
 
429
- /** `$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. */
431
+ /** `$import(opts)` from the import module — pick a local file and parse it (json/csv). Resolves the parsed data, or null when the dialog is dismissed. */
430
432
  export type ManifestImport = (opts?: {
431
433
  format?: 'json' | 'csv';
432
434
  /** Data source to replace with the parsed content. */
@@ -436,7 +438,7 @@ export type ManifestImport = (opts?: {
436
438
  [extra: string]: unknown;
437
439
  }) => Promise<unknown>;
438
440
 
439
- /** `$device` from the utilities plugin (enriched by the device plugin when present). */
441
+ /** `$device` from the utilities module (enriched by the device module when present). */
440
442
  export interface ManifestDevice {
441
443
  readonly os: string;
442
444
  readonly touch: boolean;
@@ -446,11 +448,11 @@ export interface ManifestDevice {
446
448
  readonly platform: string;
447
449
  }
448
450
 
449
- /** `$share` from the device plugin — native sheet, web share, or clipboard fallback. */
451
+ /** `$share` from the device module — native sheet, web share, or clipboard fallback. */
450
452
  export type ManifestShare = (opts?: { title?: string; text?: string; url?: string }) =>
451
453
  Promise<{ shared: boolean; method: string; cancelled?: boolean }>;
452
454
 
453
- /** `$push` from the device plugin — push/notification permissions and token. */
455
+ /** `$push` from the device module — push/notification permissions and token. */
454
456
  export interface ManifestPush {
455
457
  /** Ask for permission, on your schedule (never prompted on load). */
456
458
  request(): Promise<'granted' | 'denied' | 'prompt' | 'unsupported' | string>;
@@ -464,7 +466,7 @@ export interface ManifestPush {
464
466
  [extra: string]: unknown;
465
467
  }
466
468
 
467
- /** `$secure` from the device plugin — Keychain/Keystore via a native plugin; unencrypted localStorage on the web only; rejects on native without a plugin. */
469
+ /** `$secure` from the device module — Keychain/Keystore via a native plugin; unencrypted localStorage on the web only; rejects on native without a plugin. */
468
470
  export interface ManifestSecure {
469
471
  get(key: string): Promise<string | null>;
470
472
  set(key: string, value: string): Promise<void>;
@@ -474,7 +476,7 @@ export interface ManifestSecure {
474
476
  use(adapter: unknown): void;
475
477
  }
476
478
 
477
- /** `$links` from the device plugin — deep/universal link handling. */
479
+ /** `$links` from the device module — deep/universal link handling. */
478
480
  export interface ManifestLinks {
479
481
  /** Take over an inbound link: link.url is the full URL, link.path the route it maps to. */
480
482
  on(handler: (link: { url: string; path: string }) => void): void;
@@ -482,13 +484,13 @@ export interface ManifestLinks {
482
484
  readonly last: string | null;
483
485
  }
484
486
 
485
- /** `$app` from the device plugin — foreground/background state. */
487
+ /** `$app` from the device module — foreground/background state. */
486
488
  export interface ManifestApp {
487
489
  readonly active: boolean;
488
490
  onChange(handler: (active: boolean) => void): void;
489
491
  }
490
492
 
491
- /** `$haptics` from the device plugin — haptic feedback with web vibration fallback. */
493
+ /** `$haptics` from the device module — haptic feedback with web vibration fallback. */
492
494
  export interface ManifestHaptics {
493
495
  impact(style?: 'LIGHT' | 'MEDIUM' | 'HEAVY' | string): Promise<unknown>;
494
496
  notification(type?: 'SUCCESS' | 'WARNING' | 'ERROR' | string): Promise<unknown>;
@@ -497,7 +499,7 @@ export interface ManifestHaptics {
497
499
  [extra: string]: unknown;
498
500
  }
499
501
 
500
- /** `$biometric` from the device plugin. */
502
+ /** `$biometric` from the device module. */
501
503
  export interface ManifestBiometric {
502
504
  available(): Promise<boolean>;
503
505
  verify(opts?: {
@@ -510,7 +512,7 @@ export interface ManifestBiometric {
510
512
  }): Promise<{ verified: boolean; error?: string; code?: string }>;
511
513
  }
512
514
 
513
- /** `$camera` from the device plugin. */
515
+ /** `$camera` from the device module. */
514
516
  export interface ManifestCamera {
515
517
  photo(opts?: Record<string, unknown>): Promise<unknown>;
516
518
  pick(opts?: Record<string, unknown>): Promise<unknown>;
@@ -532,7 +534,7 @@ export interface ManifestEditClasses {
532
534
  list(el?: Element): string[];
533
535
  }
534
536
 
535
- /** Element editor (`x-edit`) — opt-in plugin. Modifiers: `.text` `.move` `.size`
537
+ /** Element editor (`x-edit`) — opt-in module. Modifiers: `.text` `.move` `.size`
536
538
  * `.data` (default text + move), `.lock[.action]`, `.gated`, `.persist`, `.bare`,
537
539
  * `.theme`, `.cssvar`. Every edit is logged; actions default to `$edit.target`. */
538
540
  export interface ManifestEdit {
@@ -728,7 +730,7 @@ export type ManifestDirective =
728
730
  | 'x-icon' | 'x-svg' | 'x-markdown' | 'x-code' | 'x-code-group'
729
731
  | 'x-toast' | 'x-tooltip' | 'x-carousel' | 'x-virtual' | 'x-computed' | 'x-defer'
730
732
  | 'x-chart' | 'x-date' | 'x-color' | 'x-colorpicker' | 'x-combobox'
731
- | 'x-export' | 'x-import' | 'x-pay' | 'x-files' | 'x-data-files'
733
+ | 'x-export' | 'x-import' | 'x-pay'
732
734
  | 'x-edit' | 'x-rich-text' | 'x-submit';
733
735
 
734
736
  /** Detail of the `submit:sent` / `submit:error` events an `x-submit` form dispatches. */
@@ -855,62 +857,66 @@ declare global {
855
857
  * Recomputed once per flush when a tracked dependency changes; reads as a plain property with a stable identity in between.
856
858
  */
857
859
  const $computed: <T>(fn: (this: any) => T) => T;
858
- /** Appwrite auth plugin (present when the plugin is loaded). */
860
+ /** Appwrite auth module (present when the module is loaded). */
859
861
  const $auth: ManifestAuth;
860
- /** Localization plugin. */
862
+ /** Localization module. */
861
863
  const $locale: ManifestLocale;
862
- /** Toasts plugin. */
864
+ /** Toasts module. */
863
865
  const $toast: ManifestToast;
864
- /** Color-mode plugin (`$color.current = 'dark'`). */
866
+ /** Color-mode module (`$color.current = 'dark'`). */
865
867
  const $color: ManifestColor;
866
- /** Colorpicker plugin. */
868
+ /** Colorpicker module. */
867
869
  const $colorpicker: ManifestColorpicker;
868
- /** URL parameters plugin (`$url.tab.value`). */
870
+ /** URL parameters module (`$url.tab.value`). */
869
871
  const $url: ManifestUrl;
870
- /** Payments plugin. */
872
+ /** Payments module. */
871
873
  const $pay: ManifestPay;
872
- /** Chat plugin. */
874
+ /** Chat module. */
873
875
  const $chat: ManifestChat;
874
- /** Status plugin. */
876
+ /** Status module. */
875
877
  const $status: ManifestStatus;
876
- /** Appwrite presences plugin. */
878
+ /** Appwrite presences module. */
877
879
  const $presence: ManifestPresence;
878
- /** Datepicker plugin. */
880
+ /** Datepicker module. */
879
881
  const $date: ManifestDate;
880
- /** Charts plugin. */
882
+ /** Charts module. */
881
883
  const $chart: ManifestChart;
882
- /** Export plugin. */
884
+ /** Export module. */
883
885
  const $export: ManifestExport;
884
- /** Import plugin. */
886
+ /** Import module. */
885
887
  const $import: ManifestImport;
886
- /** Element editor (edit plugin; opt-in). */
888
+ /** Element editor (edit module; opt-in). */
887
889
  const $edit: ManifestEdit;
888
- /** Rich text editor (rich-text plugin; loaded on use). */
890
+ /** Rich text editor (rich-text module; loaded on use). */
889
891
  const $rich: ManifestRichText;
890
- /** Device/platform info (utilities; enriched by the device plugin). */
892
+ /** Device/platform info (utilities; enriched by the device module). */
891
893
  const $device: ManifestDevice;
892
- /** Native share (device plugin). */
894
+ /** Native share (device module). */
893
895
  const $share: ManifestShare;
894
- /** Push permissions (device plugin). */
896
+ /** Push permissions (device module). */
895
897
  const $push: ManifestPush;
896
- /** Secure storage (device plugin). */
898
+ /** Secure storage (device module). */
897
899
  const $secure: ManifestSecure;
898
- /** Deep links (device plugin). */
900
+ /** Deep links (device module). */
899
901
  const $links: ManifestLinks;
900
- /** App foreground state (device plugin). */
902
+ /** App foreground state (device module). */
901
903
  const $app: ManifestApp;
902
- /** Haptics (device plugin). */
904
+ /** Haptics (device module). */
903
905
  const $haptics: ManifestHaptics;
904
- /** Biometric auth (device plugin). */
906
+ /** Biometric auth (device module). */
905
907
  const $biometric: ManifestBiometric;
906
- /** Camera (device plugin). */
908
+ /** Camera (device module). */
907
909
  const $camera: ManifestCamera;
908
910
 
909
911
  /** Window-level Manifest namespace exposed by the loader. */
910
912
  interface Window {
911
913
  Manifest?: {
914
+ loadModule(name: string, version?: string): Promise<unknown>;
915
+ /** @deprecated Use loadModule. */
912
916
  loadPlugin(name: string, version?: string): Promise<unknown>;
913
917
  loadTailwind(version?: string): Promise<unknown>;
918
+ getModuleUrl(name: string, version?: string): string;
919
+ /** @deprecated Use getModuleUrl. */
914
920
  getPluginUrl(name: string, version?: string): string;
915
921
  /** Defer a closed container built at runtime (call before Alpine.initTree). */
916
922
  defer?(el: Element): unknown;
@@ -930,7 +936,7 @@ declare global {
930
936
  /** Mark a timer callback as housekeeping that never changes the page (auto settle ignores it). */
931
937
  background<T extends Function>(fn: T): T;
932
938
  };
933
- /** Rich text engine (rich-text plugin). */
939
+ /** Rich text engine (rich-text module). */
934
940
  ManifestRichText?: {
935
941
  attach(el: Element, options?: ManifestRichTextAttachOptions): ManifestRichTextHandle | null;
936
942
  toMarkdown(root: Element): string;
@@ -938,7 +944,7 @@ declare global {
938
944
  sanitize(html: string, allowBlocks?: boolean, keepStyle?: boolean): string;
939
945
  commands(): string[];
940
946
  };
941
- /** Form sending (submissions plugin; loaded on first x-submit). */
947
+ /** Form sending (submissions module; loaded on first x-submit). */
942
948
  ManifestSubmissions?: {
943
949
  readonly events: { sent: string; error: string };
944
950
  send(form: HTMLFormElement, submitter?: HTMLElement | null): Promise<ManifestSubmitDetail>;