@uxf/localize 10.0.0 → 11.2.1
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.
package/package.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DateTimes, FormatDatetimeFunction, LocalizeConfigMap } from "../types";
|
|
2
2
|
export declare function createFormatDatetime<DT extends DateTimes, Locales extends string>(localizeConfigs: LocalizeConfigMap<DT, Locales>): FormatDatetimeFunction<DT, Locales>;
|
|
3
|
-
export declare function createUseFormatDatetime<DT extends DateTimes, Locales extends string>(localizeConfigs: LocalizeConfigMap<DT, Locales>): () => (value:
|
|
3
|
+
export declare function createUseFormatDatetime<DT extends DateTimes, Locales extends string>(localizeConfigs: LocalizeConfigMap<DT, Locales>): () => (value: import("../types").DateValue, format: DT) => string;
|
package/src/types.d.ts
CHANGED
|
@@ -40,10 +40,13 @@ export type FormatPercentageComponent = FC<{
|
|
|
40
40
|
roundingType?: RoundingType | null;
|
|
41
41
|
options?: FormatPercentageOptions;
|
|
42
42
|
}>;
|
|
43
|
-
export type
|
|
44
|
-
export type
|
|
43
|
+
export type DateString = `${number}-${number}-${number}`;
|
|
44
|
+
export type DateTimeString = `${number}-${number}-${number}T${number}:${number}:${number}+${number}:${number}`;
|
|
45
|
+
export type DateValue = Date | DateString | DateTimeString;
|
|
46
|
+
export type FormatDatetimeFunction<DT extends DateTimes, Locales extends string> = (locale: Locales, value: DateValue, format: DT) => string;
|
|
47
|
+
export type UseFormatDatetimeFunction<DT extends DateTimes> = () => (value: DateValue, format: DT) => string;
|
|
45
48
|
export type FormatDatetimeComponent<DT extends DateTimes> = FC<{
|
|
46
|
-
value:
|
|
49
|
+
value: DateValue;
|
|
47
50
|
format: DT;
|
|
48
51
|
}>;
|
|
49
52
|
export type CreateLocalizeReturn<DT extends DateTimes, Locales extends string> = {
|