@i.un/libs 0.0.57 → 0.0.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,42 @@
1
+ declare const selectors: {
2
+ searchPeoplePage: {
3
+ searchEntityResult: string[];
4
+ linkedinUrl: string[];
5
+ image: string[];
6
+ userOccupation: string[];
7
+ fullName: string[];
8
+ resultList: string[];
9
+ actionsDiv: string[];
10
+ validResult: string[];
11
+ searchResult: string[];
12
+ searchResultsContainer: string[];
13
+ mainLayoutLeft: string[];
14
+ howToContainer: string[];
15
+ };
16
+ searchAllPage: {
17
+ peopleButton: string[];
18
+ toolbar: string[];
19
+ };
20
+ };
21
+ type TPage = keyof typeof selectors;
22
+ type TKey<T extends TPage> = keyof (typeof selectors)[T];
23
+ type PageKeyParams<T extends TPage> = {
24
+ page: T;
25
+ key: TKey<T>;
26
+ selector?: never;
27
+ };
28
+ type SelectorParams = {
29
+ page?: never;
30
+ key?: never;
31
+ selector: string;
32
+ };
33
+ type BaseParams = {
34
+ container?: Document | HTMLElement;
35
+ mode?: "all" | "closest";
36
+ };
37
+ type GetElementParams<T extends TPage> = BaseParams & (PageKeyParams<T> | SelectorParams);
38
+ type GetElementReturnType<M extends "all" | "closest" | undefined> = M extends "all" ? HTMLElement[] | null : HTMLElement | null;
39
+ export declare function getElement<T extends TPage, M extends "all" | "closest" | undefined = undefined>({ page, key, selector, container, mode, }: GetElementParams<T> & {
40
+ mode?: M;
41
+ }): GetElementReturnType<M>;
42
+ export {};