import { PageFileStructure, AppSchema, Page, DataSource } from "@kottster/common"; /** * Service for reading files */ export declare class FileReader { private readonly isDevelopment?; constructor(isDevelopment?: boolean | undefined); /** * Read the schema from the kottster-app.json file */ readAppSchema(): AppSchema; /** * Read the package.json file * @returns The package.json content */ readPackageJson(): { version?: string; dependencies?: Record; }; /** * Get existing page directories * @returns The page directories */ getPagesDirectories(): string[]; /** * Get existing data source directories * @returns The data source directories */ getDataSourceDirectories(): string[]; /** * Get existing data source configs * @returns The data source configs */ getDataSourceConfigs(): Omit[]; /** * Get existing page configs * @returns The page configs */ getPageConfigs(): Page[]; /** * Get page structure * @param pageKey The page ID * @returns The page structure or null if the page does not exist */ getPageFileStructure(pageKey: string): PageFileStructure | null; /** * Get all file paths in a directory * @param dirPath The directory path * @returns The file paths */ private getAllFilePathsInDirectory; /** * Get file by path * @param absoluteFilePath The absolute file path * @returns The file object */ private getFileByPath; /** * Get existing subdirectories in the directory * @param directory The directory * @returns The subdirectories in the directory */ private getDirectorySubdirectories; /** * Check all pages for having index.jsx/tsx and api.server.js/ts files */ checkFilesForPages(): { pagesWithDefinedIndexJsxFile: string[]; pagesWithDefinedApiServerJsFile: string[]; }; }