import { Property, IProperty, PropertyType } from './Property.js';
export declare const Kind = "Core#ProjectSchema";
export interface IProjectSchema {
    kind?: typeof Kind;
    /**
     * The identifier of the environment.
     */
    key: string;
    /**
     * The name of the schema.
     */
    name: string;
    /**
     * The optional list of properties in this schema.
     * Because this is a list instead of a map it is possible to duplicate the property name. In this
     * case the last set value is the final value.
     *
     * When both the `properties` and the `content` is defined, `content` is used instead of properties.
     */
    properties?: IProperty[];
    /**
     * The "raw" content of the schema.
     * This value goes unchanged to the request.
     */
    content?: string;
    /**
     * When content is used, it informs about the content type of the
     * schema. The schema is invalid when `content` is set and the `mime` is not.
     */
    mime?: string;
}
/**
 * A project can contain schema definitions that can be reused in project requests.
 * The schema consists of:
 *
 * - content: the "raw" schema value in any format. This goes unprocessed into the request body.
 * - properties: a map of properties description that can be manipulated at runtime
 *
 * Scalar values are not supported as a schema definition. It always represents an object.
 */
export declare class ProjectSchema {
    kind: string;
    /**
     * The identifier of the environment.
     */
    key: string;
    /**
     * The optional list of properties in this schema.
     * Because this is a list instead of a map it is possible to duplicate the property name. In this
     * case the last set value is the final value.
     *
     * When both the `properties` and the `content` is defined, `content` is used instead of properties.
     */
    properties?: Property[];
    /**
     * The "raw" content of the schema.
     * This value goes unchanged to the request.
     */
    content?: string;
    /**
     * When content is used, it informs about the content type of the
     * schema. The schema is invalid when `content` is set and the `mime` is not.
     */
    mime?: string;
    /**
     * The name of the schema.
     */
    name: string;
    /**
     * Creates a new schema instance from the passed name.
     * @param name The name of the schema.
     */
    static fromName(name: string): ProjectSchema;
    /**
     * Creates a new schema instance from the content definition
     * @param name The name of the schema.
     * @param content The "raw" content of the schema
     * @param mime The mime type associated with the schema.
     * @returns The instance of the created schema
     */
    static fromContent(name: string, content: string, mime: string): ProjectSchema;
    /**
     * @param input The schema definition used to restore the state.
     */
    constructor(input?: string | IProjectSchema);
    /**
     * Creates a new schema definition clearing anything that is so far defined.
     */
    new(init: IProjectSchema): void;
    toJSON(): IProjectSchema;
    /**
     * Creates a schema property from a definition.
     * @param info The property definition.
     * @returns The same property definition
     */
    addProperty(info: IProperty): Property;
    /**
     * Creates a schema property from a definition.
     *
     * @param name The property name
     * @param type The property data type
     * @returns The created schema definition.
     */
    addProperty(name: string, type: PropertyType): Property;
}
//# sourceMappingURL=ProjectSchema.d.ts.map