/** * The Lit DevTools panel as one web-standard request handler, for servers * that are not Vite: Elysia, Hono, `Bun.serve`, a SvelteKit or Next.js route. * * The host mounts {@link LitDevtools.handler} on a catch-all under * {@link LitDevtools.base} and puts {@link LitDevtools.script} at the top of * its pages' `
`. The panel and the page script answer on the host's * own origin. * * The RPC runs over a WebSocket on a side-car port that devframe binds * itself: the host's handler would need upgrade wiring, which differs per * server. Not SSE by default, though it needs no wiring at all: every page * holds a stream open, and a docked panel a second one, and over HTTP/1.1 the * browser allows six connections per host across all tabs. Three docked tabs * fill them, and the next page load waits forever. WebSockets do not count * against that limit. * * As with `lit-devtools dev`, there are no build-time transforms here, so * HMR patching is unavailable. The tree, inspector and timeline work, and * component locations come from the page's sourcemaps. */ export interface LitDevtoolsOptions { /** * Path the panel and its endpoints answer under, with a leading and a * trailing slash. Default `/__lit-devtools/`. */ base?: string; /** * Gate the RPC behind devframe's one-time code, printed to the server's * console when a page or panel first asks for one. On by default: anything * that can reach the host can otherwise read the session and open files in * the developer's editor. Pass `false` only for a dev server bound to * loopback. */ auth?: boolean; /** * Dock the panel in the page: a button in the corner opens it in a drawer * along the bottom, and picking an element opens it there. On by default; * with `false` the panel is only its own tab at {@link LitDevtools.base}. */ dock?: boolean; /** * How pages and the panel reach the RPC. `'websocket'` (the default) binds a * side-car WebSocket on a free port of {@link host}. `'sse'` keeps * everything on the host's origin, for setups that expose one port only (a * proxy, a tunnel, StackBlitz); over HTTP/1.1 its streams count against the * browser's six connections per host, so it suits HTTP/2 or a tab or two. */ transport?: 'websocket' | 'sse'; /** * Where the side-car WebSocket listens. The browser dials it on the page's * hostname, so this has to be the address pages use: a page on * `http://127.0.0.1:3000` needs `'127.0.0.1'`. Default `localhost`. */ host?: string; /** * Origins besides loopback that pages and the panel may connect from, for a * dev server reached through a cloud preview or a tunnel. A `*` in the host * stands for any subdomain, as with `lit-devtools dev --allow-origin`: * `['https://*.csb.app']` admits every CodeSandbox preview. Scheme and port * have to match. */ allowedOrigins?: readonly string[]; } export interface LitDevtools { /** The normalized mount path, e.g. `/__lit-devtools/`. */ base: string; /** Path of the page script, for ` * ``` */ export declare const createLitDevtools: ({ base, auth, dock, transport, host, allowedOrigins, }?: LitDevtoolsOptions) => LitDevtools; //# sourceMappingURL=embed.d.ts.map