/**
 * @file useLinkify.tsx
 * @input Uses React, Link, useLinkComponent
 * @output Exports useLinkify hook for auto-detecting links in plain text
 * @position Link utility hook; turns plain text into a mix of strings and Link elements
 *
 * Detects URLs, email addresses, and custom patterns (e.g. T1234, D5678)
 * in plain text and renders them as Link elements that respect
 * LinkProvider for client-side routing.
 *
 * SYNC: When modified, update:
 * - /packages/core/src/Link/index.ts (exports)
 * - /packages/core/src/Link/useLinkify.test.tsx (tests)
 */
import { type ReactNode } from 'react';
/**
 * A custom pattern for detecting linkable text.
 */
export interface LinkifyPattern {
    /**
     * Regex pattern to match. Must use the global flag (g).
     * Capture groups can be used in `href` and `label` functions.
     */
    pattern: RegExp;
    /**
     * Build the link URL from a regex match.
     */
    href: (match: RegExpMatchArray) => string;
    /**
     * Optional: custom display text for the link.
     * Defaults to the full matched string (match[0]).
     */
    label?: (match: RegExpMatchArray) => string;
    /**
     * Whether the link should open in a new tab.
     * @default false
     */
    isExternal?: boolean;
}
export interface UseLinkifyOptions {
    /**
     * Custom patterns to detect, in addition to (or replacing) built-in patterns.
     * Patterns are matched in order; first match wins for overlapping ranges.
     */
    patterns?: LinkifyPattern[];
    /**
     * Whether to include built-in URL and email detection.
     * @default true
     */
    hasBuiltins?: boolean;
}
/**
 * Detects URLs, emails, and custom patterns in plain text and returns
 * a ReactNode array with Link elements for each match.
 *
 * Links render via Link, respecting LinkProvider for client-side routing.
 *
 * @example
 * ```
 * const nodes = useLinkify('Visit https://example.com or email hi@example.com');
 * return <p>{nodes}</p>;
 * ```
 */
export declare function useLinkify(text: string, options?: UseLinkifyOptions): ReactNode[];
//# sourceMappingURL=useLinkify.d.ts.map