import { default as ts } from 'typescript'; import { ResolvedDependencyComponents } from '../dependencies/discover.ts'; import { CompilerContext } from '../context/index.ts'; export type JsxContext = { readonly compiler: CompilerContext; /** Source file before the _JSX to lit-html_ transformation */ readonly sourceFile: ts.SourceFile; readonly transformationContext: ts.TransformationContext; /** * All encountered native HTML elements and custom-elements along with a * reference to a TypeScript JSX node where first occurrence was. You can use * the TypeScript node to find the location where component was declared and * thus inform what import paths need to be added in the current file. * * If you successfully resolved some element from this map, then please * remove it from the map to not confuse any following resolvers. */ readonly customElementsToImport: Set; readonly customElementsToImportDeferred: Set; /** * Existing imported modules. * * If original specifier was for an external package, this will include the * specifier as is. * * If original specifier was to a relative file, the path will be resolved * to an absolute path, but without a file extension. * * Can be used to inform what custom elements are already imported */ readonly existingImportedModules: Set; /** * A set of absolute paths to modules in the current package from which the * current file imported capitalized identifiers (capitalized identifier is * often a functional component, though not always) */ readonly importedFunctionComponentsFromModules: Set; readonly existingLitImports: Set; /** * If there already is an identifier with a given name in the class, rename * the imported identifier to avoid conflicts. */ readonly importRenames: Record; readonly neededImports: Set; readonly externalComponents: ResolvedDependencyComponents["components"]; readonly localComponents: ResolvedDependencyComponents["components"]; /** * `key={}` attributes that were converted to `repeat()` calls and thus should * not be converted to `keyed()` directives. */ readonly liftedKeys: Set; readonly isInLightDomComponent: boolean; hasNonLuminaJsxImport: boolean; }; /** * Funny that lit called the "dynamic html" version of "html" as "staticHtml" */ export declare const staticHtmlTag = "staticHtml"; export declare const staticSvgTag = "staticSvg"; export declare const htmlTag = "html"; export declare const svgTag = "svg"; export declare const ambiguousSvgTag: unique symbol; export declare const cssTag = "css"; export declare const mathMlTag = "mathml"; declare const litTagsArray: readonly ["css", "html", "mathml", "staticHtml", "staticSvg", "svg"]; export declare const litTags: Set<"html" | "svg" | "css" | "mathml" | "staticHtml" | "staticSvg">; export type LitTag = (typeof litTagsArray)[number]; export declare const jsxImportNames: readonly ["keyed", "ref", "repeat", "live", "css", "html", "mathml", "staticHtml", "staticSvg", "svg", "safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef", "nothing"]; export type JsxImportName = (typeof jsxImportNames)[number]; export type JsxHost = ts.JsxElement | ts.JsxFragment | ts.JsxSelfClosingElement; /** Returns `true` if the given node is an array expression containing jsx nodes */ export declare const isJsxArray: (node: ts.Node) => node is ts.ArrayLiteralExpression; export declare const isJsxHost: (node: ts.Node) => node is JsxHost; export {};