import type { Definition } from 'typescript-json-schema';
import type { ConvertedMetadata, EntitySet, EntityType } from '@sap-ux/vocabularies-types';
import type { Editor } from 'mem-fs-editor';
import type { CustomAction as FPMCustomAction, ActionMenu as FPMActionMenu, CustomFilter as FPMCustomFilter, CustomHeaderSection as FPMCustomHeaderSection, CustomPage as FPMCustomPage, CustomSection as FPMCustomSection, CustomSubSection as FPMCustomSubSection, CustomTableColumn as FPMCustomTableColumn, CustomView as FPMCustomView, ControllerExtension as FPMControllerExtension, ListReport as FPMListReport, ObjectPage as FPMObjectPage, CustomField as FPMCustomField, PromptsAPI, PromptsType } from '@sap-ux/fe-fpm-writer';
import type { FioriElementsVersion, Manifest, v2, v4, File, OdataVersion } from '.';
import type { ApplicationModel } from './parser';
import type { SchemaType, FileData, FlexChangeLayer, ExportResults } from './common/types';
import type { ApplicationAccess } from '@sap-ux/project-access';
export type { ControllerExtensionPageType, TargetControl as CustomActionTargetControl } from '@sap-ux/fe-fpm-writer';
export type MessageMetadataType = (object | string | number)[];
export declare const enum LogSeverity {
    Error = "error",
    Warning = "warning",
    Info = "info"
}
export declare const logSeverityLabel: {
    error: string;
    warning: string;
    info: string;
};
export type LogMessage = string | object | undefined;
export type ConfigEntityPath = Array<string | number>;
export interface RangePosition {
    line: number;
    character: number;
}
export interface Range {
    start: RangePosition;
    end: RangePosition;
}
export interface Location {
    path: string;
    range?: Range | string[];
}
/**
 * Interface used to define a logger for the specificaton API
 */
export interface ExtensionLogger {
    info: (message: string, ...meta: MessageMetadataType) => void;
    warning: (message: string, ...meta: MessageMetadataType) => void;
    error: (message: string, ...meta: MessageMetadataType) => void;
    reset: () => void;
}
/*********************************************************************
 * Types for app schema generation
 *********************************************************************/
/**
 * Enum representing the types of messages that can be associated with a property.
 *
 * @enum {string}
 * @property Error - Represents an error message type.
 * @property Warning - Represents a warning message type.
 * @property Info - Represents an informational message type.
 */
export declare enum PropertyMessageType {
    Error = "error",
    Warning = "warning",
    Info = "info"
}
/**
 * Instances of this type might be added (as array) to property 'messages' of a schema property in order to indicate that there are issues with this property.
 *
 * @property type - The type of message, indicating its severity (error, warning, info).
 * @property text - The message text providing details about the issue.
 */
export interface PropertyMessage {
    type?: PropertyMessageType;
    text: string;
}
/**
 * Types for V2 schema generation
 */
export type GenerateListReportV2 = {
    [SchemaType.ListReport]: {
        genericSchema: object;
        entitySet: string;
        annotations: FileData[];
        manifest: Manifest;
        fragments: FileData[];
        flex?: string[];
        logger?: ExtensionLogger;
    };
};
export type GenerateObjectPageV2 = {
    [SchemaType.ObjectPage]: {
        genericSchema: object;
        entitySet: string;
        annotations: FileData[];
        manifest: Manifest;
        fragments: FileData[];
        flex?: string[];
        logger?: ExtensionLogger;
    };
};
export type GenerateOverviewPageV2 = {
    [SchemaType.OverviewPage]: {
        genericSchema: object;
        logger?: ExtensionLogger;
    };
};
export type GenerateAnalyticalListPageV2 = {
    [SchemaType.AnalyticalListPage]: {
        genericSchema: object;
        entitySet: string;
        annotations: object[];
        manifest: Manifest;
        fragments: FileData[];
        flex?: string[];
        logger?: ExtensionLogger;
    };
};
export type GenerateSchemaV2Type = GenerateListReportV2 | GenerateObjectPageV2 | GenerateOverviewPageV2 | GenerateAnalyticalListPageV2;
export interface GenerateSchemaV2 {
    [FioriElementsVersion.v2]: GenerateSchemaV2Type;
}
/**
 * Types for V4 schema generation
 */
