import type { OasServer } from '../server/Server.js'; import type { OasRef } from '../ref/Ref.js'; import type { ToJsonSchemaOptions } from '../schema/Schema.js'; import type { OpenAPIV3 } from 'openapi-types'; /** * Constructor fields for {@link OasLink}. */ export type LinkFields = { /** A relative or absolute URI reference to an OAS operation (mutually exclusive with `operationId`) */ operationRef?: string; /** The name of an existing, resolvable OAS operation */ operationId?: string; /** A map of parameter names to values or runtime expressions passed to the linked operation */ parameters?: Record; /** A value or runtime expression to use as the request body when calling the linked operation */ requestBody?: unknown; /** A description of the link */ description?: string; /** A server to use for the linked operation */ server?: OasServer; /** Custom extension fields (x-* properties) */ extensionFields?: Record; }; /** * Represents a Link Object in the OpenAPI Specification. * * A link describes a possible design-time relationship from a response to another * operation — for example, how the `id` in a create response can be used as the * path parameter of a subsequent fetch. It names the target operation (by * `operationId` or `operationRef`) and how to populate its parameters and request * body from the current response. * * @example * ```typescript * import { OasLink } from '@skmtc/core'; * * const getUserByUserId = new OasLink({ * operationId: 'getUser', * parameters: { userId: '$response.body#/id' }, * description: 'The `id` of the created user is the `userId` of GET /users/{userId}' * }); * ``` */ export declare class OasLink { oasType: 'link'; /** A URI reference to a target operation */ operationRef: string | undefined; /** The `operationId` of a target operation */ operationId: string | undefined; /** Parameter values or runtime expressions for the target operation */ parameters: Record | undefined; /** The request body value or runtime expression for the target operation */ requestBody: unknown; /** A description of the link */ description: string | undefined; /** A server to use for the target operation */ server: OasServer | undefined; /** Specification Extension fields */ extensionFields: Record | undefined; constructor(fields: LinkFields); /** Returns true if object is a reference */ isRef(): this is OasRef<'link'>; /** Always `false`: `readOnly` is a schema keyword. */ isReadOnly(): boolean; /** Always `false`: `writeOnly` is a schema keyword. */ isWriteOnly(): boolean; /** Returns itself */ resolve(): OasLink; resolveOnce(): OasLink; toJsonSchema(options: ToJsonSchemaOptions): OpenAPIV3.LinkObject; }