fluid-oas
Version:
Build declarative OpenApiv3.* specifications.
50 lines (49 loc) • 1.59 kB
TypeScript
import { type SchemaInterface } from "../lib/base";
interface OpenApiBaseNumber extends SchemaInterface<number> {
/**
* Adds a minimum to this number schema.
* @param min - Minimum bound for this number.
*/
addMinimum(min: number): this;
/**
* Adds a maximum to this number schema.
* @param max - Maximum bound for this number.
*/
addMaximum(max: number): this;
/**
* Adds an exclusive maximum to this number.
*
* As of OpenApi v3.1.* exclusiveMax is now a number not a boolean.
* @param max - Maximum bound for this number.
*/
addExclusiveMax(max: number): this;
addExclusiveMax(max: boolean): this;
/**
* Adds an exclusive minimum to this number.
*
* As of OpenApi v3.1.* exclusiveMin is now a number not a boolean.
* @param min - Minimum bound for this number.
*/
addExclusiveMin(min: number): this;
addExclusiveMin(min: boolean): this;
/**
* Adds a multiple to validate numbers against.
* @param multipleOf - Constrain numbers to be multiples of the given value.
*/
addMultiple(multipleOf: number): this;
}
/**
* A Number representation of the JSON numberschema.
*/
export interface OpenApiNumber extends OpenApiBaseNumber {
addFormat(val: "float" | "double"): this;
}
/**
* A Integer representation of the JSON number schema.
*/
export interface OpenApiInteger extends OpenApiBaseNumber {
addFormat(val: "int32" | "int64"): this;
}
export declare const Number: OpenApiNumber;
export declare const Integer: OpenApiInteger;
export {};