Skip to content

Commit 3221e58

Browse files
committed
feat: add i18n keysets types
1 parent 6ec506b commit 3221e58

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

src/components/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ export * from './RangeDateField';
1010
export * from './RelativeRangeDatePicker';
1111

1212
export type {RangeValue} from './types';
13+
14+
export type {Keysets, PartialKeysets} from './types/i18n';

src/components/types/i18n.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import type {i18n as CalendarKeyset} from '../CalendarView/i18n';
2+
import type {i18n as DateFieldKeyset} from '../DateField/i18n';
3+
import type {i18n as DatePickerKeyset} from '../DatePicker/i18n';
4+
import type {i18n as RangeDateSelectionKeyset} from '../RangeDateSelection/i18n';
5+
import type {i18n as RelativeDatePickerKeyset} from '../RelativeDatePicker/i18n';
6+
import type {i18n as RelativeRangeDatePickerControlKeyset} from '../RelativeRangeDatePicker/components/Control/i18n';
7+
import type {i18n as RelativeRangeDatePickerFormKeyset} from '../RelativeRangeDatePicker/components/PickerDialog/i18n';
8+
import type {i18n as RelativeRangeDatePickerPresetsKeyset} from '../RelativeRangeDatePicker/components/Presets/i18n';
9+
import type {i18n as RelativeRangeDatePickerZonesKeyset} from '../RelativeRangeDatePicker/components/Zones/i18n';
10+
import type {i18n as RelativeRangeDatePickerKeyset} from '../RelativeRangeDatePicker/i18n';
11+
import type {i18n as ValidationKeyset} from '../utils/validation/i18n';
12+
13+
/* DeepPartial with depth limitation up to 9 */
14+
type DeepPartial<T, N extends number = 9> = N extends 0
15+
? T
16+
: Partial<{[P in keyof T]: DeepPartial<T[P], [never, 0, 1, 2, 3, 4, 5, 6, 7, 8][N]>}>;
17+
18+
export type Keysets = typeof CalendarKeyset.keysetData &
19+
typeof DateFieldKeyset.keysetData &
20+
typeof DatePickerKeyset.keysetData &
21+
typeof RangeDateSelectionKeyset.keysetData &
22+
typeof RelativeDatePickerKeyset.keysetData &
23+
typeof RelativeRangeDatePickerKeyset.keysetData &
24+
typeof RelativeRangeDatePickerFormKeyset.keysetData &
25+
typeof RelativeRangeDatePickerPresetsKeyset.keysetData &
26+
typeof RelativeRangeDatePickerZonesKeyset.keysetData &
27+
typeof RelativeRangeDatePickerControlKeyset.keysetData &
28+
typeof ValidationKeyset.keysetData;
29+
export type PartialKeysets = DeepPartial<Keysets, 2>;

0 commit comments

Comments
 (0)