1 import type { MaybeNull, RequiredNonNull, TabId } from '@proton/pass/types';
3 export type ParsedUrl = {
4 /* domain without suffix */
5 displayName: MaybeNull<string>;
6 /* widest top-level domain */
7 domain: MaybeNull<string>;
9 subdomain: MaybeNull<string>;
10 /* hostname of the URL */
11 hostname: MaybeNull<string>;
13 protocol: MaybeNull<string>;
15 port: MaybeNull<string>;
16 /* URL matches top-level domain */
17 isTopLevelDomain: boolean;
18 /* private domain from public suffix list */
20 /* matches `https:` protocol */
24 export type URLComponents = Pick<ParsedUrl, 'domain' | 'port' | 'protocol'>;
26 export type SanitizedUrl = {
28 hostname: MaybeNull<string>;
29 protocol: MaybeNull<string>;
30 port: MaybeNull<string>;
34 export type ParsedSenderUrl = RequiredNonNull<ParsedUrl, 'domain' | 'protocol'>;
35 export type ParsedSender = { tabId: TabId; url: ParsedSenderUrl };