import { Types } from '@pawel-up/data-mock/Types.js';
import { Person } from '@pawel-up/data-mock/Person.js';
import { Lorem } from '@pawel-up/data-mock/Lorem.js';
import { IApiParameter } from './definitions/Api.js';
import { IApiArrayShape, IApiDataExample, IApiScalarShape, IShapeUnion } from './definitions/Shapes.js';
export interface IApiSchemaReadOptions {
    /**
     * Whether the value should be read only when the required property is set.
     */
    requiredOnly?: boolean;
    /**
     * Whether to read the examples to generate the value.
     */
    fromExamples?: boolean;
}
/**
 * A utility class with helper functions to read values from a schema definition
 */
export declare class ApiSchemaValues {
    static types: Types;
    static person: Person;
    static lorem: Lorem;
    /**
     * Reads the value to be set on an input. This is for Scalar shapes only.
     *
     * @returns The value to set on the input. Note, it is not cast to the type.
     */
    static readInputValue(parameter: IApiParameter, schema: IApiScalarShape, opts?: IApiSchemaReadOptions): string | number | boolean | null | undefined;
    /**
     * @param parameter The parameter that has the array schema.
     * @param schema The final schema to use to read the data from.
     */
    static readInputValues(parameter: IApiParameter, schema: IShapeUnion, opts?: IApiSchemaReadOptions): unknown[];
    /**
     * Reads the value for the form input(s) from examples.
     */
    static inputValueFromExamples(examples: IApiDataExample[]): string | number | boolean | null | undefined;
    /**
     * Reads the array value from examples.
     * @param examples Examples set on an array item.
     */
    static arrayValuesFromExamples(examples?: IApiDataExample[]): (string | number | boolean | null | undefined)[];
    /**
     * Generates a default value from the schema type.
     * For booleans it returns `false`, for numbers `0`, nulls `null`, etc.
     * It does not generate a value for `string` types!
     */
    static generateDefaultValue(schema: IApiScalarShape): string | number | boolean | null | undefined;
    /**
     * Generates a default value from the schema type.
     * For booleans it returns `false`, for numbers `0`, nulls `null`, etc.
     * It does not generate a value for `string` types!
     */
    static generateMockedValue(schema: IApiScalarShape): string | number | boolean | null | undefined;
    static defaultValue(dataType?: string): string | number | boolean | null | undefined;
    /**
     * Generates a random number value given the schema definition for a number scalar.
     */
    static generateNumberValue(schema: IApiScalarShape): number;
    static generateStringValue(schema: IApiScalarShape): string;
    /**
     * Casts the `value` to the corresponding data type
     * @param type The w3 schema type
     */
    static readTypedValue(value: unknown, type?: string): string | number | boolean | null | undefined;
    /**
     * @param schemaType Data type encoded in the parameter schema.
     * @returns One of the HTML input element type values.
     */
    static readInputType(schemaType: string): 'number' | 'boolean' | 'date' | 'time' | 'datetime-local' | 'text';
    /**
     * Processes a value that should be a number.
     */
    static parseNumberInput(value: unknown, defaultValue?: number): number | undefined;
    /**
     * Processes a value that should be a number.
     */
    static parseBooleanInput(value: unknown, defaultValue?: boolean): boolean | undefined;
    /**
     * Processes a value that should be a date formatted as yyyy-MM-dd.
     */
    static parseDateOnlyInput(value: unknown): string | undefined;
    /**
     * Processes a value that should be a date formatted as hh:mm:ss.
     */
    static parseTimeOnlyInput(input: unknown): string | undefined;
    /**
     * Processes a value that should be a date formatted in one of the supported formats:
     * - rfc3339 (default): 2016-02-28T16:41:41.090Z
     * - rfc2616: Sun, 28 Feb 2016 16:41:41 GMT
     */
    static parseDateTimeInput(value: string | number, format?: string): string | undefined;
    /**
     * Processes a value that should be a date formatted as yyyy-MM-ddThh:mm
     */
    static parseDateTimeOnlyInput(value: string | number): string | undefined;
    /**
     * Parses the the value according to array schema value.
     */
    static parseArrayInput(value: unknown, schema: IApiArrayShape): string | number | boolean | null | undefined;
    /**
     * Parses the user entered value according to the schema definition.
     */
    static parseUserInput(value: unknown, schema: IShapeUnion): string | number | boolean | null | undefined;
    /**
     * Parses the user entered value as scalar value.
     */
    static parseScalarInput(value: unknown, schema: IApiScalarShape): string | number | boolean | null | undefined;
    static parseScalar(value: unknown, dataType?: string, format?: string): string | number | boolean | null | undefined;
}
//# sourceMappingURL=ApiSchemaValues.d.ts.map