Merge branch 'IDTEAM-1.26.0' into 'main'
[ProtonMail-WebClient.git] / packages / pass / lib / search / types.ts
blobbd10c8d698a49aca1cc0692e697ce7e45d0146f0
1 import type { FormSubmission, ItemRevision, ItemSortFilter, ItemType, MaybeNull } from '@proton/pass/types';
2 import type { ParsedUrl } from '@proton/pass/utils/url/types';
4 export type FieldMatch<T extends ItemType = ItemType> = (item: ItemRevision<T>) => (needle: string) => boolean;
5 export type ItemMatch<T extends ItemType = ItemType> = (item: ItemRevision<T>) => (needles: string[]) => boolean;
6 export type ItemMatchMap = { [T in ItemType]: ItemMatch<T> };
8 export type SelectItemsOptions = {
9     search?: string;
10     shareId?: MaybeNull<string>;
11     sort?: MaybeNull<ItemSortFilter>;
12     trashed?: boolean;
13     type?: MaybeNull<ItemType>;
16 export type SelectItemsByDomainOptions = {
17     isPrivate: boolean;
18     port: MaybeNull<string>;
19     protocol: MaybeNull<string>;
20     shareIds?: string[];
21     sortOn?: 'priority' | 'lastUseTime';
22     strict?: boolean;
25 export type SelectAutofillCandidatesOptions = ParsedUrl & { shareIds?: string[]; strict?: boolean };
26 export type SelectOTPAutofillCandidateOptions = ParsedUrl & { submission?: FormSubmission };
27 export type SelectAutosaveCandidatesOptions = { domain: string; userIdentifier: string; shareIds?: string[] };