import type { OntologyTypeRecordId, ParseBaseUrlError, ParseVersionedUrlError, Result, VersionedUrl } from "./type-system-rs/type-system.d.ts"; import type { BaseUrl, OntologyTypeVersion } from "./type-system-rs/types.d.ts"; /** * Checks if a given URL string is a valid base URL. * * @param {BaseUrl} url - The URL string. * @returns {(Result)} - an Ok with an inner of the string as a * BaseUrl if valid, or an Err with an inner ParseBaseUrlError */ export declare const validateBaseUrl: (url: string) => Result; export declare const isBaseUrl: (baseUrl: string) => baseUrl is BaseUrl; /** * Checks if a given URL string is a Block Protocol compliant Versioned URL. * * @param {string} url - The URL string. * @returns {(Result)} - an Ok with an inner of the string as * a VersionedUrl if valid, or an Err with an inner ParseVersionedUrlError */ export declare const validateVersionedUrl: (url: string) => Result; /** * Extracts the base URL from a Versioned URL. * * @param {VersionedUrl} url - The versioned URL. * @throws if the versioned URL is invalid. */ export declare const extractBaseUrl: (url: VersionedUrl) => BaseUrl; /** * Extracts the version from a Versioned URL. * * @param {VersionedUrl} url - The versioned URL. * @throws if the versioned URL is invalid. */ export declare const extractVersion: (url: VersionedUrl) => OntologyTypeVersion; /** * Extract the baseUrl and version from a versioned URL * * @param versionedUrl a versioned URL * @throws {ParseVersionedUrlError} if the versionedUrl is invalid */ export declare const componentsFromVersionedUrl: (url: VersionedUrl) => { baseUrl: BaseUrl; version: OntologyTypeVersion; }; export declare const versionedUrlFromComponents: (baseUrl: BaseUrl, version: OntologyTypeVersion) => VersionedUrl; export declare const ontologyTypeRecordIdToVersionedUrl: (ontologyTypeRecordId: OntologyTypeRecordId) => VersionedUrl; export declare const makeOntologyTypeVersion: ({ major }: { major: number; }) => OntologyTypeVersion; export declare const parseOntologyTypeVersion: (version: string) => OntologyTypeVersion; export declare const incrementOntologyTypeVersion: (version: OntologyTypeVersion) => OntologyTypeVersion; /** * Compare two ontology type versions following SemVer semantics. * * Converts versions to SemVer format and uses semver.compare: * - "1" → "1.0.0" * - "1-draft.lane.5" → "1.0.0-draft.lane.5" * * SemVer rules automatically applied: * - Major version takes precedence * - Published versions (1.0.0) > pre-release versions (1.0.0-draft.x) * - Pre-release identifiers follow SemVer rules: * 1. Numeric identifiers compared numerically * 2. Alphanumeric identifiers compared lexically * 3. Numeric identifiers have lower precedence than alphanumeric * 4. Larger set of fields has higher precedence */ export declare const compareOntologyTypeVersions: (versionA: OntologyTypeVersion, versionB: OntologyTypeVersion) => -1 | 0 | 1;