import type { SyntaxKind } from '../utils/ts-morph.ts'; import type { SlugCasing } from '@renoun/mdx'; import type { Languages as GrammarLanguage } from '../grammars/index.ts'; import type { ModuleExport } from '../utils/get-file-exports.ts'; import type { GetTokensOptions, TokenizedLines } from '../utils/get-tokens.ts'; import type { GetSourceTextMetadataOptions, SourceTextHydrationMetadata, SourceTextMetadata } from './query/source-text-metadata.ts'; import type { OutlineRange } from '../utils/get-outline-ranges.ts'; import type { QuickInfoAtPosition } from '../utils/get-quick-info-at-position.ts'; import type { TypeFilter } from '../utils/resolve-type.ts'; import type { ResolvedTypeAtLocationResult } from '../utils/resolve-type-at-location.ts'; import type { ResolvedFileExportsResult } from '../utils/resolve-file-exports.ts'; import type { DistributiveOmit } from '../types.ts'; import type { JavaScriptFileReferenceBaseData, JavaScriptFileResolvedTypesData } from '../file-system/reference-artifacts.ts'; import type { Section } from '../file-system/types.ts'; import { type AnalysisClientBrowserRefreshNotification as ClientBrowserRefreshNotification } from './client-refresh-state.ts'; import type { AnalysisServerRuntime } from './runtime-env.ts'; import type { AnalysisOptions } from './types.ts'; export type { AnalysisClientBrowserRefreshNotification } from './client-refresh-state.ts'; export { getAnalysisClientBrowserRuntime, onAnalysisClientBrowserRuntimeChange, } from './browser-runtime.ts'; export { getAnalysisClientRetainedBrowserRuntimeActivationKey, hasRetainedAnalysisClientBrowserRuntime, onAnalysisClientBrowserRuntimeRetentionChange, } from './client-browser-runtime-retention.ts'; export { onAnalysisClientRefreshVersionChange } from './client-refresh-state.ts'; export interface CodeBlockTokensResult { metadata: SourceTextMetadata; tokens: TokenizedLines; } /** * A monotonic version that advances as refresh notifications invalidate client * runtime state. UI caches can include this to avoid stale data after edits. */ export declare function getAnalysisClientRefreshVersion(runtime?: AnalysisServerRuntime): string; export declare function onAnalysisClientBrowserRefreshNotification(listener: (message: ClientBrowserRefreshNotification) => void): () => void; export declare function subscribeToAnalysisClientBrowserRuntimeRefresh(runtime: AnalysisServerRuntime, listener: (message: ClientBrowserRefreshNotification) => void): () => void; export declare function setAnalysisClientBrowserRuntime(runtime?: AnalysisServerRuntime): void; export declare function retainAnalysisClientBrowserRuntime(runtime?: AnalysisServerRuntime, options?: { preferCurrentRuntime?: boolean; }): () => void; export interface AnalysisClientRuntimeOptions { useRpcCache?: boolean; rpcCacheTtlMs?: number; consumeRefreshNotifications?: boolean; analysisCacheMaxEntries?: number; } export declare function configureAnalysisClientRuntime(options: AnalysisClientRuntimeOptions): void; export declare function resetAnalysisClientRuntimeConfiguration(): void; declare function disposeAnalysisBrowserClient(): void; /** * Parses and normalizes source text metadata. This also optionally formats the * source text using the project's installed formatter. */ export declare function getSourceTextMetadata(options: DistributiveOmit & { analysisOptions?: AnalysisOptions; }): Promise; /** * Resolve formatted source metadata and highlighted tokens for a code block in * a single dependency-aware analysis request. */ export declare function getCodeBlockTokens(options: DistributiveOmit & Omit & { analysisOptions?: AnalysisOptions; languages?: GrammarLanguage[]; waitForWarmResult?: boolean; runtime?: AnalysisServerRuntime; }): Promise; /** * Resolve quick info for a symbol position in a source file. */ export declare function getQuickInfoAtPosition(filePath: string, position: number, analysisOptions?: AnalysisOptions, runtime?: AnalysisServerRuntime, cacheKey?: string, sourceMetadata?: SourceTextHydrationMetadata): Promise; /** * Resolve the type of an expression at a specific location. */ export declare function resolveTypeAtLocation(filePath: string, position: number, kind: SyntaxKind, filter?: TypeFilter, analysisOptions?: AnalysisOptions): Promise; /** * Resolve the type of an expression at a specific location and include * dependency metadata for cache invalidation. */ export declare function resolveTypeAtLocationWithDependencies(filePath: string, position: number, kind: SyntaxKind, filter?: TypeFilter, analysisOptions?: AnalysisOptions): Promise; /** * Tokenize source text based on a language and return highlighted tokens. */ export declare function getTokens(options: Omit & { languages?: GrammarLanguage[]; analysisOptions?: AnalysisOptions; waitForWarmResult?: boolean; runtime?: AnalysisServerRuntime; }): Promise; export declare function getTypeScriptDependencyPaths(filePath: string, analysisOptions?: AnalysisOptions): Promise; /** * Get the exports of a file. */ export declare function getFileExports(filePath: string, analysisOptions?: AnalysisOptions): Promise; export declare function readFreshReferenceBaseArtifact(filePath: string, stripInternal: boolean, analysisOptions?: AnalysisOptions): Promise; export declare function getReferenceBaseArtifact(filePath: string, stripInternal: boolean, analysisOptions?: AnalysisOptions): Promise; export declare function getReferenceResolvedTypesArtifact(filePath: string, analysisOptions?: AnalysisOptions): Promise; export declare function getReferenceSectionsArtifact(filePath: string, options: { stripInternal: boolean; slugCasing: SlugCasing; }, analysisOptions?: AnalysisOptions): Promise; /** * Resolve all file export types in a single dependency-aware analysis pass. */ export declare function resolveFileExportsWithDependencies(filePath: string, filter?: TypeFilter, analysisOptions?: AnalysisOptions): Promise; /** * Get outlining ranges for a file. */ export declare function getOutlineRanges(filePath: string, analysisOptions?: AnalysisOptions): Promise; /** * Get a specific file export in a source file. */ export declare function getFileExportMetadata(name: string, filePath: string, position: number, kind: SyntaxKind, analysisOptions?: AnalysisOptions): Promise; /** * Attempt to get a statically analyzable literal value for a file export. */ export declare function getFileExportStaticValue(filePath: string, position: number, kind: SyntaxKind, analysisOptions?: AnalysisOptions): Promise; /** * Get a specific file export's text by identifier, optionally including its dependencies. */ export declare function getFileExportText(filePath: string, position: number, kind: SyntaxKind, includeDependencies?: boolean, analysisOptions?: AnalysisOptions): Promise; export declare function createSourceFile(filePath: string, sourceText: string, analysisOptions?: AnalysisOptions): Promise; /** * Transpile a source file. */ export declare function transpileSourceFile(filePath: string, analysisOptions?: AnalysisOptions): Promise; declare function setAnalysisClientRefreshVersionForTests(version: string): void; declare function clearAnalysisClientStateForTests(): void; export declare const __TEST_ONLY__: { clearAnalysisClientRpcState: typeof clearAnalysisClientStateForTests; disposeAnalysisBrowserClient: typeof disposeAnalysisBrowserClient; setAnalysisClientRefreshVersion: typeof setAnalysisClientRefreshVersionForTests; };