import { Page as InertiaPage } from '@inertiajs/core'; import { createInertiaApp } from '@inertiajs/react'; import { ReactElement } from 'react'; import { Plugin, Registry } from '@lattice-php/core/registry'; import { SpriteValue } from '@lattice-php/ui/icons/sprite'; import { CreateLayoutResolverOptions, PageModules } from './inertia.js'; type InertiaAppOptions = NonNullable[0]>; export type CreateLatticeAppI18nOptions = { /** * i18next namespaces to load, e.g. `["lattice", "app"]`. Defaults to the * package's own. Namespaces declared by plugins are merged in on top. */ namespaces?: string[]; }; export type CreateLatticeAppOptions = Omit & { registry?: Registry; /** * Component-package plugins to merge onto the registry — pass the * Composer-discovered `virtual:lattice/plugins` here to register vendor * components with no manual `extendRegistry` call. A plugin's declared * i18n namespace joins the i18n bootstrap automatically. */ plugins?: Plugin[]; sprite?: SpriteValue; /** Normal Inertia page modules, e.g. `import.meta.glob('./pages/**\/*.tsx')`. */ pages?: PageModules; defaultLayout?: CreateLayoutResolverOptions["defaultLayout"]; /** * Lattice's i18n bootstrap, on by default: when the backend shares the * `lattice.i18n` prop, the first render waits for the translation setup (no * flash of untranslated fallbacks; a server-rendered page instead hydrates * immediately and swaps strings in once ready), `LocaleReload` re-fetches the * page after a locale switch, and every visit carries the locale/timezone * headers. The * i18next chunk only loads when the backend actually shares the prop. Pass * `false` to opt out entirely. */ i18n?: CreateLatticeAppI18nOptions | false; /** * App bootstrap that needs the initial page — e.g. `configureEcho` from a * shared connection prop. Runs on the client before the first render; a * returned promise delays that render until it resolves, except when * hydrating a server-rendered page (hydration must match the SSR'd HTML). */ boot?: (context: { page: InertiaPage; }) => void | Promise; /** * Compose providers or siblings around the app. Applied inside the Lattice * Provider, so the registry, sprite, and toaster contexts are available. */ wrap?: (app: ReactElement) => ReactElement; }; /** * Bootstrap an Inertia app with the Lattice shell: the page/layout resolvers * (server-driven Lattice pages and normal Inertia pages alike), the Provider — * registry, sprite, flash toasts via Lattice's own Toaster — theme * initialization, and the i18n bootstrap. Forwards any other createInertiaApp * option. */ export declare function createLatticeApp({ registry, plugins, sprite, pages, defaultLayout, strictMode, i18n, boot, wrap, ...inertiaOptions }?: CreateLatticeAppOptions): Promise, renderToString: (element: ReactElement) => string) => Promise)>; export {};