@inploi/plugin-job-search 0.23.6 → 0.23.7

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.
Files changed (55) hide show
  1. package/cdn/index.js +1070 -0
  2. package/cdn/style.css +1 -0
  3. package/dist/components/alerts-button.d.ts +11 -0
  4. package/dist/components/button.d.ts +60 -0
  5. package/dist/components/current-value-tag.d.ts +10 -0
  6. package/dist/components/error-boundary.d.ts +23 -0
  7. package/dist/components/filter-content.active.d.ts +74 -0
  8. package/dist/components/filter-section.d.ts +13 -0
  9. package/dist/components/filter.d.ts +23 -0
  10. package/dist/components/icon.d.ts +28 -0
  11. package/dist/components/job-card.d.ts +13 -0
  12. package/dist/components/job-search.d.ts +24 -0
  13. package/dist/components/keyword-search.d.ts +5 -0
  14. package/dist/components/palette-debugger.d.ts +1 -0
  15. package/dist/components/results-section.d.ts +20 -0
  16. package/dist/components/skeleton-text.d.ts +3 -0
  17. package/dist/components/tag.d.ts +60 -0
  18. package/dist/datetime-3eccae90.cjs +1 -0
  19. package/dist/datetime-796d4b37.js +32 -0
  20. package/dist/index.cjs +7 -6204
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.js +3680 -4901
  23. package/dist/job-search.api.d.ts +6 -4
  24. package/dist/job-search.d.ts +3 -0
  25. package/dist/job-search.schemas.d.ts +3 -2
  26. package/dist/lib/cache-key.d.ts +7 -0
  27. package/dist/lib/cache-key.test.d.ts +1 -0
  28. package/dist/lib/currency.d.ts +10 -0
  29. package/dist/lib/currency.test.d.ts +1 -0
  30. package/dist/lib/datetime.d.ts +11 -0
  31. package/dist/lib/deep-set.d.ts +8 -0
  32. package/dist/lib/deep-set.test.d.ts +1 -0
  33. package/dist/lib/hooks.d.ts +8 -0
  34. package/dist/lib/match.d.ts +35 -0
  35. package/dist/lib/match.test.d.ts +1 -0
  36. package/dist/lib/translation.d.ts +44 -0
  37. package/dist/lib/translation.terms.d.ts +216 -0
  38. package/dist/lib/translation.test.d.ts +1 -0
  39. package/dist/lib/type-utils.d.ts +55 -0
  40. package/dist/lib/utils.d.ts +4 -0
  41. package/dist/mocks/browser.d.ts +1 -0
  42. package/dist/mocks/handlers.d.ts +15 -0
  43. package/dist/plugin-job-alerts-4b46b097.cjs +1050 -0
  44. package/dist/plugin-job-alerts-6f8dbd69.js +5613 -0
  45. package/dist/style/theme.d.ts +3 -0
  46. package/dist/style/theme.utils.d.ts +6 -0
  47. package/dist/style/tokens.d.ts +149 -0
  48. package/dist/style.css +1 -1742
  49. package/dist/utils.cjs +1 -18
  50. package/dist/utils.js +12 -13
  51. package/package.json +2 -2
  52. package/dist/datetime-5adbbd63.cjs +0 -55
  53. package/dist/datetime-ef341067.js +0 -56
  54. package/dist/plugin-job-alerts-2ce58f09.js +0 -6040
  55. package/dist/plugin-job-alerts-e8471004.cjs +0 -6040
@@ -2,8 +2,9 @@ import { ApiClient, Logger } from '@inploi/sdk';
2
2
  import { SWRResponse } from 'swr';
3
3
  import { Input, Output } from 'valibot';
4
4
  import { FilterValue } from './components/filter';
5
+ import { TFunction } from './lib/translation.terms';
5
6
 
6
- declare const JobSearchResponseSchema: import('valibot').SchemaWithTransform<import('valibot').ObjectSchema<{
7
+ declare const getJobSearchResponseSchema: (t: TFunction) => import('valibot').SchemaWithTransform<import('valibot').ObjectSchema<{
7
8
  data: import('valibot').ArraySchema<import('valibot').SchemaWithTransform<import('valibot').ObjectSchema<{
8
9
  id: import('valibot').NumberSchema<number>;
9
10
  company_name: import('valibot').StringSchema<string>;
@@ -273,8 +274,8 @@ declare const JobSearchResponseSchema: import('valibot').SchemaWithTransform<imp
273
274
  };
274
275
  }[];
275
276
  }>;
