@inploi/plugin-job-search 0.23.6 → 0.24.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.
Files changed (59) 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 +29 -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/mode-switch.d.ts +9 -0
  15. package/dist/components/natural-language-section.d.ts +8 -0
  16. package/dist/components/palette-debugger.d.ts +1 -0
  17. package/dist/components/results-section.d.ts +21 -0
  18. package/dist/components/roving-text.d.ts +6 -0
  19. package/dist/components/skeleton-text.d.ts +3 -0
  20. package/dist/components/tag.d.ts +60 -0
  21. package/dist/datetime-3eccae90.cjs +1 -0
  22. package/dist/datetime-796d4b37.js +32 -0
  23. package/dist/index.cjs +7 -6204
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.js +3893 -4910
  26. package/dist/job-search.api.d.ts +20 -5
  27. package/dist/job-search.d.ts +11 -0
  28. package/dist/job-search.schemas.d.ts +9 -2
  29. package/dist/job-search.state.d.ts +1 -0
  30. package/dist/lib/cache-key.d.ts +7 -0
  31. package/dist/lib/cache-key.test.d.ts +1 -0
  32. package/dist/lib/currency.d.ts +10 -0
  33. package/dist/lib/currency.test.d.ts +1 -0
  34. package/dist/lib/datetime.d.ts +11 -0
  35. package/dist/lib/deep-set.d.ts +8 -0
  36. package/dist/lib/deep-set.test.d.ts +1 -0
  37. package/dist/lib/hooks.d.ts +8 -0
  38. package/dist/lib/match.d.ts +35 -0
  39. package/dist/lib/match.test.d.ts +1 -0
  40. package/dist/lib/translation.d.ts +44 -0
  41. package/dist/lib/translation.terms.d.ts +246 -0
  42. package/dist/lib/translation.test.d.ts +1 -0
  43. package/dist/lib/type-utils.d.ts +55 -0
  44. package/dist/lib/utils.d.ts +4 -0
  45. package/dist/mocks/browser.d.ts +1 -0
  46. package/dist/mocks/handlers.d.ts +15 -0
  47. package/dist/plugin-job-alerts-4b46b097.cjs +1050 -0
  48. package/dist/plugin-job-alerts-6f8dbd69.js +5613 -0
  49. package/dist/style/theme.d.ts +3 -0
  50. package/dist/style/theme.utils.d.ts +6 -0
  51. package/dist/style/tokens.d.ts +149 -0
  52. package/dist/style.css +1 -1742
  53. package/dist/utils.cjs +1 -18
  54. package/dist/utils.js +12 -13
  55. package/package.json +8 -6
  56. package/dist/datetime-5adbbd63.cjs +0 -55
  57. package/dist/datetime-ef341067.js +0 -56
  58. package/dist/plugin-job-alerts-2ce58f09.js +0 -6040
  59. 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>;
@@ -33,6 +34,7 @@ declare const JobSearchResponseSchema: import('valibot').SchemaWithTransform<imp
33
34
  town: import('valibot').OptionalSchema<import('valibot').StringSchema<string>, undefined, string | undefined>;
34
35
  city: import('valibot').NullableSchema<import('valibot').StringSchema<string>, undefined, string | null>;
35
36
  country: import('valibot').NullableSchema<import('valibot').StringSchema<string>, undefined, string | null>;
37
+ vector_distance: import('valibot').OptionalSchema<import('valibot').NullableSchema<import('valibot').StringSchema<string>, undefined, string | null>, undefined, string | null | undefined>;
36
38
  }, undefined, {
37
39
  id: number;
38
40
  company_name: string;
@@ -60,6 +62,7 @@ declare const JobSearchResponseSchema: import('valibot').SchemaWithTransform<imp
60
62
  company_logo?: string | undefined;
61
63
  skills?: string | undefined;
62
64
  town?: string | undefined;
65
+ vector_distance?: string | null | undefined;
63
66
  }>, {
64
67
  id: number;
65
68
  createdAt: string | null;
@@ -105,7 +108,9 @@ declare const JobSearchResponseSchema: import('valibot').SchemaWithTransform<imp
105
108
  company_logo?: string | undefined;
106
109
  skills?: string | undefined;
107
110
  town?: string | undefined;
111
+ vector_distance?: string | null | undefined;
108
112
  };
