[DRVWEB-4373] Add Suggestion Mode spotlight onboarding modal for docs on drive
[ProtonMail-WebClient.git] / packages / pass / utils / url / types.ts
blob6a0a5919181da707760924d893a43686b9bcf0d7
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>;
8     /* subdomain if any */
9     subdomain: MaybeNull<string>;
10     /* hostname of the URL */
11     hostname: MaybeNull<string>;
12     /* protocol */
13     protocol: MaybeNull<string>;
14     /* port */
15     port: MaybeNull<string>;
16     /* URL matches top-level domain */
17     isTopLevelDomain: boolean;
18     /* private domain from public suffix list */
19     isPrivate: boolean;
20     /* matches `https:` protocol */
21     isSecure: boolean;
24 export type URLComponents = Pick<ParsedUrl, 'domain' | 'port' | 'protocol'>;
26 export type SanitizedUrl = {
27     valid: boolean;
28     hostname: MaybeNull<string>;
29     protocol: MaybeNull<string>;
30     port: MaybeNull<string>;
31     url: string;
34 export type ParsedSenderUrl = RequiredNonNull<ParsedUrl, 'domain' | 'protocol'>;
35 export type ParsedSender = { tabId: TabId; url: ParsedSenderUrl };