export type GenerateListReportV4 = {
    [SchemaType.ListReport]: {
        genericSchema: object;
        entitySet?: string;
        contextPath?: string;
        annotations: FileData[];
        logger?: ExtensionLogger;
        manifest?: Manifest;
    };
};
export type GenerateObjectPageV4 = {
    [SchemaType.ObjectPage]: {
        genericSchema: object;
        entitySet?: string;
        contextPath?: string;
        annotations: FileData[];
        manifest: Manifest;
        logger?: ExtensionLogger;
        genericMacrosSchema?: object;
        fragments?: FileData[];
    };
};
export type GenerateAnalyticalListPageV4 = {
    [SchemaType.AnalyticalListPage]: {
        genericSchema: object;
        entitySet?: string;
        contextPath?: string;
        annotations: FileData[];
        logger?: ExtensionLogger;
        manifest?: Manifest;
    };
};
export type GenerateFreestylePageV4 = {
    [SchemaType.FreestylePage]: {
        genericSchema: object;
        annotations: FileData[];
        manifest: Manifest;
        logger?: ExtensionLogger;
    };
};
export type GenerateFPMPageV4 = {
    [SchemaType.FPMCustomPage]: {
        genericSchema: object;
        views: FileData[];
        manifest: Manifest;
        routingId: string;
        annotations: FileData[];
        logger?: ExtensionLogger;
    };
};
export type GenerateSchemaV4Type = GenerateListReportV4 | GenerateObjectPageV4 | GenerateAnalyticalListPageV4 | GenerateFreestylePageV4 | GenerateFPMPageV4;
export interface GenerateSchemaV4 {
    [FioriElementsVersion.v4]: GenerateSchemaV4Type;
}
/**
 * Union type for schema generation
 */
export type GenerateSchemaParameters = SyncBaseParameters & (GenerateSchemaV2 | GenerateSchemaV4);
/*********************************************************************
 * Types for export of config
 *********************************************************************/
/**
 * Types for v2 export
 */
export type ExportObjectPageV2Parameters = {
    appId: string;
    page: v2.Page;
    manifest: Manifest;
    jsonSchema: object;
    fragments?: FileData[];
    views?: FileData[];
    logger?: ExtensionLogger;
};
export type ExportObjectPageV2 = {
    [SchemaType.ObjectPage]: ExportObjectPageV2Parameters;
};
export type ExportObjectPageV2WithPathParameters = ExportObjectPageV2Parameters & {
    entityPath: ConfigEntityPath;
};
export type ExportObjectPageWithPathV2 = {
    [SchemaType.ObjectPage]: ExportObjectPageV2WithPathParameters;
};
export type ExportListReportV2Parameters = ExportObjectPageV2Parameters;
export type ExportListReportV2 = {
    [SchemaType.ListReport]: ExportListReportV2Parameters;
};
export type ExportListReportWithPathV2Parameters = ExportListReportV2Parameters & {
    entityPath: ConfigEntityPath;
};
export type ExportListReportWithPathV2 = {
    [SchemaType.ListReport]: ExportListReportWithPathV2Parameters;
};
export type ExportAnalyticalListPageV2Parameters = ExportListReportV2Parameters;
export type ExportAnalyticalListPageV2 = {
    [SchemaType.AnalyticalListPage]: ExportAnalyticalListPageV2Parameters;
};
export type ExportALPWithPathV2Parameters = ExportAnalyticalListPageV2Parameters & {
    entityPath: ConfigEntityPath;
};
export type ExportALPWithPathV2 = {
    [SchemaType.AnalyticalListPage]: ExportALPWithPathV2Parameters;
};
export type ExportOverviewPageV2Parameters = {
    page: v2.Page;
    manifest: object;
    jsonSchema: object;
    logger?: ExtensionLogger;
};
export type ExportOverviewPageV2 = {
    [SchemaType.OverviewPage]: ExportOverviewPageV2Parameters;
};
export type ExportOVPWithPathParameters = ExportOverviewPageV2Parameters & {
    entityPath: ConfigEntityPath;
};
export type ExportOVPWithPathV2 = {
    [SchemaType.OverviewPage]: ExportOVPWithPathParameters;
};
export type ExportAppV2 = {
    [SchemaType.Application]: {
        application: v2.ApplicationV2;
        manifest: Manifest;
        jsonSchema: object;
        logger?: ExtensionLogger;
    };
};
export type ExportPageUnitionType = ExportALPWithPathV2Parameters | ExportAnalyticalListPageV2Parameters | ExportListReportV2Parameters | ExportListReportWithPathV2Parameters | ExportObjectPageV2WithPathParameters | ExportObjectPageV2Parameters;
/**
 * Types for v4 export
 */
