import "../../_dnt.polyfills.js"; import type { OasUnknown } from '../unknown/Unknown.js'; import type { SchemaPath } from '../../types/SchemaPath.js'; import type { OpenAPIV3 } from 'openapi-types'; import type { OasRef } from '../ref/Ref.js'; import type { OasSchema, ToJsonSchemaOptions } from '../schema/Schema.js'; import { OasBase } from '../../types/OasBase.js'; import type { ParseContextType } from '../../context/parseTypes.js'; /** * Constructor fields for {@link OasBoolean}. * * @template Nullable - Whether the boolean can be null (affects type unions) */ export type BooleanFields = { /** A short summary of the boolean schema */ title?: string; /** A description of the boolean schema */ description?: string; /** Whether the boolean value can be null */ nullable?: Nullable; /** Custom extension fields (x-* properties) */ extensionFields?: Record; /** Example value for the boolean (null allowed if Nullable is true) */ example?: Nullable extends true ? boolean | null | undefined : boolean | undefined; /** Array of valid enum values for the boolean (null allowed if Nullable is true) */ enums?: Nullable extends true ? (boolean | null)[] | undefined : boolean[] | undefined; /** Default value for the boolean (null allowed if Nullable is true) */ default?: Nullable extends true ? boolean | null | undefined : boolean | undefined; /** Whether the boolean is read-only */ readOnly?: boolean; /** Whether the boolean is write-only */ writeOnly?: boolean; /** Whether the boolean is deprecated */ deprecated?: boolean; }; export declare class OasBoolean extends OasBase { /** * Object is part the 'schema' set which is used * to define data types in an OpenAPI document. */ oasType: "schema"; /** * Constant value 'boolean' useful for type narrowing and tagged unions. */ type: "boolean"; /** * A short summary of the boolean. */ title: string | undefined; /** * A description of the boolean. */ description: string | undefined; /** * Indicates whether value can be null. */ nullable: Nullable | undefined; /** Specification Extension fields */ extensionFields: Record | undefined; /** * An example of the boolean. */ example: Nullable extends true ? boolean | null | undefined : boolean | undefined; /** * Possible values the boolean can have */ enums: Nullable extends true ? (boolean | null)[] | undefined : boolean[] | undefined; /** * The default value of the boolean. */ default: Nullable extends true ? boolean | null | undefined : boolean | undefined; /** Whether the boolean is read-only */ readOnly: boolean | undefined; /** Whether the boolean is write-only */ writeOnly: boolean | undefined; /** Whether the boolean is deprecated */ deprecated: boolean | undefined; /** * Creates a new OasBoolean instance. * * @param fields - Boolean configuration fields including validation constraints and metadata * @param context - Optional ParseContext. When passed and attribution is * enabled, the current StackTrail is snapshotted onto the * instance (via the {@link OasBase} base). */ /** * The schema's `not`, kept as an `OasUnknown` under `client.json` * `system.not: unknown`: the document says "not something", and core does * not read what. `undefined` otherwise. */ not: OasUnknown | undefined; constructor(fields?: BooleanFields, context?: ParseContextType); /** * Determines if this boolean is a reference object. * * @returns Always returns false since this is a concrete boolean instance, not a reference */ isRef(): this is OasRef<'schema'>; /** Whether the value is `readOnly`: sent by the API only, never in a request. */ isReadOnly(): boolean; /** Whether the value is `writeOnly`: sent in a request only, never by the API. */ isWriteOnly(): boolean; /** * A copy of this schema with what `ref` adds at its site applied: its * `nullable`, `readOnly`, `writeOnly` and the keywords next to it (`SiblingKeywords`) that * this type takes, a sibling's value winning. A value that does not fit * this type is left out (the parser reports it). For `OasRef.resolve()`. * This schema does not change, and the copy shares its child schemas. */ clone(ref?: OasRef<'schema'>): OasBoolean; traverse(path: SchemaPath): OasSchema | OasRef<'schema'>; /** * Resolves this boolean object. * * @returns The boolean instance itself since it's already a concrete object, not a reference */ resolve(): OasBoolean; /** * Resolves this boolean object one level. * * @returns The boolean instance itself since it's already a concrete object, not a reference */ resolveOnce(): OasBoolean; /** * Converts this OAS boolean to an OpenAPI v3 JSON schema representation. * * @param options - Conversion options (currently unused for boolean schemas) * @returns OpenAPI v3 boolean schema object with type and all validation constraints */ toJsonSchema(options?: ToJsonSchemaOptions): OpenAPIV3.NonArraySchemaObject; }