import { Debugger } from 'debug/src/browser'; /** * @hidden * @internal * Limited to Microsoft-internal use. * * Implementation of URL pattern matching logic for validating origins against a list of allowed patterns. */ export interface URLVerifier { /** * Checks if the given URL matches the pattern defined in the implementation. * @param url - The URL to test against the pattern. * @returns - True if the URL matches the pattern, false otherwise. */ test: (url: URL) => boolean; } /** * Checks if the provided host matches the given pattern, which may include a single wildcard segment. * @param pattern - reference pattern * @param host - candidate string * @returns returns true if host matches pre-know valid pattern * * @example * validateHostAgainstPattern('*.teams.microsoft.com', 'subdomain.teams.microsoft.com') returns true * validateHostAgainstPattern('test.*.teams.microsoft.com', 'test.subdomain.teams.microsoft.com') returns true * validateHostAgainstPattern('teams.microsoft.com', 'team.microsoft.com') returns false * validateHostAgainstPattern('*.*.microsoft.com', 'test.team.microsoft.com') returns false * * @internal * Limited to Microsoft-internal use */ export declare function validateHostAgainstPattern(pattern: string, host: string): boolean; /** * @hidden * @internal * Limited to Microsoft-internal use. * * Checks if the provided pattern is valid for checking against URLs. * @param pattern - The pattern to validate. * @returns - True if the pattern is valid, false otherwise. */ export declare function isValidPatternUrl(pattern: string): boolean; /** * @hidden * @internal * Limited to Microsoft-internal use. * * Creates a URL verifier based on the provided pattern. */ export declare function createURLVerifier(pattern: string, logger: Debugger): URLVerifier | undefined;