export type ExportListReportV4Parameters = {
    appId: string;
    page: v4.PageV4;
    manifest: Manifest;
    jsonSchema: object;
    logger?: ExtensionLogger;
    appRootPath?: string;
};
export type ExportListReportV4 = {
    [SchemaType.ListReport]: ExportListReportV4Parameters;
};
export type ExportListReportV4WithPathParameters = ExportListReportV4Parameters & {
    entityPath: ConfigEntityPath;
};
export type ExportListReportWithPathV4 = {
    [SchemaType.ListReport]: ExportListReportV4WithPathParameters;
};
export type ExportAnalyticalListPageV4Parameters = ExportListReportV4Parameters;
export type ExportALPVWithPath4Parameters = ExportAnalyticalListPageV4Parameters & {
    entityPath: ConfigEntityPath;
};
export type ExportAnalyticalListPageV4 = {
    [SchemaType.AnalyticalListPage]: ExportAnalyticalListPageV4Parameters;
};
export type ExportALPWithPathV4 = {
    [SchemaType.AnalyticalListPage]: ExportALPVWithPath4Parameters;
};
export type ExportObjectPageV4Parameters = {
    appId: string;
    page: v4.Page;
    manifest: Manifest;
    jsonSchema: object;
    fragments?: FileData[];
    logger?: ExtensionLogger;
    appRootPath?: string;
};
export type ExportObjectPageWithPathV4Parameters = ExportObjectPageV4Parameters & {
    entityPath: ConfigEntityPath;
};
export type ExportObjectPageV4 = {
    [SchemaType.ObjectPage]: ExportObjectPageV4Parameters;
};
export type ExportObjectPageWithPathV4 = {
    [SchemaType.ObjectPage]: ExportObjectPageWithPathV4Parameters;
};
export type ExportFPMCustomPageV4Parameters = {
    appId: string;
    page: v4.Page;
    manifest: Manifest;
    jsonSchema: object;
    fragments: FileData[];
    views: FileData[];
    logger?: ExtensionLogger;
    appRootPath?: string;
};
export type ExportFPMCustomPageWithPathV4Parameters = ExportFPMCustomPageV4Parameters & {
    entityPath: ConfigEntityPath;
};
export type ExportFPMCustomPageV4 = {
    [SchemaType.FPMCustomPage]: ExportFPMCustomPageV4Parameters;
};
export type ExportFPMCustomPageWithPathV4 = {
    [SchemaType.FPMCustomPage]: ExportFPMCustomPageWithPathV4Parameters;
};
export type ExportAppV4 = {
    [SchemaType.Application]: {
        application: v4.ApplicationV4;
        manifest: Manifest;
        jsonSchema: object;
        logger?: ExtensionLogger;
    };
};
export type ExportParametersV4Type = ExportListReportV4 | ExportObjectPageV4 | ExportAppV4 | ExportAnalyticalListPageV4 | ExportFPMCustomPageV4;
export interface ExportParametersV4 {
    [FioriElementsVersion.v4]: ExportParametersV4Type;
}
export type ExportParametersWithPathV4Type = ExportListReportWithPathV4 | ExportObjectPageWithPathV4 | ExportALPWithPathV4 | ExportFPMCustomPageWithPathV4;
export interface ExportV4WithPath {
    [FioriElementsVersion.v4]: ExportParametersWithPathV4Type;
}
export interface UI5Version {
    ui5Version?: string;
    layer?: FlexChangeLayer;
}
export type ExportParametersV2Type = ExportListReportV2 | ExportObjectPageV2 | ExportOverviewPageV2 | ExportAppV2 | ExportAnalyticalListPageV2;
export type ExportV2WithPathType = ExportListReportWithPathV2 | ExportObjectPageWithPathV2 | ExportOVPWithPathV2 | ExportALPWithPathV2;
export interface ExportParametersV2 {
    [FioriElementsVersion.v2]: ExportParametersV2Type;
}
export interface ExportV2WithPath {
    [FioriElementsVersion.v2]: ExportV2WithPathType;
}
/**
 * Union types for export
 */
