@inploi/plugin-job-search 3.0.5 → 3.1.0

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.
@@ -1,35 +1,35 @@
1
1
  /** Simple object pattern matching. A smaller, shittier version of ts-pattern */
2
2
  export declare const match: <M extends object>(subject: M) => {
3
- with: <const P extends Partial<M>, Fn extends (pattern: M & P extends infer T ? { [k in keyof T]: (M & P)[k]; } : never) => any>(pattern: P, fn: Fn) => {
4
- with: <const P_1 extends Partial<Exclude<M, P>>, Fn_1 extends (pattern: Exclude<M, P> & P_1 extends infer T_1 ? { [k_1 in keyof T_1]: (Exclude<M, P> & P_1)[k_1]; } : never) => any>(pattern: P_1, fn: Fn_1) => {
5
- with: <const P_2 extends Partial<Exclude<Exclude<M, P>, P_1>>, Fn_2 extends (pattern: Exclude<Exclude<M, P>, P_1> & P_2 extends infer T_2 ? { [k_2 in keyof T_2]: (Exclude<Exclude<M, P>, P_1> & P_2)[k_2]; } : never) => any>(pattern: P_2, fn: Fn_2) => {
6
- with: <const P_3 extends Partial<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>>, Fn_3 extends (pattern: Exclude<Exclude<Exclude<M, P>, P_1>, P_2> & P_3 extends infer T_3 ? { [k_3 in keyof T_3]: (Exclude<Exclude<Exclude<M, P>, P_1>, P_2> & P_3)[k_3]; } : never) => any>(pattern: P_3, fn: Fn_3) => {
7
- with: <const P_4 extends Partial<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>>, Fn_4 extends (pattern: Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3> & P_4 extends infer T_4 ? { [k_4 in keyof T_4]: (Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3> & P_4)[k_4]; } : never) => any>(pattern: P_4, fn: Fn_4) => {
8
- with: <const P_5 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>>, Fn_5 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4> & P_5 extends infer T_5 ? { [k_5 in keyof T_5]: (Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4> & P_5)[k_5]; } : never) => any>(pattern: P_5, fn: Fn_5) => {
9
- with: <const P_6 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>>, Fn_6 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5> & P_6 extends infer T_6 ? { [k_6 in keyof T_6]: (Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5> & P_6)[k_6]; } : never) => any>(pattern: P_6, fn: Fn_6) => {
10
- with: <const P_7 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>>, Fn_7 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6> & P_7 extends infer T_7 ? { [k_7 in keyof T_7]: (Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6> & P_7)[k_7]; } : never) => any>(pattern: P_7, fn: Fn_7) => {
11
- with: <const P_8 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>>, Fn_8 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7> & P_8 extends infer T_8 ? { [k_8 in keyof T_8]: (Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7> & P_8)[k_8]; } : never) => any>(pattern: P_8, fn: Fn_8) => {
12
- with: <const P_9 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8>>, Fn_9 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8> & P_9 extends infer T_9 ? { [k_9 in keyof T_9]: (Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8> & P_9)[k_9]; } : never) => any>(pattern: P_9, fn: Fn_9) => {
13
- with: <const P_10 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8>, P_9>>, Fn_10 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8>, P_9> & P_10 extends infer T_10 ? { [k_10 in keyof T_10]: (Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8>, P_9> & P_10)[k_10]; } : never) => any>(pattern: P_10, fn: Fn_10) => any;
3
+ with: <const P extends Partial<M>, Fn extends (pattern: M & P extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P, fn: Fn) => {
4
+ with: <const P_1 extends Partial<Exclude<M, P>>, Fn_1 extends (pattern: Exclude<M, P> & P_1 extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P_1, fn: Fn_1) => {
5
+ with: <const P_2 extends Partial<Exclude<Exclude<M, P>, P_1>>, Fn_2 extends (pattern: Exclude<Exclude<M, P>, P_1> & P_2 extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P_2, fn: Fn_2) => {
6
+ with: <const P_3 extends Partial<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>>, Fn_3 extends (pattern: Exclude<Exclude<Exclude<M, P>, P_1>, P_2> & P_3 extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P_3, fn: Fn_3) => {
7
+ with: <const P_4 extends Partial<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>>, Fn_4 extends (pattern: Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3> & P_4 extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P_4, fn: Fn_4) => {
8
+ with: <const P_5 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>>, Fn_5 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4> & P_5 extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P_5, fn: Fn_5) => {
9
+ with: <const P_6 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>>, Fn_6 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5> & P_6 extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P_6, fn: Fn_6) => {
10
+ with: <const P_7 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>>, Fn_7 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6> & P_7 extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P_7, fn: Fn_7) => {
11
+ with: <const P_8 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>>, Fn_8 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7> & P_8 extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P_8, fn: Fn_8) => {
12
+ with: <const P_9 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8>>, Fn_9 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8> & P_9 extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P_9, fn: Fn_9) => {
13
+ with: <const P_10 extends Partial<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8>, P_9>>, Fn_10 extends (pattern: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8>, P_9> & P_10 extends infer T ? { [k in keyof T]: T[k]; } : never) => any>(pattern: P_10, fn: Fn_10) => /*elided*/ any;
14
14
  otherwise: <O extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8>, P_9>) => any = () => never>(fallback?: O | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<Fn_5> | ReturnType<Fn_6> | ReturnType<Fn_7> | ReturnType<Fn_8> | ReturnType<Fn_9> | ReturnType<O>;
15
15
  };
16
- otherwise: <O_1 extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8>) => any = () => never>(fallback?: O_1 | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<Fn_5> | ReturnType<Fn_6> | ReturnType<Fn_7> | ReturnType<Fn_8> | ReturnType<O_1>;
16
+ otherwise: <O extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>, P_8>) => any = () => never>(fallback?: O | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<Fn_5> | ReturnType<Fn_6> | ReturnType<Fn_7> | ReturnType<Fn_8> | ReturnType<O>;
17
17
  };
18
- otherwise: <O_2 extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>) => any = () => never>(fallback?: O_2 | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<Fn_5> | ReturnType<Fn_6> | ReturnType<Fn_7> | ReturnType<O_2>;
18
+ otherwise: <O extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>, P_7>) => any = () => never>(fallback?: O | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<Fn_5> | ReturnType<Fn_6> | ReturnType<Fn_7> | ReturnType<O>;
19
19
  };
20
- otherwise: <O_3 extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>) => any = () => never>(fallback?: O_3 | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<Fn_5> | ReturnType<Fn_6> | ReturnType<O_3>;
20
+ otherwise: <O extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>, P_6>) => any = () => never>(fallback?: O | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<Fn_5> | ReturnType<Fn_6> | ReturnType<O>;
21
21
  };
22
- otherwise: <O_4 extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>) => any = () => never>(fallback?: O_4 | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<Fn_5> | ReturnType<O_4>;
22
+ otherwise: <O extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>, P_5>) => any = () => never>(fallback?: O | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<Fn_5> | ReturnType<O>;
23
23
  };
24
- otherwise: <O_5 extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>) => any = () => never>(fallback?: O_5 | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<O_5>;
24
+ otherwise: <O extends (subject: Exclude<Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>, P_4>) => any = () => never>(fallback?: O | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<Fn_4> | ReturnType<O>;
25
25
  };
26
- otherwise: <O_6 extends (subject: Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>) => any = () => never>(fallback?: O_6 | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<O_6>;
26
+ otherwise: <O extends (subject: Exclude<Exclude<Exclude<Exclude<M, P>, P_1>, P_2>, P_3>) => any = () => never>(fallback?: O | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<Fn_3> | ReturnType<O>;
27
27
  };
28
- otherwise: <O_7 extends (subject: Exclude<Exclude<Exclude<M, P>, P_1>, P_2>) => any = () => never>(fallback?: O_7 | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<O_7>;
28
+ otherwise: <O extends (subject: Exclude<Exclude<Exclude<M, P>, P_1>, P_2>) => any = () => never>(fallback?: O | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<Fn_2> | ReturnType<O>;
29
29
  };
30
- otherwise: <O_8 extends (subject: Exclude<Exclude<M, P>, P_1>) => any = () => never>(fallback?: O_8 | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<O_8>;
30
+ otherwise: <O extends (subject: Exclude<Exclude<M, P>, P_1>) => any = () => never>(fallback?: O | undefined) => ReturnType<Fn> | ReturnType<Fn_1> | ReturnType<O>;
31
31
  };
32
- otherwise: <O_9 extends (subject: Exclude<M, P>) => any = () => never>(fallback?: O_9 | undefined) => ReturnType<Fn> | ReturnType<O_9>;
32
+ otherwise: <O extends (subject: Exclude<M, P>) => any = () => never>(fallback?: O | undefined) => ReturnType<Fn> | ReturnType<O>;
33
33
  };
34
- otherwise: <O_10 extends (subject: M) => any = () => never>(fallback?: O_10 | undefined) => ReturnType<O_10>;
34
+ otherwise: <O extends (subject: M) => any = () => never>(fallback?: O | undefined) => ReturnType<O>;
35
35
  };
@@ -1,7 +1,4 @@
1
+ import { GetAvailableFiltersResponse } from '../job-search.api';
1
2
  import { FilterProperty } from '..';
2
3
 
3
- export declare const sortResults: <T extends {
4
- label: string;
5
- value: string;
6
- jobs: number;
7
- }[]>(results: T, sort?: FilterProperty['sortSuggestions']) => T[number][];
4
+ export declare const sortResults: <T extends GetAvailableFiltersResponse[string]>(results: T, sort?: FilterProperty["sortSuggestions"]) => T[number][];
@@ -4,12 +4,12 @@ import { FilterProperty, JobSearchPluginParams } from '..';
4
4
 
5
5
  /** Reads from search params provided and adds to list of filters. */
6
6
  export declare const getStatefulPropertiesFromSearchParams: (properties: FilterProperty[], searchParams: URLSearchParams) => FilterProperty[];
7
- export declare const getModeFromSearchParams: (searchParams: URLSearchParams) => JobSearchState['mode'];
8
- export declare const getViewFromSearchParams: (searchParams: URLSearchParams) => JobSearchState['view'];
7
+ export declare const getModeFromSearchParams: (searchParams: URLSearchParams) => JobSearchState["mode"];
8
+ export declare const getViewFromSearchParams: (searchParams: URLSearchParams) => JobSearchState["view"];
9
9
  /** Returns a function that can be used to get the initial state of the widget from the search params. */
10
10
  export declare const getWidgetStateFromSearchParams: ({ searchParams }: {
11
11
  searchParams: URLSearchParams;
12
- }) => JobSearchPluginParams['initialState'];
12
+ }) => JobSearchPluginParams["initialState"];
13
13
  /** Modifies the searchParams instance in place to reflect the current state of the widget. */
14
14
  export declare const setWidgetStateToSearchParams: (partialState: Partial<JobSearchState>, searchParams: URLSearchParams) => void;
15
15
  export declare const getGeolocationFromSearchParams: (searchParams: URLSearchParams) => GeoSearchFilter | undefined;