import "../../_dnt.polyfills.js"; import type { OasUnknown } from '../unknown/Unknown.js'; import type { SchemaPath } from '../../types/SchemaPath.js'; import type { OasRef } from '../ref/Ref.js'; import type { OasSchema, ToJsonSchemaOptions } from '../schema/Schema.js'; import type { OpenAPIV3 } from 'openapi-types'; import { OasBase } from '../../types/OasBase.js'; import type { ParseContextType } from '../../context/parseTypes.js'; /** * Constructor fields for {@link OasString}. * * @template Nullable - Whether the string value can be null */ export type StringFields = { /** A short summary of the string schema */ title?: string; /** A description of the string schema */ description?: string; /** String format (e.g., 'email', 'date-time', 'uri') */ format?: string; /** Default value for the string */ default?: Nullable extends true ? string | null | undefined : string | undefined; /** Regular expression pattern for validation */ pattern?: string; /** Array of allowed enum values */ enums?: Nullable extends true ? (string | null)[] | undefined : string[] | undefined; /** Maximum length constraint */ maxLength?: number; /** Minimum length constraint */ minLength?: number; /** Whether the string value can be null */ nullable?: Nullable; /** Custom extension fields (x-* properties) */ extensionFields?: Record; /** Example value for the string */ example?: Nullable extends true ? string | null | undefined : string | undefined; /** Whether the string is read-only */ readOnly?: boolean; /** Whether the string is write-only */ writeOnly?: boolean; /** Whether the string is deprecated */ deprecated?: boolean; }; export declare class OasString extends OasBase { /** * Object is part the 'schema' set which is used * to define data types in an OpenAPI document. */ oasType: "schema"; /** * Constant value 'string' useful for type narrowing and tagged unions. */ type: "string"; /** * A short summary of the string. */ title: string | undefined; /** * A description of the string. */ description: string | undefined; /** * The format of the string. */ format: string | undefined; /** * An array of allowed values for the string. */ enums: Nullable extends true ? (string | null)[] | undefined : string[] | undefined; /** * The maximum length of the string. */ maxLength: number | undefined; /** * The minimum length of the string. */ minLength: number | undefined; /** * Indicates whether value can be null. */ nullable: Nullable | undefined; /** Specification Extension fields */ extensionFields: Record | undefined; /** An example of the string. */ example: Nullable extends true ? string | null | undefined : string | undefined; /** * The pattern of the string. */ pattern: string | undefined; /** * The default value of the string. */ default: Nullable extends true ? string | null | undefined : string | undefined; /** * Whether the string is read-only. */ readOnly: boolean | undefined; /** * Whether the string is write-only. */ writeOnly: boolean | undefined; /** * Whether the string is deprecated. */ deprecated: boolean | undefined; /** * 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?: StringFields, context?: ParseContextType); 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'>): OasString; traverse(path: SchemaPath): OasSchema | OasRef<'schema'>; resolve(): OasString; resolveOnce(): OasString; toJsonSchema(options?: ToJsonSchemaOptions): OpenAPIV3.NonArraySchemaObject; }