export type ExportConfigParameters = UI5Version & SyncBaseParameters & (ExportParametersV2 | ExportParametersV4);
export type ExportConfigWithPath = UI5Version & SyncBaseParameters & (ExportV2WithPath | ExportV4WithPath);
/*********************************************************************
 * Types for import, creation of config
 *********************************************************************/
export type CommonImportParameters = {
    manifest: Manifest;
    flex: string[];
    jsonSchema: object;
    fragments?: FileData[];
    logger?: ExtensionLogger;
    entitySet: string;
};
/**
 * Types for v2 import
 */
export type ImportListReportV2Parameters = CommonImportParameters;
export type ImportListReportV2 = {
    [SchemaType.ListReport]: ImportListReportV2Parameters;
};
export type ImportObjectPageV2Parameters = CommonImportParameters;
export type ImportObjectPageV2 = {
    [SchemaType.ObjectPage]: ImportObjectPageV2Parameters;
};
export type ImportOverviewPageV2Parameters = {
    manifest: Manifest;
    jsonSchema: object;
    logger?: ExtensionLogger;
};
export type ImportOverviewPageV2 = {
    [SchemaType.OverviewPage]: ImportOverviewPageV2Parameters;
};
export type ImportALPV2Parameters = CommonImportParameters;
export type ImportAnalyticalListPageV2 = {
    [SchemaType.AnalyticalListPage]: ImportALPV2Parameters;
};
/**
 * Types for v4 import
 */
export type ImportListReportV4Parameters = {
    manifest: Manifest;
    jsonSchema: Definition;
    routingId: string;
    logger?: ExtensionLogger;
};
export type ImportListReportV4 = {
    [SchemaType.ListReport]: ImportListReportV4Parameters;
};
export type ImportObjectPageV4Parameters = {
    manifest: Manifest;
    jsonSchema: Definition;
    routingId: string;
    logger?: ExtensionLogger;
    fragments?: FileData[];
};
export type ImportObjectPageV4 = {
    [SchemaType.ObjectPage]: ImportObjectPageV4Parameters;
};
export type ImportAnalyticalListPageV4Parameters = ImportListReportV4Parameters;
export type ImportAnalyticalListPageV4 = {
    [SchemaType.AnalyticalListPage]: ImportAnalyticalListPageV4Parameters;
};
export type ImportFPMCustomPageV4Parameters = {
    manifest: Manifest;
    jsonSchema: Definition;
    routingId: string;
    fragments: FileData[];
    views: FileData[];
    logger?: ExtensionLogger;
};
export type ImportFPMCustomPageV4 = {
    [SchemaType.FPMCustomPage]: ImportFPMCustomPageV4Parameters;
};
export type ImportParametersV4Type = ImportListReportV4 | ImportObjectPageV4 | ImportAnalyticalListPageV4 | ImportFPMCustomPageV4;
export interface ImportParametersV4 {
    [FioriElementsVersion.v4]: ImportParametersV4Type;
}
export type ImportParametersV2Type = ImportListReportV2 | ImportObjectPageV2 | ImportOverviewPageV2 | ImportAnalyticalListPageV2;
export interface ImportParametersV2 {
    [FioriElementsVersion.v2]: ImportParametersV2Type;
}
export type ImportResultsV2 = v2.ListReportConfigV2 | v2.ObjectPageConfigV2 | v2.OverviewPageConfigV2 | v2.AnalyticalListPageConfigV2;
export type ImportResultsV4 = v4.ListReportConfigV4 | v4.ObjectPageConfigV4;
export type ImportConfigParameters = SyncBaseParameters & (ImportParametersV2 | ImportParametersV4);
export interface Schemas {
    [type: string]: object;
}
export interface ExtensionFiles {
    views: FileData[];
    fragments: FileData[];
}
export type ImportAllConfigsParameters = {
    manifest: Manifest;
    appSchemas: Schemas;
    templateType: TemplateType;
    serviceAVT: ConvertedMetadata;
    logger?: ExtensionLogger;
    flexChanges?: string[];
    fragments?: FileData[];
    views?: FileData[];
    fioriElementsVersion?: FioriElementsVersion;
    oDataVersion?: OdataVersion;
};
export type ImportResults = ImportResultsV2 | ImportResultsV4;
/**
 * Types for project import
 */