276
- export type JobSearchResponsePayloadInput = Input<typeof JobSearchResponseSchema>;
277
- export type JobSearchResponsePayloadOutput = Output<typeof JobSearchResponseSchema>;
277
+ export type JobSearchResponsePayloadInput = Input<ReturnType<typeof getJobSearchResponseSchema>>;
278
+ export type JobSearchResponsePayloadOutput = Output<ReturnType<typeof getJobSearchResponseSchema>>;
278
279
  export declare const getFilterValue: (filterValue: string | string[] | undefined) => string | string[] | null;
279
280
  export declare const filtersToPayload: (filters: Record<string, FilterValue | undefined>) => Record<string, string | string[] | null>;
280
281
  export declare const getAvailableFilters: ({ apiClient, filters, keyword, logger, signal, }: {
@@ -291,13 +292,14 @@ export declare const getAvailableFilters: ({ apiClient, filters, keyword, logger
291
292
  }[];
292
293
  }>;
293
294
  export type GetAvailableFiltersResponse = Awaited<ReturnType<typeof getAvailableFilters>>;
294
- export declare const getJobSearchResults: ({ apiClient, logger, signal, filters, keyword, page, }: {
295
+ export declare const getJobSearchResults: ({ apiClient, logger, signal, filters, keyword, page, t, }: {
295
296
  apiClient: ApiClient;
296
297
  logger: Logger;
297
298
  signal?: AbortSignal;
298
299
  filters: Record<string, FilterValue | undefined>;
299
300
  keyword?: string;
300
301
  page?: number;
302
+ t: TFunction;
301
303
  }) => Promise<{
302
304
  pagination: {
303
305
  total: number;
@@ -2,6 +2,7 @@ import { TargetedEvent } from 'preact/compat';
2
2
  import { getJobSearchResults } from './job-search.api.ts';
3
3
  import { FilterValue } from './components/filter.tsx';
4
4
  import { IconName } from './components/icon.tsx';
5
+ import { JobSearchTranslationTerms } from './lib/translation.terms.ts';
5
6
 
6
7
  type FontSettings = {
7
8
  fontFamily: string;
@@ -138,6 +139,8 @@ export type JobSearchPluginParams = {
138
139
  enableJobAlerts?: boolean;
139
140
  /** Enables searching for jobs by keyword */
140
141
  enableKeywordSearch?: boolean;
142
+ /** Translation terms */
143
+ terms?: JobSearchTranslationTerms;
141
144
  };
142
145
  export interface PrerenderJobSearchPluginParams extends JobSearchPluginParams {
143
146
  /** If true, the data needed to display the first page of results
@@ -1,4 +1,5 @@
1
1
  import { Output } from 'valibot';
2
+ import { TFunction } from './lib/translation.terms';
2
3
 
3
4
  export declare const AvailablePropertiesSchema: import('valibot').RecordSchema<import('valibot').StringSchema<string>, import('valibot').ArraySchema<import('valibot').ObjectSchema<{
4
5
  label: import('valibot').StringSchema<string>;
@@ -91,7 +92,7 @@ export declare const JobPayloadSchema: import('valibot').ObjectSchema<{
91
92
  town?: string | undefined;
92
93
  }>;
93
94
  export type JobPayloadSchema = Output<typeof JobPayloadSchema>;
94
- export declare const JobSchema: import('valibot').SchemaWithTransform<import('valibot').ObjectSchema<{
95
+ export declare const getJobSchema: (t: TFunction) => import('valibot').SchemaWithTransform<import('valibot').ObjectSchema<{
95
96
  id: import('valibot').NumberSchema<number>;
96
97
  company_name: import('valibot').StringSchema<string>;
97
98
  company_logo: import('valibot').NullableSchema<import('valibot').OptionalSchema<import('valibot').StringSchema<string>, undefined, string | undefined>, undefined, string | undefined>;
@@ -194,4 +195,4 @@ export declare const JobSchema: import('valibot').SchemaWithTransform<import('va
194
195
  town?: string | undefined;
195
196
  };
196
197
  }>;
197
- export type JobSchema = Output<typeof JobSchema>;
198
+ export type JobSchema = Output<ReturnType<typeof getJobSchema>>;
@@ -0,0 +1,7 @@
1
+ import { FilterValue } from '../components/filter';
2
+
3
+ export declare const cacheKey: (value: {
4
+ filter: Record<string, FilterValue | undefined>;
5
+ baseKey: string;
6
+ keyword: string | undefined;
7
+ }) => string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { JobPayloadSchema } from '../job-search.schemas';
2
+ import { TFunction } from './translation.terms';
3
+
4
+ export declare const getSalaryAsText: (params: {
5
+ salary: Pick<JobPayloadSchema, 'pay' | 'pay_min' | 'pay_mask' | 'pay_max' | 'pay_type' | 'pay_currency' | 'pay_display'>;
6
+ config: {
7
+ locales: string | string[] | undefined;
8
+ };
9
+ t: TFunction;
10
+ }) => string | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { TFunction } from './translation.terms';
2
+
3
+ type Params = {
4
+ from?: Date;
5
+ to: string | number | Date;
6
+ formatter?: Intl.RelativeTimeFormat;
7
+ t: TFunction;
8
+ };
9
+ /** From a date, calculates the relative time difference from now */
10
+ export declare const getRelativeTimeDifference: ({ from, to, formatter, t }: Params) => string;
11
+ export {};
@@ -0,0 +1,8 @@
1
+ type NestedObject = {
2
+ [key: string]: NestedObject | any;
3
+ };
4
+ /** Converts an object with dot separated keys to a nested object
5
+ * @example {"a.b.c": 1} -> {a: {b: {c: 1}}}
6
+ */
7
+ export declare function convertObject<T extends Record<string, any>>(input: T, transformValue?: (value: any) => any): NestedObject;
8
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare const useMediaQuery: (query: string) => boolean;
2
+ type ViewTrackingOptions = {
3
+ minViewTime?: number;
4
+ visibilityThreshold?: number | number[];
5
+ onView: () => void;
6
+ };
7
+ export declare const useViewTracking: (elementRef: React.RefObject<HTMLElement>, { minViewTime, visibilityThreshold, onView }: ViewTrackingOptions) => void;
8
+ export {};
@@ -0,0 +1,35 @@
1
+ /** Simple object pattern matching. A smaller, shittier version of ts-pattern */
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;
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
+ };
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>;
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>;
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>;
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>;
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>;
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>;
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>;
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>;
31
+ };
32
+ otherwise: <O_9 extends (subject: Exclude<M, P>) => any = () => never>(fallback?: O_9 | undefined) => ReturnType<Fn> | ReturnType<O_9>;
33
+ };
34
+ otherwise: <O_10 extends (subject: M) => any = () => never>(fallback?: O_10 | undefined) => ReturnType<O_10>;
35
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,44 @@
1
+ import { ComponentChildren } from 'preact';
2
+
3
+ type StringContains<Haystack extends string, Needle extends string> = Haystack extends `${string}${Needle}${string}` ? true : false;
4
+ type HintedString<KnownValues> = (string & {}) | KnownValues;
5
+ type TranslationWithPlurals = {
6
+ one: string;
7
+ other: string;
8
+ };
9
+ export type Terms = Record<string, string | TranslationWithPlurals>;
10
+ export type TranslationDict<TTerms extends Terms> = {
11
+ [K in keyof TTerms]: TTerms[K] extends TranslationWithPlurals ? {
12
+ [J in keyof TTerms[K]]: HintedString<TTerms[K][J]>;
13
+ } : HintedString<TTerms[K]>;
14
+ };
15
+ export declare const createTranslation: <const TTerms extends Terms>(defaultTerms: TTerms) => {
16
+ TranslationProvider: ({ terms, children, }: {
17
+ terms?: Partial<TranslationDict<TTerms>>;
18
+ children: ComponentChildren;
19
+ }) => import("preact").JSX.Element;
20
+ useTranslation: <T extends TTerms = TTerms>() => {
21
+ t: {
22
+ <T_1 extends { [K in keyof T]: T[K] extends TranslationWithPlurals ? K : StringContains<T[K] & string, "{{count}}"> extends true ? K : never; }[keyof T]>(key: T_1, options: {
23
+ count: number;
24
+ }): string;
25
+ <T_2 extends Exclude<keyof T, { [K in keyof T]: T[K] extends TranslationWithPlurals ? K : StringContains<T[K] & string, "{{count}}"> extends true ? K : never; }[keyof T]>>(key: T_2): string;
26
+ };
27
+ };
28
+ createTFunction: <T_3 extends TTerms = TTerms>(overrides: Partial<TranslationDict<TTerms>>) => {
29
+ <T_4 extends { [K_1 in keyof T_3]: T_3[K_1] extends TranslationWithPlurals ? K_1 : StringContains<T_3[K_1] & string, "{{count}}"> extends true ? K_1 : never; }[keyof T_3]>(key: T_4, options: {
30
+ count: number;
31
+ }): string;
32
+ <T_5 extends Exclude<keyof T_3, { [K_1 in keyof T_3]: T_3[K_1] extends TranslationWithPlurals ? K_1 : StringContains<T_3[K_1] & string, "{{count}}"> extends true ? K_1 : never; }[keyof T_3]>>(key: T_5): string;
33
+ };
34
+ };
35
+ export declare const createTranslateFunction: <const TTerms extends Terms>({ terms, overrides, }: {
36
+ terms: TTerms;
37
+ overrides?: Partial<TranslationDict<TTerms>>;
38
+ }) => {
39
+ <T extends { [K in keyof TTerms]: TTerms[K] extends TranslationWithPlurals ? K : StringContains<TTerms[K] & string, "{{count}}"> extends true ? K : never; }[keyof TTerms]>(key: T, options: {
40
+ count: number;
41
+ }): string;
42
+ <T_1 extends Exclude<keyof TTerms, { [K in keyof TTerms]: TTerms[K] extends TranslationWithPlurals ? K : StringContains<TTerms[K] & string, "{{count}}"> extends true ? K : never; }[keyof TTerms]>>(key: T_1): string;
43
+ };
44
+ export {};
@@ -0,0 +1,216 @@
1
+ export declare const TranslationProvider: ({ terms, children, }: {
2
+ terms?: Partial<import('./translation').TranslationDict<{
3
+ readonly type_to_search_jobs: "Type to search jobs";
4
+ readonly type_to_search: "Type to search";
5
+ readonly jobs_found: {
6
+ readonly one: "{{count}} job found";
7
+ readonly other: "{{count}} jobs found";
8
+ };
9
+ readonly no_jobs_found: "No jobs found";
10
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
11
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
12
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
13
+ readonly no_filter_options_available: "No filter options available.";
14
+ readonly clear: "Clear";
15
+ readonly selected: "selected";
16
+ readonly done: "Done";
17
+ readonly skip: "Skip";
18
+ readonly new: "NEW";
19
+ readonly posted: "Posted";
20
+ readonly retry: "Retry";
21
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
22
+ readonly load_more_count: "Load {{count}} more";
23
+ readonly of_remaining_count: "of {{count}} remaining";
24
+ readonly create_alert: "Create alert";
25
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
26
+ readonly today: "today";
27
+ readonly over_30_days_ago: "over 30 days ago";
28
+ readonly in_over_30_days: "in over 30 days";
29
+ readonly up_to: "Up to";
30
+ readonly from: "From";
31
+ readonly invalid_salary: "Invalid salary";
32
+ readonly competitive: "Competitive";
33
+ }>> | undefined;
34
+ children: import('preact').ComponentChildren;
35
+ }) => import("preact").JSX.Element, useTranslation: <T extends {
36
+ readonly type_to_search_jobs: "Type to search jobs";
37
+ readonly type_to_search: "Type to search";
38
+ readonly jobs_found: {
39
+ readonly one: "{{count}} job found";
40
+ readonly other: "{{count}} jobs found";
41
+ };
42
+ readonly no_jobs_found: "No jobs found";
43
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
44
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
45
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
46
+ readonly no_filter_options_available: "No filter options available.";
47
+ readonly clear: "Clear";
48
+ readonly selected: "selected";
49
+ readonly done: "Done";
50
+ readonly skip: "Skip";
51
+ readonly new: "NEW";
52
+ readonly posted: "Posted";
53
+ readonly retry: "Retry";
54
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
55
+ readonly load_more_count: "Load {{count}} more";
56
+ readonly of_remaining_count: "of {{count}} remaining";
57
+ readonly create_alert: "Create alert";
58
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
59
+ readonly today: "today";
60
+ readonly over_30_days_ago: "over 30 days ago";
61
+ readonly in_over_30_days: "in over 30 days";
62
+ readonly up_to: "Up to";
63
+ readonly from: "From";
64
+ readonly invalid_salary: "Invalid salary";
65
+ readonly competitive: "Competitive";
66
+ } = {
67
+ readonly type_to_search_jobs: "Type to search jobs";
68
+ readonly type_to_search: "Type to search";
69
+ readonly jobs_found: {
70
+ readonly one: "{{count}} job found";
71
+ readonly other: "{{count}} jobs found";
72
+ };
73
+ readonly no_jobs_found: "No jobs found";
74
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
75
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
76
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
77
+ readonly no_filter_options_available: "No filter options available.";
78
+ readonly clear: "Clear";
79
+ readonly selected: "selected";
80
+ readonly done: "Done";
81
+ readonly skip: "Skip";
82
+ readonly new: "NEW";
83
+ readonly posted: "Posted";
84
+ readonly retry: "Retry";
85
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
86
+ readonly load_more_count: "Load {{count}} more";
87
+ readonly of_remaining_count: "of {{count}} remaining";
88
+ readonly create_alert: "Create alert";
89
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
90
+ readonly today: "today";
91
+ readonly over_30_days_ago: "over 30 days ago";
92
+ readonly in_over_30_days: "in over 30 days";
93
+ readonly up_to: "Up to";
94
+ readonly from: "From";
95
+ readonly invalid_salary: "Invalid salary";
96
+ readonly competitive: "Competitive";
97
+ }>() => {
98
+ t: {
99
+ <T_2 extends { [K in keyof T]: T[K] extends {
100
+ one: string;
101
+ other: string;
102
+ } ? K : (T[K] & string extends infer T_1 ? T_1 extends T[K] & string ? T_1 extends `${string}{{count}}${string}` ? true : false : never : never) extends true ? K : never; }[keyof T]>(key: T_2, options: {
103
+ count: number;
104
+ }): string;
105
+ <T_3 extends Exclude<keyof T, { [K in keyof T]: T[K] extends {
106
+ one: string;
107
+ other: string;
108
+ } ? K : (T[K] & string extends infer T_1 ? T_1 extends T[K] & string ? T_1 extends `${string}{{count}}${string}` ? true : false : never : never) extends true ? K : never; }[keyof T]>>(key: T_3): string;
109
+ };
110
+ }, createTFunction: <T extends {
111
+ readonly type_to_search_jobs: "Type to search jobs";
112
+ readonly type_to_search: "Type to search";
113
+ readonly jobs_found: {
114
+ readonly one: "{{count}} job found";
115
+ readonly other: "{{count}} jobs found";
116
+ };
117
+ readonly no_jobs_found: "No jobs found";
118
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
119
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
120
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
121
+ readonly no_filter_options_available: "No filter options available.";
122
+ readonly clear: "Clear";
123
+ readonly selected: "selected";
124
+ readonly done: "Done";
125
+ readonly skip: "Skip";
126
+ readonly new: "NEW";
127
+ readonly posted: "Posted";
128
+ readonly retry: "Retry";
129
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
130
+ readonly load_more_count: "Load {{count}} more";
131
+ readonly of_remaining_count: "of {{count}} remaining";
132
+ readonly create_alert: "Create alert";
133
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
134
+ readonly today: "today";
135
+ readonly over_30_days_ago: "over 30 days ago";
136
+ readonly in_over_30_days: "in over 30 days";
137
+ readonly up_to: "Up to";
138
+ readonly from: "From";
139
+ readonly invalid_salary: "Invalid salary";
140
+ readonly competitive: "Competitive";
141
+ } = {
142
+ readonly type_to_search_jobs: "Type to search jobs";
143
+ readonly type_to_search: "Type to search";
144
+ readonly jobs_found: {
145
+ readonly one: "{{count}} job found";
146
+ readonly other: "{{count}} jobs found";
147
+ };
148
+ readonly no_jobs_found: "No jobs found";
149
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
150
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
151
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
152
+ readonly no_filter_options_available: "No filter options available.";
153
+ readonly clear: "Clear";
154
+ readonly selected: "selected";
155
+ readonly done: "Done";
156
+ readonly skip: "Skip";
157
+ readonly new: "NEW";
158
+ readonly posted: "Posted";
159
+ readonly retry: "Retry";
160
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
161
+ readonly load_more_count: "Load {{count}} more";
162
+ readonly of_remaining_count: "of {{count}} remaining";
163
+ readonly create_alert: "Create alert";
164
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
165
+ readonly today: "today";
166
+ readonly over_30_days_ago: "over 30 days ago";
167
+ readonly in_over_30_days: "in over 30 days";
168
+ readonly up_to: "Up to";
169
+ readonly from: "From";
170
+ readonly invalid_salary: "Invalid salary";
171
+ readonly competitive: "Competitive";
172
+ }>(overrides: Partial<import('./translation').TranslationDict<{
173
+ readonly type_to_search_jobs: "Type to search jobs";
174
+ readonly type_to_search: "Type to search";
175
+ readonly jobs_found: {
176
+ readonly one: "{{count}} job found";
177
+ readonly other: "{{count}} jobs found";
178
+ };
179
+ readonly no_jobs_found: "No jobs found";
180
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
181
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
182
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
183
+ readonly no_filter_options_available: "No filter options available.";
184
+ readonly clear: "Clear";
185
+ readonly selected: "selected";
186
+ readonly done: "Done";
187
+ readonly skip: "Skip";
188
+ readonly new: "NEW";
189
+ readonly posted: "Posted";
190
+ readonly retry: "Retry";
191
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
192
+ readonly load_more_count: "Load {{count}} more";
193
+ readonly of_remaining_count: "of {{count}} remaining";
194
+ readonly create_alert: "Create alert";
195
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
196
+ readonly today: "today";
197
+ readonly over_30_days_ago: "over 30 days ago";
198
+ readonly in_over_30_days: "in over 30 days";
199
+ readonly up_to: "Up to";
200
+ readonly from: "From";
201
+ readonly invalid_salary: "Invalid salary";
202
+ readonly competitive: "Competitive";
203
+ }>>) => {
204
+ <T_2 extends { [K in keyof T]: T[K] extends {
205
+ one: string;
206
+ other: string;
207
+ } ? K : (T[K] & string extends infer T_1 ? T_1 extends T[K] & string ? T_1 extends `${string}{{count}}${string}` ? true : false : never : never) extends true ? K : never; }[keyof T]>(key: T_2, options: {
208
+ count: number;
209
+ }): string;
210
+ <T_4 extends Exclude<keyof T, { [K in keyof T]: T[K] extends {
211
+ one: string;
212
+ other: string;
213
+ } ? K : (T[K] & string extends infer T_3 ? T_3 extends T[K] & string ? T_3 extends `${string}{{count}}${string}` ? true : false : never : never) extends true ? K : never; }[keyof T]>>(key: T_4): string;
214
+ };
215
+ export type TFunction = ReturnType<typeof useTranslation>['t'];
216
+ export type JobSearchTranslationTerms = Parameters<typeof TranslationProvider>[0]['terms'];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,55 @@
1
+ /**
2
+ * A type-safe way to get the keys and values of an object..
3
+ */
4
+ export declare const objectEntries: <TObj extends object>(obj: TObj) => [keyof TObj, TObj[keyof TObj]][];
5
+ export type NonEmptyString<T extends string> = T extends '' ? never : T;
6
+ export type NonEmptyArray<T> = [T, ...T[]];
7
+ /**
8
+ * Constructs a string type with type hints for known values.
9
+ */
10
+ export type HintedString<KnownValues extends string> = (string & {}) | KnownValues;
11
+ export type Flatten<T> = {
12
+ [K in keyof T]: T[K];
13
+ } & {};
14
+ export type WithRequired<T, K extends keyof T> = T & {
15
+ [P in K]-?: T[P];
16
+ };
17
+ /** Allows you to get a type from a union of types.
18
+ * @example Select<string | number, string> will return string. */
19
+ export type Select<T, U extends T> = U;
20
+ export type Maybe<T> = T | null | undefined;
21
+ export type PartialReadonly<T> = T | Readonly<T>;
22
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
23
+ export type Jsonify<T> = IsAny<T> extends true ? any : T extends ({
24
+ toJSON(): infer U;
25
+ }) ? U extends JsonValue ? U : unknown : T extends JsonPrimitive ? T : T extends string ? string : T extends number ? number : T extends boolean ? boolean : T extends Promise<unknown> ? EmptyObject : T extends Map<unknown, unknown> ? EmptyObject : T extends Set<unknown> ? EmptyObject : T extends TypedArray ? Record<string, number> : T extends NotJson ? never : T extends [] ? [] : T extends readonly [infer F, ...infer R] ? [NeverToNull<Jsonify<F>>, ...Jsonify<R>] : T extends readonly unknown[] ? NeverToNull<Jsonify<T[number]>>[] : T extends Record<keyof unknown, unknown> ? JsonifyObject<T> : unknown extends T ? unknown : never;
26
+ type ValueIsNotJson<T> = T extends NotJson ? true : false;
27
+ type IsNotJson<T> = {
28
+ [K in keyof T]-?: ValueIsNotJson<T[K]>;
29
+ };
30
+ type JsonifyValues<T> = {
31
+ [K in keyof T]: Jsonify<T[K]>;
32
+ };
33
+ type JsonifyObject<T extends Record<keyof unknown, unknown>> = {
34
+ [K in keyof T as unknown extends T[K] ? never : IsNotJson<T>[K] extends false ? K : never]: JsonifyValues<T>[K];
35
+ } & {
36
+ [K in keyof T as unknown extends T[K] ? K : IsNotJson<T>[K] extends false ? never : IsNotJson<T>[K] extends true ? never : K]?: JsonifyValues<T>[K];
37
+ };
38
+ type JsonPrimitive = string | number | boolean | null;
39
+ type JsonArray = JsonValue[] | readonly JsonValue[];
40
+ type JsonObject = {
41
+ [K in string]: JsonValue;
42
+ } & {
43
+ [K in string]?: JsonValue;
44
+ };
45
+ type JsonValue = JsonPrimitive | JsonObject | JsonArray;
46
+ type NotJson = undefined | symbol | AnyFunction;
47
+ type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
48
+ type AnyFunction = (...args: any[]) => unknown;
49
+ type NeverToNull<T> = [T] extends [never] ? null : T;
50
+ declare const emptyObjectSymbol: unique symbol;
51
+ export type EmptyObject = {
52
+ [emptyObjectSymbol]?: never;
53
+ };
54
+ type IsAny<T> = 0 extends 1 & T ? true : false;
55
+ export {};
@@ -0,0 +1,4 @@
1
+ import { FilterProperty } from '..';
2
+
3
+ /** Reads from search params provided and adds to list of filters. */
4
+ export declare const getStatefulPropertiesFromSearchParams: (properties: FilterProperty[], searchParams: URLSearchParams) => FilterProperty[];
@@ -0,0 +1 @@
1
+ export declare const worker: import('msw/browser').SetupWorker;
@@ -0,0 +1,15 @@
1
+ export declare const availableFiltersHandler: {
2
+ withResults: import('msw').HttpHandler;
3
+ malformed: import('msw').HttpHandler;
4
+ };
5
+ export declare const jobSearchHandler: {
6
+ withResults: import('msw').HttpHandler;
7
+ noResults: import('msw').HttpHandler;
8
+ /** Returns an invalid payload with a 200 code.
9
+ * E.g.: if the backend returns something incompatible with the frontend.
10
+ */
11
+ invalid_payload: import('msw').HttpHandler;
12
+ /** Returns a laravel-structured error */
13
+ exception: import('msw').HttpHandler;
14
+ };
15
+ export declare const browserHandlers: import('msw').HttpHandler[];