declare const BOT_CATEGORY: Readonly<{ SEARCH: "search"; AI_TRAINING: "ai-training"; AI_ASSISTANT: "ai-assistant"; AI_AGENT: "ai-agent"; SOCIAL_PREVIEW: "social-preview"; MONITORING: "monitoring"; ADVERTISING: "advertising"; ARCHIVING: "archiving"; SEO: "seo"; SECURITY: "security"; SECURITY_SCANNER: "security-scanner"; AUTOMATION: "automation"; PAYMENT: "payment"; PERFORMANCE: "performance"; LINK_VALIDATOR: "link-validator"; FEED: "feed"; GENERIC: "generic"; }>; /** * @typedef {'high'|'medium'|'low'} BotConfidence */ /** * @typedef {Object} BotInfo * @property {string} name * @property {string} [version] * @property {string} type * @property {string} category * @property {BotConfidence} confidence */ /** * Detect whether a UA string belongs to a bot / crawler / fetcher. * * import { detectBot } from '@exortek/ua/bots'; * * const bot = detectBot(req.headers['user-agent']); * if (bot) { * console.log(bot.name); // 'Googlebot' * console.log(bot.type); // 'crawler' * console.log(bot.category); // 'search' * } * * @param {string} ua * @returns {BotInfo|null} */ declare function detectBot(ua: string): BotInfo | null; /** * Quick boolean check: is this UA a bot? * * @param {string} ua * @returns {boolean} */ declare function isBot(ua: string): boolean; /** * Is this UA an AI training crawler? * * @param {string} ua * @returns {boolean} */ declare function isAICrawler(ua: string): boolean; /** * Is this UA an AI assistant fetcher? * * @param {string} ua * @returns {boolean} */ declare function isAIAssistant(ua: string): boolean; /** * Is this UA a search engine crawler? * * @param {string} ua * @returns {boolean} */ declare function isSearchBot(ua: string): boolean; /** * Is this UA a social media preview fetcher? * * @param {string} ua * @returns {boolean} */ declare function isSocialPreview(ua: string): boolean; /** * Is this UA an SEO tool crawler? * * @param {string} ua * @returns {boolean} */ declare function isSEOBot(ua: string): boolean; /** * Is this UA a security scanner? * * @param {string} ua * @returns {boolean} */ declare function isSecurityScanner(ua: string): boolean; /** * Is this UA an automation tool? (headless browsers, test frameworks) * * @param {string} ua * @returns {boolean} */ declare function isAutomation(ua: string): boolean; /** * Create a custom bot detector with additional patterns. * * import { createBotDetector } from '@exortek/ua/bots'; * * const detect = createBotDetector([ * { pattern: /mycompanybot/i, name: 'MyBot', category: 'internal' }, * ]); * detect('MyCompanyBot/1.0'); // { name: 'MyBot', ... } * * @param {Array<{pattern: RegExp, name: string, category?: string}>} extraPatterns * @returns {(ua: string) => BotInfo|null} */ declare function createBotDetector(extraPatterns: Array<{ pattern: RegExp; name: string; category?: string; }>): (ua: string) => BotInfo | null; /** * Clear the bot detection cache. */ declare function clearBotCache(): void; type BotConfidence = "high" | "medium" | "low"; type BotInfo = { name: string; version?: string | undefined; type: string; category: string; confidence: BotConfidence; }; export { BOT_CATEGORY, clearBotCache, createBotDetector, detectBot, isAIAssistant, isAICrawler, isAutomation, isBot, isSEOBot, isSearchBot, isSecurityScanner, isSocialPreview }; export type { BotConfidence, BotInfo };