import { ApiDOMReferenceResolveOptions } from '@speclynx/apidom-reference/configuration/empty'; import { Diagnostic } from 'vscode-languageserver-types'; import { DiagnosticSeverity } from 'vscode-languageserver-types'; import { LanguageServiceContext } from '@speclynx/apidom-ls'; import type { PartialDeep } from 'type-fest'; import { Resolver } from '@speclynx/apidom-reference/configuration/empty'; import { ResolveStrategy } from '@speclynx/apidom-reference/configuration/empty'; import { TextDocument } from 'vscode-languageserver-textdocument'; /** * Language ID for Arazzo documents used with TextDocument. * * @public */ export declare const ARAZZO_LANGUAGE_ID = "apidom"; /** * Creates a TextDocument for Arazzo validation. * * @param uri - The document URI * @param content - The document content * @returns A TextDocument instance * @public */ export declare function createTextDocument(uri: string, content: string): TextDocument; /** * Default document version for TextDocument instances. * * @public */ export declare const DEFAULT_DOCUMENT_VERSION = 1; /** * Default resolve options for URI resolution in validateURI. * * These options control how files and URLs are fetched when validating * Arazzo documents from URIs. * * @public */ export declare const defaultArazzoResolveOptions: { baseURI?: string | undefined; resolvers?: Resolver[] | undefined; resolverOpts?: { [x: string]: any; } | undefined; strategies?: ResolveStrategy[] | undefined; strategyOpts?: { [x: string]: any; } | undefined; internal?: boolean | undefined; external?: boolean | undefined; maxDepth?: number | undefined; } | undefined; /** * Default language service context for validation. * * Controls validation behavior including JSON Schema validation, * semantic validation, and linting rules. * * @public */ export declare const defaultLanguageServiceContext: Partial; export { Diagnostic } export { DiagnosticSeverity } export { LanguageServiceContext } export { TextDocument } /** * Validates an Arazzo Document from a TextDocument. * * This is a lower-level API for advanced use cases such as IDE integrations * or when you already have document content in memory. * * @param textDocument - The TextDocument containing the Arazzo Document content * @param context - Optional language service context override (deep merged with defaults) * @returns Promise resolving to an array of Diagnostic objects * * @example * Basic usage * ```typescript * import { validate, TextDocument, DiagnosticSeverity, ARAZZO_LANGUAGE_ID, DEFAULT_DOCUMENT_VERSION } from '@jentic/arazzo-validator'; * * const textDocument = TextDocument.create( * 'file:///path/to/arazzo.yaml', * ARAZZO_LANGUAGE_ID, * DEFAULT_DOCUMENT_VERSION, * content * ); * const diagnostics = await validate(textDocument); * const errors = diagnostics.filter((d) => d.severity === DiagnosticSeverity.Error); * ``` * * @example * Disable JSON Schema validation * ```typescript * const diagnostics = await validate(textDocument, { * validationContext: { jsonSchemaValidation: false } * }); * ``` * @public */ export declare function validate(textDocument: TextDocument, context?: PartialDeep): Promise; /** * Validates an Arazzo Document from a URI (file path or HTTP(S) URL). * * This is the primary API for validation. It fetches the document from the * specified URI and performs JSON Schema validation, semantic validation, * and linting. * * @param uri - The file system path or HTTP(S) URL to the Arazzo Document * @param context - Optional language service context override (deep merged with defaults) * @param resolveOptions - Optional resolve options for fetching the URI * @returns Promise resolving to an array of Diagnostic objects * * @example * Validate from file * ```typescript * import { validateURI, DiagnosticSeverity } from '@jentic/arazzo-validator'; * * const diagnostics = await validateURI('/path/to/arazzo.yaml'); * const errors = diagnostics.filter((d) => d.severity === DiagnosticSeverity.Error); * ``` * * @example * Validate from URL * ```typescript * const diagnostics = await validateURI('https://example.com/arazzo.yaml'); * ``` * * @example * Validate with custom context * ```typescript * const diagnostics = await validateURI('/path/to/arazzo.yaml', { * validationContext: { jsonSchemaValidation: false } * }); * ``` * * @example * Validate with custom resolve options * ```typescript * const diagnostics = await validateURI('/path/to/arazzo.yaml', {}, { * resolverOpts: { timeout: 10000 } * }); * ``` * @public */ export declare function validateURI(uri: string, context?: PartialDeep, resolveOptions?: PartialDeep): Promise; export { }