import ProjectFileSystem from '../commons/ProjectFileSystem'; import ItemReader from './ItemReader'; import ProjectEntityReader, { ProjectEntityMatchConditions, ProjectEntityReaderReadOptions } from '../project-api/ProjectEntityReader'; import ModuleData from './ModuleData'; import { ModuleType } from '../definitions/ModuleType'; import { DetectionMechanism } from './PluginEntryTypes'; import { KeyIn } from '../util/Types'; import { ProjectType } from '../definitions/ProjectType'; import ProjectContext from './ProjectContext'; export interface ModuleReaderOptions { fs: ProjectFileSystem; } export interface ModuleEntry { fs: ProjectFileSystem; pattern: string[]; type: string; } /** * Read modules and its entities * * There are two ways to implement a ModuleReader: * 1. Read complete module and entities in one call --> re-implement read() * 2. Read module header and entities separately --> re-implement readModule() * * In both cases entityReaders() should return the entity readers with the super set of their handled types and tags and * the relevant file pattern to recognize changes. This is relevant to have a fast project update in BAS. */ export declare abstract class ModuleReader implements ProjectEntityReader { static readonly type = "sap.project.plugin.type.module-reader"; moduleType: string | undefined; readonly matchConditions: ProjectEntityMatchConditions; itemReaders: ItemReader[]; supportedProjectType?: KeyIn[]; abstract getType(): KeyIn; abstract getDetectionMechanism(): DetectionMechanism; /** * * @param fs * * Prepare for reading items in this module. It can be use to return a context object for itemReader. */ prepareItemReaderContext?(fs: ProjectFileSystem, context: ProjectContext): Promise; tags: string[]; /** * * @param fs * * Read module header information (without entities). * * Re-implement this method if the module header and its entities should be read separately. */ read(options: ProjectEntityReaderReadOptions): Promise; }