declare const NoProps: symbol; type Descriptor = LiveComponentDescriptor | ElementDescriptor; type Callback = (state: S, event: any) => Promise | void; type Callbacks = Record>; type RenderCallback = (state: S, callbacks: Callbacks) => VirtualNode; type StateCallback = () => Promise | S; type InitCallback = (state: S) => void | Promise; declare global { type LiveComponentDescriptor = { __type: "live"; __componentId: string; __definition: { state: StateCallback; callbacks: Callbacks; render: RenderCallback; serverInit: InitCallback; }; props: Record; }; type VirtualNode = number | string | Descriptor | Array> | null | false; var atom: (initial: T) => Atom; var view: any>(fn: F) => F; var component: = {}>(config: ComponentConfig) => ComponentGenerator; interface Atom { get value(): T; set value(value: T); readonly id: string; } var rawHTML: (content: string) => VirtualNode; type ComponentSelf, A extends Record = any> = { props: Props; root?: Element; }; type AtomsOf> = { [K in keyof A]: Atom; }; type ViewFn, A extends Record = any> = (params: { self: ComponentSelf; atoms: AtomsOf; children: Array; }) => (LiveComponentDescriptor | ElementDescriptor | null | false | JSX.Element); type OnPageLoadOptions = { type?: "scoped" | "unscoped"; }; var onPageLoad: (callback: () => void, options?: OnPageLoadOptions) => void; type onMountCleanup = () => (void | Promise); interface ComponentConfig, A extends Record = {}> { view: ViewFn; atoms?: A; init?: (self: ComponentSelf, atoms: AtomsOf) => void | Promise; /** * The `onMount` method of a component is triggered whenever the component *appears* in the DOM. * * It does *not* trigger for subsequent navigations or re-renders. * * However, if the component is removed and then re-appears, onMount is called again. */ onMount?: (self: ComponentSelf, atoms: AtomsOf) => void | Promise | onMountCleanup; /** * The `onUnMount` method of a component is triggered whenever the component *is removed* from the DOM. */ onUnmount?: (self: ComponentSelf, atoms: AtomsOf) => void | Promise; /** * The `onNavigate` method of a component is triggered *after* local navigation has occured and the page has loaded. * * It is *also* triggered once after the initial page load, since it is technically a navigation. */ onNavigate?: (self: ComponentSelf, atoms: AtomsOf) => void | Promise | onMountCleanup; __id?: string; } type Page = (...props: any) => VirtualNode; var track: (atom: Atom, callback: (value: T) => void) => void; var untrack: (atom: Atom, callback: (value: T) => void) => void; type ComponentGenerator = {}> = { (...args: Props extends typeof NoProps ? [] : [props: Props]): LiveComponentDescriptor; __config: ComponentConfig; }; type SelfOf = C extends ComponentGenerator ? { self: ComponentSelf; atoms: AtomsOf; } : never; var createElement: (tag: string | ((props: Record) => JSX.Element), props: Record | null, ...children: any[]) => JSX.Element; } export {}; //# sourceMappingURL=component.d.ts.map