import type { Project } from '../../utils/ts-morph.ts'; import { generatedFilenames, getSourceTextValueSignature } from '../document.ts'; import type { Languages } from '../../utils/get-language.ts'; export interface SourceTextMetadata { value: string; language?: Languages; filePath?: string; label?: string; valueSignature?: string; } export type SourceTextHydrationMetadata = Pick; export interface GetSourceTextMetadataOptions extends Omit { /** The project to use for the source text. */ project: Project; /** The base directory to use for the source text. */ baseDirectory?: string; /** Whether formatting should be performed. */ shouldFormat?: boolean; /** Whether formatting was explicitly requested by the caller. */ isFormattingExplicit?: boolean; /** Whether explicit in-memory snippets should use a content-addressed path. */ virtualizeFilePath?: boolean; } export { generatedFilenames, getSourceTextValueSignature, }; export declare function hydrateSourceTextMetadataSourceFile(project: Project, metadata: SourceTextMetadata): void; export declare function getSourceTextMetadataFallback(options: Omit): SourceTextMetadata; /** * Parses and normalizes source text metadata. This also optionally formats the * source text using the project's installed formatter. If this is a JavaScript * or TypeScript code block, a ts-morph source file is created to type-check the * source text. */ export declare function getSourceTextMetadata({ project, filePath: filePathProp, language, shouldFormat, isFormattingExplicit, virtualizeFilePath, value, baseDirectory, }: GetSourceTextMetadataOptions): Promise;