import { IThing, Thing } from '../../models/Thing.js';
import { DataNamespace } from './DataNamespace.js';
import { IApiPropertyShape } from '../../amf/definitions/Shapes.js';
import { PropertyBinding, PropertyBindings, PropertyWebBindings } from '../Bindings.js';
import { DataPropertyKind } from '../../models/kinds.js';
import { type DataPropertyAttribute, type DataPropertyFormat, type DataPropertyType } from '../DataFormat.js';
import type { DataEntity } from './DataEntity.js';
/**
 * Describes the default value set on a property schema.
 * @deprecated
 */
export interface SchemaDefaultValue {
    /**
     * The type of the default value.
     *
     * - `literal` The `value` should be used as-is.
     * - `function` The value represents the name of the function to be used.
     */
    type: 'literal' | 'function';
    /**
     * The actual value type depends on the `type`.
     * It is always a string and it has to be casted to the property's data type.
     */
    value: string;
}
/**
 * A general schema definition for a property.
 * This is propagated to all bindings (when they support these properties).
 * @deprecated
 */
export interface DataPropertySchema {
    /**
     * The minimum value of the property.
     *
     * By default it is inclusive value. Use the `exclusiveMinimum` property to make it exclusive.
     *
     * Used with:
     * - string
     * - number
     * - date
     * - time
     * - datetime
     */
    minimum?: number;
    /**
     * The maximum value of the property.
     *
     * By default it is inclusive value. Use the `exclusiveMaximum` property to make it exclusive.
     *
     * Used with:
     * - string
     * - number
     * - date
     * - time
     * - datetime
     */
    maximum?: number;
    /**
     * When set, the minimum value is exclusive.
     *
     * - When `false`: value ≥ minimum.
     * - When `true`: value > minimum.
     */
    exclusiveMinimum?: boolean;
    /**
     * When set, the exclusiveMaximum value is exclusive.
     *
     * - When `false`: value ≤ maximum.
     * - When `true`: value < minimum.
     */
    exclusiveMaximum?: boolean;
    /**
     * The multiplier value for a number scalar.
     *
     * Examples:
     * - if `1` then every integer is allowed
     * - if `2` than every even number is allowed
     * - if `0.5` than every number dividable by `0.5` is allowed
     */
    multipleOf?: number;
    /**
     * The enum values for the property.
     * They are always encoded as strings. The actual type is defined in the `dataType` property.
     */
    enum?: string[];
    /**
     * The default value for the property.
     * This is always encoded as a string. The actual type is defined in the `dataType` property.
     */
    defaultValue?: SchemaDefaultValue;
    /**
     * The example values for the property.
     * They are always encoded as strings. The actual type is defined in the `dataType` property.
     */
    examples?: string[];
}
/**
 * @deprecated
 */
export interface IDataProperty {
    kind: typeof DataPropertyKind;
    /**
     * The key of the namespace.
     */
    key: string;
    /**
     * The data property description.
     */
    info: IThing;
    /**
     * Wether the data property is required.
     */
    required?: boolean;
    /**
     * Whether the data property allows multiple items.
     */
    multiple?: boolean;
    /**
     * Whether this property describes a primary key of the entity.
     */
    primary?: boolean;
    /**
     * Whether this property describes an indexed property of the entity.
     */
    index?: boolean;
    /**
     * Whether the property is read only in the schema.
     */
    readOnly?: boolean;
    /**
     * Whether the property is write only in the schema.
     */
    writeOnly?: boolean;
    /**
     * Whether this property is deprecated.
     */
    deprecated?: boolean;
    /**
     * Optional general purpose tags for the UI.
     */
    tags?: string[];
    /**
     * For future use.
     *
     * The keys of the taxonomy items associated with the property.
     */
    taxonomy?: string[];
    /**
     * The data type for this property.
     * Note, not all schemas support the same type. For example, defining `sint32`
     * works for protocol buffers, but does not for JSON. In such case we use default
     * translation `sint32` -> `number`. Another way it to create
     * a derivative entity for specific schema to describe specific schema case.
     */
    type: DataPropertyType;
    /**
     * The general schema definition of this property.
     * This is propagated to all bindings (when they support these properties).
     */
    schema?: DataPropertySchema;
    /**
     * The list of bindings for this property.
     *
     * A binding defines a translation from a data model to a specific format.
     * For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs
     * or a protocol buffer schema.
     */
    bindings?: PropertyBinding[];
}
/**
 * @deprecated
 */
