import { type PropertyWebBindings } from '../Bindings.js';
import type { DomainAssociation } from '../DomainAssociation.js';
import type { DomainProperty } from '../DomainProperty.js';
import type { DomainEntity } from '../DomainEntity.js';
import { IApiAnyShape, IApiArrayShape, IApiDataExample, IApiFileShape, IApiNodeShape, IApiPropertyShape, IApiRecursiveShape, IApiScalarShape, IApiShape, IApiUnionShape, IShapeUnion } from '../../amf/definitions/Shapes.js';
import { DataValueGenerator } from '../../amf/DataValueGenerator.js';
import type { PropertySchema } from '../types.js';
/**
 * Serializes Data Domain elements (DomainEntity, DomainProperty, DomainAssociation)
 * to AMF shapes.
 *
 * This class provides a mechanism to translate a data domain model, defined using
 * custom classes like `DomainEntity`, `DomainProperty`, and `DomainAssociation`,
 * into AMF (API Modeling Framework) shapes. AMF shapes are a standardized way
 * to represent API structures and data models, enabling interoperability and tooling.
 *
 * This is particularly useful when you have a custom data model and need to
 * generate API definitions (e.g., RAML or OAS) from it.
 *
 * **Key Features:**
 *
 * - **Data Domain to AMF Translation:** Converts data domain elements into
 *   their corresponding AMF shape representations.
 * - **Recursive Shape Handling:**  Detects and handles recursive relationships
 *   within the data model to prevent infinite loops during shape generation.
 * - **Union Type Support:**  Supports the creation of union types in AMF
 *   to represent associations that can point to multiple different entity types.
 * - **Binding Integration:**  Leverages binding information (e.g., web bindings)
 *   to customize the generated AMF shapes based on the target API format.
 * - **Example and Default Value Generation:**  Integrates with a `DataValueGenerator`
 *   to automatically generate example values and default values for properties
 *   within the AMF shapes.
 *
 * **Usage:**
 *
 * 1. Create an instance of the `ShapeGenerator`.
 * 2. Call the appropriate method (e.g., `entity()`, `property()`, `associationShape()`)
 *    to generate the AMF shape for a specific data domain element.
 * 3. The returned AMF shape can then be used with other AMF tools to generate
 *    API definitions or perform other API-related tasks.
 */
