/** * @license * Copyright 2023 Google LLC * SPDX-License-Identifier: BSD-3-Clause */ import { type CompiledTemplateResult, type TemplateResult } from 'lit-html'; declare const SERVER_ONLY = 1; export interface ServerRenderedTemplate extends TemplateResult { _$litServerRenderMode: typeof SERVER_ONLY; } /** * A lit-html template that can only be rendered on the server, and cannot be * hydrated. * * These templates can be used for rendering full documents, including the * doctype, and rendering into elements that Lit normally cannot, like * ``, `<textarea>`, `<template>`, and non-executing `<script>` tags * like `<script type="text/json">`. They are also slightly more efficient than * normal Lit templates, because the generated HTML doesn't need to include * markers for updating. * * Server-only `html` templates can be composed, and combined, and they support * almost all features that normal Lit templates do, with the exception of * features that don't have a pure HTML representation, like event handlers or * property bindings. * * Server-only `html` templates can only be rendered on the server, they will * throw an Error if created in the browser. However if you render a normal Lit * template inside a server-only template, then it can be hydrated and updated. * Likewise, if you place a custom element inside a server-only template, it can * be hydrated and update like normal. * * A server-only template can't be rendered inside a normal Lit template. */ export declare function html(strings: TemplateStringsArray, ...values: unknown[]): ServerRenderedTemplate; /** * If true, the given template result is from a normal lit-html template, and * not a server-only template. * * Server-only templates are only rendered once, they don't create the * marker comments needed to identify and update their dynamic parts. */ export declare const isHydratable: (template: MaybeServerTemplate) => boolean; type MaybeCompiledTemplate = TemplateResult | CompiledTemplateResult; type MaybeServerTemplate = MaybeCompiledTemplate & { _$litServerRenderMode?: typeof SERVER_ONLY; }; export {}; //# sourceMappingURL=server-template.d.ts.map