olova 2.0.67 → 2.0.68

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/dist/runtime.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as Signal } from './signals-core-BdfWh1Yt.js';
1
+ import { S as Signal } from './signals-core-BWZ5zXK5.js';
2
2
  import '@preact/signals-core';
3
3
 
4
4
  type OlovaProps = Record<string, unknown>;
@@ -56,12 +56,13 @@ type CompiledDescriptor = {
56
56
  nodes: Record<string, Node>;
57
57
  };
58
58
  };
59
- type SetupFn = (props: OlovaProps, slots: OlovaSlots) => CompiledDescriptor;
59
+ type SetupFn = (props: OlovaProps, slots: OlovaSlots) => CompiledDescriptor | Promise<CompiledDescriptor>;
60
60
  interface OlovaComponent {
61
61
  setup: SetupFn;
62
62
  __hmrId?: string;
63
63
  __hmrInstances?: Set<MountedInstance>;
64
64
  }
65
+ type ErrorBoundaryFallback = OlovaComponent | ((error: Error) => CompiledDescriptor);
65
66
  type MountTarget = HTMLElement | Range;
66
67
  type MountedInstance = {
67
68
  component: OlovaComponent;
@@ -77,6 +78,10 @@ type MountedInstance = {
77
78
  };
78
79
  declare function replaceComponent(current: OlovaComponent, next: OlovaComponent): void;
79
80
  declare function defineComponent(setup: SetupFn, hmrId?: string): OlovaComponent;
81
+ declare function onMount(fn: () => void | (() => void)): void;
82
+ declare function onCleanup(fn: () => void): void;
83
+ declare function createErrorBoundary(component: OlovaComponent, fallback: ErrorBoundaryFallback): OlovaComponent;
84
+ declare const Suspense: OlovaComponent;
80
85
  declare function dangerouslySetHtml(value: unknown): DangerousHtml;
81
86
  declare function setContext<T>(key: unknown, value: T): T;
82
87
  declare function getContext<T>(key: unknown): T;
@@ -86,4 +91,4 @@ declare function createApp(root: OlovaComponent): {
86
91
  mount(target: string | HTMLElement): () => void;
87
92
  };
88
93
 
89
- export { type CompiledDescriptor, type DangerousHtml, type OlovaComponent, type OlovaProps, type OlovaSlots, type SetupFn, createApp, dangerouslySetHtml, defineComponent, getContext, hasContext, mount, replaceComponent, setContext };
94
+ export { type CompiledDescriptor, type DangerousHtml, type ErrorBoundaryFallback, type OlovaComponent, type OlovaProps, type OlovaSlots, type SetupFn, Suspense, createApp, createErrorBoundary, dangerouslySetHtml, defineComponent, getContext, hasContext, mount, onCleanup, onMount, replaceComponent, setContext };