export declare class DataProperty {
    root: DataNamespace;
    kind: string;
    key: string;
    /**
     * The description of the data namespace.
     */
    info: Thing;
    /**
     * Wether the data property is required.
     */
    required?: boolean;
    /**
     * Whether the data property allows multiple items.
     */
    multiple?: boolean;
    /**
     * Whether this property describes a primary key of the entity.
     */
    primary?: boolean;
    /**
     * Whether this property describes an indexed property of the entity.
     */
    index?: boolean;
    /**
     * Whether the property is read only in the schema.
     */
    readOnly?: boolean;
    /**
     * Whether the property is write only in the schema.
     */
    writeOnly?: boolean;
    /**
     * Whether this property is deprecated.
     */
    deprecated?: boolean;
    /**
     * Optional general purpose tags for the UI.
     *
     * Note to implementations, use the `addTag()` method as it propagates the "tag" value in the namespace.
     */
    tags: string[];
    /**
     * Reserved for future use.
     *
     * The keys of the taxonomy items associated with the property.
     */
    taxonomy: string[];
    /**
     * The data type for this property.
     * Note, not all schemas support the same type. For example, defining `sint32`
     * works for protocol buffers but does not for JSON. In such case we use default
     * translation `sint32` -> `number`. Another way it to create
     * a derivative entity for specific schema to describe specific schema case.
     */
    type: DataPropertyType;
    /**
     * The general schema definition of this property.
     * This is propagated to all bindings (when they support these properties).
     */
    schema?: DataPropertySchema;
    /**
     * The list of bindings for this property.
     *
     * A binding defines a translation from a data model to a specific format.
     * For example allows to define properties required to generate AMF shape and therefore RAML/OAS shapes for web APIs
     * or a protocol buffer schema.
     */
    bindings: PropertyBinding[];
    /**
     * @deprecated Use the direct import of types.
     */
    static get supportedTypes(): DataPropertyType[];
    static fromName(root: DataNamespace, name: string): DataProperty;
    static fromType(root: DataNamespace, type: DataPropertyType): DataProperty;
    /**
     * @param input The data property definition to restore.
     */
    constructor(root: DataNamespace, input?: string | IDataProperty);
    new(init: IDataProperty): void;
    static isDataProperty(input: unknown): boolean;
    toJSON(): IDataProperty;
    /**
     * Removes self from the parent entity and the namespace definition.
     */
    remove(): void;
    /**
     * Adds a new tag to the property. It also populates the root namespace's tags when tag is new.
     *
     * Note, it does nothing when the tag is already defined.
     *
     * @param tag The tag to add.
     */
    addTag(tag: string): void;
    /**
     * Removes a tag from the property. Unlike the `addTag()` this won't remove a `tag` from the root namespace.
     *
     * @param tag The tag to remove.
     */
    removeTag(tag: string): void;
    /**
     * Creates a Property Shape of AMF.
     * The property itself is auto-generated. If the `schema` is defined then it is used
     * as the `range` of the property. Otherwise basic shape is generated for the range.
     *
     * This is a preferred way of reading the AMF shape as this synchronizes changed
     * data properties with the shape definition.
     *
     * @returns AMF property shape definition.
     */
    toApiShape(): IApiPropertyShape;
    /**
     * Checks whether the passed value is one of the supported data types.
     * @param value The value to test
     * @returns True when the passed value is one of the supported data types.
     */
    static isValidType(value: unknown): value is DataPropertyType;
    /**
     * Checks whether the passed value is one of the supported data property attributes.
     * @param value The value to test
     * @returns True when the passed value is one of the supported data property attributes.
     */
    static isValidAttribute(value: unknown): value is DataPropertyAttribute;
    /**
     * Checks whether the passed value of one of the supported `format` values.
     *
     * @param value The value to test
     * @returns `true` when the value is one of the supported `format` values.
     */
    static isValidFormat(value: unknown): value is DataPropertyFormat;
    /**
     * Creates the `schema` object if missing and returns it.
     * @returns The schema object.
     */
    ensureSchema(): DataPropertySchema;
    /**
     * Creates if not existing and returns web bindings definition.
     * @returns The web binding definition
     */
    getWebBinding(): PropertyWebBindings;
    /**
     * Returns the schema value of the binding, if any was created.
     * @param type The type of the binding to read.
     * @returns The binding schema, if any
     */
    readBinding(type: 'web' | 'protobuf'): PropertyBindings | undefined;
    /**
     * Returns a parent data entity where this data property exist.
     */
    getParentInstance(): DataEntity | undefined;
    /**
     * Checks whether the property is a child of the given namespace, data model, or an entity.
     * The relationship doesn't have to be direct, as long as the property is in the hierarchy it will return true.
     *
     * @param key The key of the parent to check.
     * @returns True if this data property is a child of the given namespace, data model, or an entity
     */
    isChildOf(key: string): boolean;
}
//# sourceMappingURL=DataProperty.d.ts.map