export declare class ShapeGenerator {
    #private;
    /**
     * Used with data domain value generation for entity properties.
     * Lazily loaded class only when functions are used.
     * This needs to be a class instances because some functions are incremental
     */
    get valueGenerator(): DataValueGenerator;
    /**
     * Serializes a `DomainEntity` to an AMF node shape.
     *
     * This method is the entry point for converting a `DomainEntity` into its
     * AMF representation. It handles recursive relationships, property serialization,
     * and inheritance from parent entities.
     *
     * @param input The `DomainEntity` to serialize.
     * @param visited A `Set` of keys of already generated entities. This prevents
     *                recursive shape generation and avoids infinite loops.  Defaults to a new empty `Set`.
     * @returns An `IApiNodeShape` or `IApiRecursiveShape` representing the entity in AMF.
     *          Returns a `IApiRecursiveShape` if a recursive loop is detected.
     * @example
     * ```typescript
     * const generator = new ShapeGenerator();
     * const amfShape = generator.entity(myDomainEntity);
     * ```
     */
    entity(input: DomainEntity, visited?: Set<string>): IApiNodeShape | IApiRecursiveShape;
    /**
     * Serializes a `DomainProperty` to an AMF property shape.
     *
     * This method converts a `DomainProperty` into an `IApiPropertyShape`,
     * defining its characteristics such as data type, required status, and
     * range (the shape of the property's value).
     *
     * @param input The `DomainProperty` to serialize.
     * @returns An `IApiPropertyShape` representing the property in AMF.
     * @example
     * ```typescript
     * const generator = new ShapeGenerator();
     * const amfShape = generator.property(myDomainProperty);
     * ```
     */
    property(input: DomainProperty): IApiPropertyShape;
    /**
     * Serializes a `DomainAssociation` to an AMF property shape, handling the
     * association's target entity or entities.
     *
     * This method is similar to `property()`, but it specifically handles
     * associations between entities. It determines the range of the property
     * based on the association's target(s) and generates the appropriate
     * AMF shape (e.g., a scalar shape for a linked schema, a union shape for
     * multiple targets).
     *
     * @param input The `DomainAssociation` to serialize.
     * @param visited A `Set` of keys of already generated entities. This prevents
     *                recursive shape generation and avoids infinite loops. Defaults to a new empty `Set`.
     * @returns An `IApiPropertyShape` representing the association in AMF.
     * @example
     * ```typescript
     * const generator = new ShapeGenerator();
     * const amfShape = generator.associationProperty(myDomainAssociation);
     * ```
     */
    associationProperty(input: DomainAssociation, visited?: Set<string>): IApiPropertyShape;
    /**
     * Generates a shape for an association. Most likely you want to use the `associationProperty()` method instead.
     *
     * @param input The data association instance.
     * @param visited A `Set` of keys of already generated entities. This prevents
     *                recursive shape generation and avoids infinite loops. Defaults to a new empty `Set`.
     * @returns The range value for the PropertyShape.
     */
    associationShape(input: DomainAssociation, visited?: Set<string>): IShapeUnion | undefined;
    /**
     * @param input The data association instance.
     * @returns An AMF API scalar shape with the link to the schema.
     */
    protected createLinkedShape(input: DomainAssociation): IApiScalarShape;
    protected createUnionShape(input: DomainAssociation, items: IShapeUnion[]): IApiUnionShape | IApiArrayShape;
    /**
     * Generates a shape list for an union. Most likely you want to use the `associationProperty()` method instead.
     *
     * @param input The data association instance.
     * @returns The range value for the PropertyShape.
     */
    associationUnion(input: DomainAssociation, visited?: Set<string>): IShapeUnion | IShapeUnion[] | undefined;
    /**
     * The DomainProperty may have both the `schema` and the `bindings`. For AMF shape we read `schema` for
     * default value, examples, and enum values. We also look for the `web`
     * bindings for more detailed definition of a shape.
     *
     * @param input
     */
    protected getRange(input: DomainProperty): IApiArrayShape | IApiFileShape | IApiScalarShape;
    /**
     * Normally this would be part of generating a scalar schema but the the property is an array this
     * is generated on the array and not on the range.
     *
     * @param result The scalar or array shape.
     * @param schema The property schema
     * @param type The data type of the parent property as set on the `range`
     * @param isArray Whether the DomainProperty is multiple
     */
    protected setShapeSchema(input: DomainProperty, result: IApiAnyShape, schema: PropertySchema, type: string, isArray?: boolean): void;
    protected createArrayShape(input: DomainProperty, schema?: PropertySchema, bindings?: PropertyWebBindings): IApiArrayShape;
    protected createScalarShape(input: DomainProperty, schema?: PropertySchema, bindings?: PropertyWebBindings): IApiScalarShape;
    protected createExamples(examples: string[], type: string): IApiDataExample[];
    protected createArrayExamples(examples: string[], type: string): IApiDataExample[];
    protected createFileShape(input: DomainProperty, bindings?: PropertyWebBindings): IApiFileShape;
    protected setScalarCommonProperties(result: IApiFileShape | IApiScalarShape, input: DomainProperty, bindings?: PropertyWebBindings): void;
    protected updateBaseProperties(input: DomainProperty | DomainAssociation | DomainEntity, target: IApiShape): void;
    protected createRecursiveShape(input: DomainEntity): IApiRecursiveShape;
    /**
     * Translates the shape to an array shape. This happens when data model property
     * is changed from 'multiple' to not-multiple and back.
     *
     * @param id The key of the parameter or an association
     * @param shape The shape to wrap as an array.
     * @returns Array shape.
     */
    protected refactorShapeToArray(id: string, shape: IShapeUnion): IApiArrayShape;
}
//# sourceMappingURL=ShapeGenerator.d.ts.map