113
+ match: string | null;
109
114
  }>, {
110
115
  id: number;
111
116
  createdAt: string | null;
@@ -151,7 +156,9 @@ declare const JobSearchResponseSchema: import('valibot').SchemaWithTransform<imp
151
156
  company_logo?: string | undefined;
152
157
  skills?: string | undefined;
153
158
  town?: string | undefined;
159
+ vector_distance?: string | null | undefined;
154
160
  };
161
+ match: string | null;
155
162
  }[]>;
156
163
  pagination: import('valibot').ObjectSchema<{
157
164
  total: import('valibot').NumberSchema<number>;
@@ -210,7 +217,9 @@ declare const JobSearchResponseSchema: import('valibot').SchemaWithTransform<imp
210
217
  company_logo?: string | undefined;
211
218
  skills?: string | undefined;
212
219
  town?: string | undefined;
220
+ vector_distance?: string | null | undefined;
213
221
  };
222
+ match: string | null;
214
223
  }[];
215
224
  pagination: {
216
225
  total: number;
@@ -270,11 +279,13 @@ declare const JobSearchResponseSchema: import('valibot').SchemaWithTransform<imp
270
279
  company_logo?: string | undefined;
271
280
  skills?: string | undefined;
272
281
  town?: string | undefined;
282
+ vector_distance?: string | null | undefined;
273
283
  };
284
+ match: string | null;
274
285
  }[];
275
286
  }>;
276
- export type JobSearchResponsePayloadInput = Input<typeof JobSearchResponseSchema>;
277
- export type JobSearchResponsePayloadOutput = Output<typeof JobSearchResponseSchema>;
287
+ export type JobSearchResponsePayloadInput = Input<ReturnType<typeof getJobSearchResponseSchema>>;
288
+ export type JobSearchResponsePayloadOutput = Output<ReturnType<typeof getJobSearchResponseSchema>>;
278
289
  export declare const getFilterValue: (filterValue: string | string[] | undefined) => string | string[] | null;
279
290
  export declare const filtersToPayload: (filters: Record<string, FilterValue | undefined>) => Record<string, string | string[] | null>;
