import { FileSystem } from '@servicenow/sdk-build-core'; import type { Project } from '../../project'; /** * Represents a .d.now.ts file with its metadata */ export type FileInfo = { scope: string; fileName: string; exportName: string; filePath: string; }; /** * Scans for all .d.now.ts files in the fluent directory * @param fs - File system * @param fluentTypeDir - Root fluent types directory * @returns List of all .d.now.ts files found */ export declare function scanForNowFiles(fs: FileSystem, fluentTypeDir: string): FileInfo[]; /** * Configuration for generating an index file */ export type IndexConfig = { dirName: string; files: FileInfo[]; filesByScope: Map; }; /** * Builds configuration for index file generation * Responsible for data transformation and grouping */ export declare class IndexBuilder { /** * Groups files by their index directory * @param files - List of files to group * @param fluentTypeDir - Root fluent types directory * @returns Map of directory path to files in that directory */ groupFilesByDirectory(files: FileInfo[], fluentTypeDir: string): Map; /** * Builds configuration for a single index file * @param dirPath - Directory where index.ts will be created * @param files - Files to include in the index * @returns Configuration object for index generation */ buildIndexConfig(dirPath: string, files: FileInfo[]): IndexConfig; /** * Groups files by their scope */ private groupFilesByScope; /** * Gets the directory where the index.ts file should be created */ private getIndexDir; } /** * Generates index.ts files using ts-morph * Responsible for code generation only */ export declare class IndexGenerator { private readonly fs; private readonly project; constructor(fs: FileSystem, project: Project); /** * Generates an index.ts file from configuration * @param dirPath - Directory where index.ts should be created * @param config - Configuration for the index file */ generateIndexFile(dirPath: string, config: IndexConfig): void; /** * Adds the header comment to the file */ private addHeader; /** * Adds import statements */ private addImports; /** * Adds the main content (export with scope organization) */ private addContent; /** * Adds the export statement with direct category exports */ private addExport; /** * Converts a string to a valid JavaScript identifier * Replaces hyphens with underscores */ private toValidIdentifier; }