export interface ImportProjectParameters extends SyncBaseParameters {
    manifest: Manifest;
    annotations: FileData[];
    flex?: string[];
    fragments?: FileData[];
    views?: FileData[];
    logger?: ExtensionLogger;
}
export declare enum TemplateType {
    ListReportObjectPageV2 = "ListReportObjectPageV2",
    ListReportObjectPageV4 = "ListReportObjectPageV4",
    OverviewPageV2 = "OverviewPageV2",
    AnalyticalListPageV2 = "AnalyticalListPageV2",
    AnalyticalListPageV4 = "AnalyticalListPageV4",
    FreestylePageV4 = "FreestylePageV4"
}
export interface GenerateAppSchemaParameters extends SyncBaseParameters {
    templateType: TemplateType;
    manifest: Manifest;
    flex?: string[];
    serviceAVT: ConvertedMetadata;
    fioriElementsVersion: FioriElementsVersion;
    entitySet?: EntitySet;
    fragments?: FileData[];
    views?: FileData[];
    logger?: ExtensionLogger;
    entityType?: EntityType;
}
export declare enum CustomExtensionType {
    ControllerExtension = "ControllerExtension",
    CustomAction = "CustomAction",
    ActionMenu = "ActionMenu",
    CustomColumn = "CustomColumn",
    CustomFilterField = "CustomFilterField",
    CustomHeaderSection = "CustomHeaderSection",
    CustomPage = "CustomPage",
    CustomSection = "CustomSection",
    CustomSubSection = "CustomSubSection",
    CustomView = "CustomView",
    ListReport = "ListReport",
    ObjectPage = "ObjectPage",
    CustomField = "CustomField",
    CustomSectionV2 = "CustomSectionV2"
}
export interface GenerateCustomExtensionParams {
    customExtension: CustomExtensionType;
    basePath: string;
    data: CustomExtensionData;
    fsEditor?: Editor;
}
export interface CustomSectionV2 {
    minUI5Version?: string;
    name: string;
    isFragment: boolean;
    namespace: string;
    folders: {
        extFolder: string;
        targetFolder: string;
    };
}
export type CustomExtensionData = FPMControllerExtension | FPMCustomAction | FPMActionMenu | FPMCustomHeaderSection | FPMCustomFilter | FPMCustomPage | FPMCustomSection | FPMCustomSubSection | FPMCustomTableColumn | FPMCustomView | FPMListReport | FPMObjectPage | FPMCustomField | CustomSectionV2;
/**
 * API Version
 */
export interface ApiVersion {
    version?: string;
    fpmWriter?: string;
    moduleVersion?: string;
}
/**
 * API Feature toggles
 */
export declare enum Features {
    BuildingBlocks = "BuildingBlocks"
}
export type FeatureToggle = Features | string;
export interface SyncBaseParameters {
    featureToggles?: FeatureToggle[];
}
export interface ReadAppParams {
    /**
     * Path to application of instance of application access.
     */
    app: string | ApplicationAccess;
    /**
     * Instance of mem-fs.
     */
    fs?: Editor;
    /**
     * Instance of external extension logger.
     */
    logger?: ExtensionLogger;
    /**
     * Parse application and pages JSON schemas to tree structure model.
     *
     * @default false
     */
    skipParsing?: boolean;
}
export interface ReadAppResult {
    /**
     * Virtual files generated for the application.
     */
    files: File[];
    /**
     * Specification API version.
     */
    version: ApiVersion;
    /**
     * Instance of application access.
     */
    appAccess: ApplicationAccess;
    /**
     * Application model
     */
    applicationModel?: ApplicationModel;
}
/**
 * API interface
 */
export interface Specification {
    getGenericSchema: (version: FioriElementsVersion, schemaType: SchemaType) => Promise<JSON>;
    generateSchema: (params: GenerateSchemaParameters) => object;
    exportConfig: (params: ExportConfigParameters) => ExportResults;
    exportConfigEntityByPath: (params: ExportConfigWithPath) => ExportResults;
    deleteConfigEntityByPath: (params: ExportConfigWithPath) => ExportResults;
    importConfig: (params: ImportConfigParameters) => ImportResults;
    importProject: (params: ImportProjectParameters) => Promise<File[]>;
    getApiVersion: () => ApiVersion;
    importProjectSchema: (params: ImportProjectParameters) => Promise<File[]>;
    generateCustomExtension: (params: GenerateCustomExtensionParams) => Promise<Editor | undefined>;
    prompts: {
        api: PromptsAPI;
        types: PromptsType;
    };
    readApp: (options?: ReadAppParams) => Promise<ReadAppResult>;
}
//# sourceMappingURL=apiTypes.d.ts.map