280
291
  export declare const getAvailableFilters: ({ apiClient, filters, keyword, logger, signal, }: {
@@ -291,13 +302,15 @@ export declare const getAvailableFilters: ({ apiClient, filters, keyword, logger
291
302
  }[];
292
303
  }>;
293
304
  export type GetAvailableFiltersResponse = Awaited<ReturnType<typeof getAvailableFilters>>;
294
- export declare const getJobSearchResults: ({ apiClient, logger, signal, filters, keyword, page, }: {
305
+ export declare const getJobSearchResults: ({ apiClient, logger, signal, filters, query, page, t, mode, }: {
295
306
  apiClient: ApiClient;
296
307
  logger: Logger;
297
308
  signal?: AbortSignal;
298
309
  filters: Record<string, FilterValue | undefined>;
299
- keyword?: string;
310
+ query?: string;
300
311
  page?: number;
312
+ t: TFunction;
313
+ mode: 'query' | 'vector';
301
314
  }) => Promise<{
302
315
  pagination: {
303
316
  total: number;
@@ -350,7 +363,9 @@ export declare const getJobSearchResults: ({ apiClient, logger, signal, filters,
350
363
  company_logo?: string | undefined;
351
364
  skills?: string | undefined;
352
365
  town?: string | undefined;
366
+ vector_distance?: string | null | undefined;
353
367
  };
368
+ match: string | null;
354
369
  }[];
355
370
  }>;
356
371
  export type GetJobSearchResponse = Awaited<ReturnType<typeof getJobSearchResults>>;
@@ -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,14 @@ 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;
144
+ naturalLanguageSearch?: {
145
+ /** Enables searching for jobs by natural language */
146
+ enabled: boolean;
147
+ /** Suggestion searches */
148
+ suggestions: string[];
149
+ };
141
150
  };
142
151
  export interface PrerenderJobSearchPluginParams extends JobSearchPluginParams {
143
152
  /** If true, the data needed to display the first page of results
@@ -222,7 +231,9 @@ export declare const jobSearchPlugin: () => ({ apiClient, logger, analytics }: {
222
231
  company_logo?: string | undefined;
223
232
  skills?: string | undefined;
224
233
  town?: string | undefined;
234
+ vector_distance?: string | null | undefined;
225
235
  };
236
+ match: string | null;
226
237
  }[];
227
238
  };
228
239
  } | undefined;
@@ -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>;
@@ -62,6 +63,7 @@ export declare const JobPayloadSchema: import('valibot').ObjectSchema<{
62
63
  town: import('valibot').OptionalSchema<import('valibot').StringSchema<string>, undefined, string | undefined>;
63
64
  city: import('valibot').NullableSchema<import('valibot').StringSchema<string>, undefined, string | null>;
64
65
  country: import('valibot').NullableSchema<import('valibot').StringSchema<string>, undefined, string | null>;
66
+ vector_distance: import('valibot').OptionalSchema<import('valibot').NullableSchema<import('valibot').StringSchema<string>, undefined, string | null>, undefined, string | null | undefined>;
65
67
  }, undefined, {
66
68
  id: number;
67
69
  company_name: string;
@@ -89,9 +91,10 @@ export declare const JobPayloadSchema: import('valibot').ObjectSchema<{
89
91
  company_logo?: string | undefined;
90
92
  skills?: string | undefined;
91
93
  town?: string | undefined;
94
+ vector_distance?: string | null | undefined;
92
95
  }>;
93
96
  export type JobPayloadSchema = Output<typeof JobPayloadSchema>;
94
- export declare const JobSchema: import('valibot').SchemaWithTransform<import('valibot').ObjectSchema<{
97
+ export declare const getJobSchema: (t: TFunction) => import('valibot').SchemaWithTransform<import('valibot').ObjectSchema<{
95
98
  id: import('valibot').NumberSchema<number>;
96
99
  company_name: import('valibot').StringSchema<string>;
97
100
  company_logo: import('valibot').NullableSchema<import('valibot').OptionalSchema<import('valibot').StringSchema<string>, undefined, string | undefined>, undefined, string | undefined>;
@@ -120,6 +123,7 @@ export declare const JobSchema: import('valibot').SchemaWithTransform<import('va
120
123
  town: import('valibot').OptionalSchema<import('valibot').StringSchema<string>, undefined, string | undefined>;
121
124
  city: import('valibot').NullableSchema<import('valibot').StringSchema<string>, undefined, string | null>;
122
125
  country: import('valibot').NullableSchema<import('valibot').StringSchema<string>, undefined, string | null>;
126
+ vector_distance: import('valibot').OptionalSchema<import('valibot').NullableSchema<import('valibot').StringSchema<string>, undefined, string | null>, undefined, string | null | undefined>;
123
127
  }, undefined, {
124
128
  id: number;
125
129
  company_name: string;
@@ -147,6 +151,7 @@ export declare const JobSchema: import('valibot').SchemaWithTransform<import('va
147
151
  company_logo?: string | undefined;
148
152
  skills?: string | undefined;
149
153
  town?: string | undefined;
154
+ vector_distance?: string | null | undefined;
150
155
  }>, {
151
156
  id: number;
152
157
  createdAt: string | null;
@@ -192,6 +197,8 @@ export declare const JobSchema: import('valibot').SchemaWithTransform<import('va
192
197
  company_logo?: string | undefined;
193
198
  skills?: string | undefined;
194
199
  town?: string | undefined;
200
+ vector_distance?: string | null | undefined;
195
201
  };
202
+ match: string | null;
196
203
  }>;
197
- export type JobSchema = Output<typeof JobSchema>;
204
+ export type JobSchema = Output<ReturnType<typeof getJobSchema>>;
@@ -1,3 +1,4 @@
1
1
  export declare const store: {
2
2
  keyword$: import('@preact/signals').Signal<string | undefined>;
3
+ mode$: import('@preact/signals').Signal<"simple" | "advanced">;
3
4
  };
@@ -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,246 @@
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
+ readonly natural_language_input: "Type anything";
34
+ readonly great_match: "Great match";
35
+ readonly advanced_mode: "Filters";
36
+ readonly simple_mode: "Hide filters";
37
+ readonly ai_disclaimer: "Results may not be perfect. AI-powered search can occasionally suggest unrelated content.";
38
+ }>> | undefined;
39
+ children: import('preact').ComponentChildren;
40
+ }) => import("preact").JSX.Element, useTranslation: <T extends {
41
+ readonly type_to_search_jobs: "Type to search jobs";
42
+ readonly type_to_search: "Type to search";
43
+ readonly jobs_found: {
44
+ readonly one: "{{count}} job found";
45
+ readonly other: "{{count}} jobs found";
46
+ };
47
+ readonly no_jobs_found: "No jobs found";
48
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
49
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
50
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
51
+ readonly no_filter_options_available: "No filter options available.";
52
+ readonly clear: "Clear";
53
+ readonly selected: "selected";
54
+ readonly done: "Done";
55
+ readonly skip: "Skip";
56
+ readonly new: "NEW";
57
+ readonly posted: "Posted";
58
+ readonly retry: "Retry";
59
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
60
+ readonly load_more_count: "Load {{count}} more";
61
+ readonly of_remaining_count: "of {{count}} remaining";
62
+ readonly create_alert: "Create alert";
63
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
64
+ readonly today: "today";
65
+ readonly over_30_days_ago: "over 30 days ago";
66
+ readonly in_over_30_days: "in over 30 days";
67
+ readonly up_to: "Up to";
68
+ readonly from: "From";
69
+ readonly invalid_salary: "Invalid salary";
70
+ readonly competitive: "Competitive";
71
+ readonly natural_language_input: "Type anything";
72
+ readonly great_match: "Great match";
73
+ readonly advanced_mode: "Filters";
74
+ readonly simple_mode: "Hide filters";
75
+ readonly ai_disclaimer: "Results may not be perfect. AI-powered search can occasionally suggest unrelated content.";
76
+ } = {
77
+ readonly type_to_search_jobs: "Type to search jobs";
78
+ readonly type_to_search: "Type to search";
79
+ readonly jobs_found: {
80
+ readonly one: "{{count}} job found";
81
+ readonly other: "{{count}} jobs found";
82
+ };
83
+ readonly no_jobs_found: "No jobs found";
84
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
85
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
86
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
87
+ readonly no_filter_options_available: "No filter options available.";
88
+ readonly clear: "Clear";
89
+ readonly selected: "selected";
90
+ readonly done: "Done";
91
+ readonly skip: "Skip";
92
+ readonly new: "NEW";
93
+ readonly posted: "Posted";
94
+ readonly retry: "Retry";
95
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
96
+ readonly load_more_count: "Load {{count}} more";
97
+ readonly of_remaining_count: "of {{count}} remaining";
98
+ readonly create_alert: "Create alert";
99
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
100
+ readonly today: "today";
101
+ readonly over_30_days_ago: "over 30 days ago";
102
+ readonly in_over_30_days: "in over 30 days";
103
+ readonly up_to: "Up to";
104
+ readonly from: "From";
105
+ readonly invalid_salary: "Invalid salary";
106
+ readonly competitive: "Competitive";
107
+ readonly natural_language_input: "Type anything";
108
+ readonly great_match: "Great match";
109
+ readonly advanced_mode: "Filters";
110
+ readonly simple_mode: "Hide filters";
111
+ readonly ai_disclaimer: "Results may not be perfect. AI-powered search can occasionally suggest unrelated content.";
112
+ }>() => {
113
+ t: {
114
+ <T_2 extends { [K in keyof T]: T[K] extends {
115
+ one: string;
116
+ other: string;
117
+ } ? 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: {
118
+ count: number;
119
+ }): string;
120
+ <T_3 extends Exclude<keyof T, { [K in keyof T]: T[K] extends {
121
+ one: string;
122
+ other: string;
123
+ } ? 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;
124
+ };
125
+ }, createTFunction: <T extends {
126
+ readonly type_to_search_jobs: "Type to search jobs";
127
+ readonly type_to_search: "Type to search";
128
+ readonly jobs_found: {
129
+ readonly one: "{{count}} job found";
130
+ readonly other: "{{count}} jobs found";
131
+ };
132
+ readonly no_jobs_found: "No jobs found";
133
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
134
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
135
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
136
+ readonly no_filter_options_available: "No filter options available.";
137
+ readonly clear: "Clear";
138
+ readonly selected: "selected";
139
+ readonly done: "Done";
140
+ readonly skip: "Skip";
141
+ readonly new: "NEW";
142
+ readonly posted: "Posted";
143
+ readonly retry: "Retry";
144
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
145
+ readonly load_more_count: "Load {{count}} more";
146
+ readonly of_remaining_count: "of {{count}} remaining";
147
+ readonly create_alert: "Create alert";
148
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
149
+ readonly today: "today";
150
+ readonly over_30_days_ago: "over 30 days ago";
151
+ readonly in_over_30_days: "in over 30 days";
152
+ readonly up_to: "Up to";
153
+ readonly from: "From";
154
+ readonly invalid_salary: "Invalid salary";
155
+ readonly competitive: "Competitive";
156
+ readonly natural_language_input: "Type anything";
157
+ readonly great_match: "Great match";
158
+ readonly advanced_mode: "Filters";
159
+ readonly simple_mode: "Hide filters";
160
+ readonly ai_disclaimer: "Results may not be perfect. AI-powered search can occasionally suggest unrelated content.";
161
+ } = {
162
+ readonly type_to_search_jobs: "Type to search jobs";
163
+ readonly type_to_search: "Type to search";
164
+ readonly jobs_found: {
165
+ readonly one: "{{count}} job found";
166
+ readonly other: "{{count}} jobs found";
167
+ };
168
+ readonly no_jobs_found: "No jobs found";
169
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
170
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
171
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
172
+ readonly no_filter_options_available: "No filter options available.";
173
+ readonly clear: "Clear";
174
+ readonly selected: "selected";
175
+ readonly done: "Done";
176
+ readonly skip: "Skip";
177
+ readonly new: "NEW";
178
+ readonly posted: "Posted";
179
+ readonly retry: "Retry";
180
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
181
+ readonly load_more_count: "Load {{count}} more";
182
+ readonly of_remaining_count: "of {{count}} remaining";
183
+ readonly create_alert: "Create alert";
184
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
185
+ readonly today: "today";
186
+ readonly over_30_days_ago: "over 30 days ago";
187
+ readonly in_over_30_days: "in over 30 days";
188
+ readonly up_to: "Up to";
189
+ readonly from: "From";
190
+ readonly invalid_salary: "Invalid salary";
191
+ readonly competitive: "Competitive";
192
+ readonly natural_language_input: "Type anything";
193
+ readonly great_match: "Great match";
194
+ readonly advanced_mode: "Filters";
195
+ readonly simple_mode: "Hide filters";
196
+ readonly ai_disclaimer: "Results may not be perfect. AI-powered search can occasionally suggest unrelated content.";
197
+ }>(overrides: Partial<import('./translation').TranslationDict<{
198
+ readonly type_to_search_jobs: "Type to search jobs";
199
+ readonly type_to_search: "Type to search";
200
+ readonly jobs_found: {
201
+ readonly one: "{{count}} job found";
202
+ readonly other: "{{count}} jobs found";
203
+ };
204
+ readonly no_jobs_found: "No jobs found";
205
+ readonly no_jobs_found_description: "We could not find any jobs matching your filtering criteria.";
206
+ readonly jobs_loading_error: "We’re having trouble loading available jobs.";
207
+ readonly filters_loading_error: "We’re having trouble loading available filters.";
208
+ readonly no_filter_options_available: "No filter options available.";
209
+ readonly clear: "Clear";
210
+ readonly selected: "selected";
211
+ readonly done: "Done";
212
+ readonly skip: "Skip";
213
+ readonly new: "NEW";
214
+ readonly posted: "Posted";
215
+ readonly retry: "Retry";
216
+ readonly widget_unavailable: "Sorry, this widget is unavailable at the moment.";
217
+ readonly load_more_count: "Load {{count}} more";
218
+ readonly of_remaining_count: "of {{count}} remaining";
219
+ readonly create_alert: "Create alert";
220
+ readonly alert_header_text: "You will be alerted for new jobs matching the filters currently set";
221
+ readonly today: "today";
222
+ readonly over_30_days_ago: "over 30 days ago";
223
+ readonly in_over_30_days: "in over 30 days";
224
+ readonly up_to: "Up to";
225
+ readonly from: "From";
226
+ readonly invalid_salary: "Invalid salary";
227
+ readonly competitive: "Competitive";
228
+ readonly natural_language_input: "Type anything";
229
+ readonly great_match: "Great match";
230
+ readonly advanced_mode: "Filters";
231
+ readonly simple_mode: "Hide filters";
232
+ readonly ai_disclaimer: "Results may not be perfect. AI-powered search can occasionally suggest unrelated content.";
233
+ }>>) => {
234
+ <T_2 extends { [K in keyof T]: T[K] extends {
235
+ one: string;
236
+ other: string;
237
+ } ? 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: {
238
+ count: number;
239
+ }): string;
240
+ <T_4 extends Exclude<keyof T, { [K in keyof T]: T[K] extends {
241
+ one: string;
242
+ other: string;
243
+ } ? 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;
244
+ };
245
+ export type TFunction = ReturnType<typeof useTranslation>['t'];
246
+ export type JobSearchTranslationTerms = Parameters<typeof TranslationProvider>[0]['terms'];
@@ -0,0 +1 @@
1
+ export {};