UNPKG

ngxsmk-tel-input

Version:

Angular international telephone input (intl-tel-input UI + libphonenumber-js validation). ControlValueAccessor. SSR-safe.

39 lines 1.5 kB
import { CountryCode } from 'libphonenumber-js'; import { NgxsmkTelInputService, ParseResult, ParseWithInvalidResult } from '../ngxsmk-tel-input.service'; import * as i0 from "@angular/core"; /** * Mock implementation of NgxsmkTelInputService for testing */ export declare class MockNgxsmkTelInputService extends NgxsmkTelInputService { private mockValidNumbers; private mockInvalidNumbers; private mockParseResults; private shouldThrowError; private errorMessage; /** * Add a valid phone number for testing */ addValidNumber(number: string, country?: CountryCode): void; /** * Add an invalid phone number for testing */ addInvalidNumber(number: string, country?: CountryCode): void; /** * Set a custom parse result for a specific input */ setParseResult(input: string, country: CountryCode, result: ParseResult): void; /** * Configure the service to throw an error */ setShouldThrowError(shouldThrow: boolean, message?: string): void; /** * Clear all mock data */ clearMocks(): void; parse(input: string, iso2: CountryCode): ParseResult; isValid(input: string, iso2: CountryCode): boolean; parseWithInvalidDetection(input: string, iso2: CountryCode): ParseWithInvalidResult; static ɵfac: i0.ɵɵFactoryDeclaration<MockNgxsmkTelInputService, never>; static ɵprov: i0.ɵɵInjectableDeclaration<MockNgxsmkTelInputService>; } //# sourceMappingURL=mock-phone-service.d.ts.map