/**
 * Phone number formatting utilities
 * Provides pattern-based formatting without external dependencies
 */
/**
 * Extract only digits from a string
 * @param value - Input string that may contain non-digit characters
 * @returns String containing only digits (0-9)
 */
export declare function extractDigits(value: string): string;
/**
 * Apply a pattern to input digits
 * Pattern uses '#' as placeholder for digits, other characters are literals
 *
 * @example
 * formatWithPattern("5551234567", "+1 (###) ###-####")
 * // returns "+1 (555) 123-4567"
 *
 * @param value - String containing the digits to format
 * @param pattern - Format pattern where '#' represents a digit placeholder
 * @returns Formatted string according to pattern
 */
export declare function formatWithPattern(value: string, pattern: string): string;
/**
 * Calculate cursor position after formatting
 * Critical for UX - ensures cursor stays in correct position relative to digits
 *
 * @example
 * // User types "4" at position: "1|23" → "1423"
 * // After formatting: "(14) 23"
 * // Cursor should be: "(14|) 23" (after the 4, not at end)
 *
 * @param oldValue - Previous input value
 * @param newValue - New formatted value
 * @param oldCursor - Cursor position before formatting
 * @returns New cursor position after formatting
 */
export declare function getCursorPosition(oldValue: string, newValue: string, oldCursor: number): number;
/**
 * Count digit placeholders in a pattern
 * Used to determine maximum number of digits allowed
 *
 * @param pattern - Format pattern
 * @returns Number of '#' characters in pattern
 */
export declare function countDigitPlaceholders(pattern: string): number;
export declare function getLiteralPrefixInfo(pattern: string): {
    literalPrefix: string;
    literalPrefixDigits: string;
};
export declare function stripLiteralPrefix(allDigits: string, literalPrefixDigits: string): string;
export declare function calculateCursorPosition(digitsBeforeCursor: number, formatted: string, literalPrefixDigits: string): number;
export declare function formatPhoneDigits(inputValue: string, pattern: string, cursorPosition: number): {
    formatted: string;
    nextCursor: number;
    literalPrefixDigits: string;
} | null;
