UNPKG

@sqliteai/sqlite-vector

Version:

SQLite vector search extension for Node.js - Cross-platform vector embeddings and similarity search

85 lines (82 loc) 2.7 kB
/** * Supported platform identifiers */ type Platform = 'darwin-arm64' | 'darwin-x86_64' | 'linux-arm64' | 'linux-arm64-musl' | 'linux-x86_64' | 'linux-x86_64-musl' | 'win32-x86_64'; /** * Detects if the system uses musl libc (Alpine Linux, etc.) * Uses multiple detection strategies for reliability */ declare function isMusl(): boolean; /** * Gets the current platform identifier * @throws {Error} If the platform is unsupported */ declare function getCurrentPlatform(): Platform; /** * Gets the package name for the current platform */ declare function getPlatformPackageName(): string; /** * Gets the binary filename for the current platform */ declare function getBinaryName(): string; /** * Error thrown when the SQLite Vector extension cannot be found */ declare class ExtensionNotFoundError extends Error { constructor(message: string); } /** * Gets the absolute path to the SQLite Vector extension binary for the current platform * * @returns Absolute path to the extension binary (.so, .dylib, or .dll) * @throws {ExtensionNotFoundError} If the extension binary cannot be found * * @example * ```typescript * import { getExtensionPath } from '@sqliteai/sqlite-vector'; * * const extensionPath = getExtensionPath(); * // On macOS ARM64: /path/to/node_modules/@sqliteai/sqlite-vector-darwin-arm64/vector.dylib * ``` */ declare function getExtensionPath(): string; /** * Information about the current platform and extension */ interface ExtensionInfo { /** Current platform identifier (e.g., 'darwin-arm64') */ platform: Platform; /** Name of the platform-specific npm package */ packageName: string; /** Filename of the binary (e.g., 'vector.dylib') */ binaryName: string; /** Full path to the extension binary */ path: string; } /** * Gets detailed information about the SQLite Vector extension * * @returns Extension information object * * @example * ```typescript * import { getExtensionInfo } from '@sqliteai/sqlite-vector'; * * const info = getExtensionInfo(); * console.log(info); * // { * // platform: 'darwin-arm64', * // packageName: '@sqliteai/sqlite-vector-darwin-arm64', * // binaryName: 'vector.dylib', * // path: '/path/to/vector.dylib' * // } * ``` */ declare function getExtensionInfo(): ExtensionInfo; declare const _default: { getExtensionPath: typeof getExtensionPath; getExtensionInfo: typeof getExtensionInfo; ExtensionNotFoundError: typeof ExtensionNotFoundError; }; export { type ExtensionInfo, ExtensionNotFoundError, type Platform, _default as default, getBinaryName, getCurrentPlatform, getExtensionInfo, getExtensionPath, getPlatformPackageName, isMusl };