/** * Pure formatters for the startup "loaded resources" listing and diagnostics. * * Every function here reads only its arguments (paths, source metadata, diagnostics) * and returns strings/data; none touch UI components, session state, or `this`. * `showLoadedResources` and other stateful display code in interactive-mode delegate * to these so the presentation math is unit-testable in isolation. */ import type { ResourceDiagnostic } from "../../core/resource-loader.ts"; import type { SourceInfo } from "../../core/source-info.ts"; export declare function formatDisplayPath(p: string): string; export declare function formatExtensionDisplayPath(p: string): string; export declare function isPackageSource(sourceInfo?: SourceInfo): boolean; /** * Get a short path relative to the package root for display. */ export declare function getShortPath(fullPath: string, sourceInfo?: SourceInfo): string; export declare function getCompactPathLabel(resourcePath: string, sourceInfo?: SourceInfo): string; export declare function getCompactPackageSourceLabel(sourceInfo?: SourceInfo): string; export declare function getCompactExtensionLabel(resourcePath: string, sourceInfo?: SourceInfo): string; export declare function getCompactDisplayPathSegments(resourcePath: string): string[]; export declare function getCompactNonPackageExtensionLabel(resourcePath: string, index: number, allPaths: Array<{ path: string; segments: string[]; }>): string; export declare function getCompactExtensionLabels(extensions: Array<{ path: string; sourceInfo?: SourceInfo; }>): string[]; export declare function getDisplaySourceInfo(sourceInfo?: SourceInfo): { label: string; scopeLabel?: string; color: "accent" | "muted"; }; export declare function getScopeGroup(sourceInfo?: SourceInfo): "user" | "project" | "path"; export declare function buildScopeGroups(items: Array<{ path: string; sourceInfo?: SourceInfo; }>): Array<{ scope: "user" | "project" | "path"; paths: Array<{ path: string; sourceInfo?: SourceInfo; }>; packages: Map>; }>; export declare function formatScopeGroups(groups: Array<{ scope: "user" | "project" | "path"; paths: Array<{ path: string; sourceInfo?: SourceInfo; }>; packages: Map>; }>, options: { formatPath: (item: { path: string; sourceInfo?: SourceInfo; }) => string; formatPackagePath: (item: { path: string; sourceInfo?: SourceInfo; }, source: string) => string; }): string; export declare function findSourceInfoForPath(p: string, sourceInfos: Map): SourceInfo | undefined; export declare function formatPathWithSource(p: string, sourceInfo?: SourceInfo): string; export declare function formatDiagnostics(diagnostics: readonly ResourceDiagnostic[], sourceInfos: Map): string; //# sourceMappingURL=resource-display.d.ts.map