@wayward/types 2.14.0-beta.dev.20241202.1 → 2.14.0-beta.dev.20241203.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.
|
@@ -31,9 +31,7 @@ export interface IMagicalSubProperty<T extends number> {
|
|
|
31
31
|
value: number;
|
|
32
32
|
}>;
|
|
33
33
|
}
|
|
34
|
-
export type MagicalProperty<T extends MagicalPropertyType> = MagicalPropertyTypeSubTypeMap extends
|
|
35
|
-
[key in T]: any;
|
|
36
|
-
} ? IMagicalSubProperty<MagicalPropertyTypeSubTypeMap[T]> : IMagicalProperty;
|
|
34
|
+
export type MagicalProperty<T extends MagicalPropertyType> = MagicalPropertyTypeSubTypeMap extends Record<T, any> ? IMagicalSubProperty<MagicalPropertyTypeSubTypeMap[T]> : IMagicalProperty;
|
|
37
35
|
type MagicalNormalPropertyEntry = {
|
|
38
36
|
type: MagicalNormalPropertyTypes;
|
|
39
37
|
value: number;
|
|
@@ -130,10 +130,14 @@ declare namespace Translation {
|
|
|
130
130
|
type: number;
|
|
131
131
|
renamed?: string | ISerializedTranslation;
|
|
132
132
|
}, count?: number, article?: Article, showRenamedQuotes?: boolean, preArticleReformatters?: [ArrayOr<TranslationReformatter>, ...TranslationArg[]]): Translation;
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
interface Translator<ENTRY extends number = number, ARGS extends any[] = []> {
|
|
134
|
+
(entry: string | ENTRY, ...args: ARGS): Translation;
|
|
135
|
+
(entry?: string | ENTRY, ...args: ARGS): Translation | undefined;
|
|
136
|
+
}
|
|
137
|
+
type TranslatorImpl<ENTRY extends number = number, ARGS extends any[] = []> = (entry?: string | ENTRY, ...args: ARGS) => Translation | undefined;
|
|
138
|
+
export function translator<ENTRY extends number = number, ARGS extends any[] = []>(_translator: TranslatorImpl<ENTRY, ARGS> | Dictionary): Translator<ENTRY, ARGS>;
|
|
135
139
|
export function refTranslator<ENTRY extends number = number>(refType: EnumReferenceTypes, dictionary: SupplierOr<Dictionary, [number]>, color?: (entry: string | ENTRY) => TranslationImpl): Translator<ENTRY, [color?: boolean]>;
|
|
136
|
-
export function customRefTranslator<TRANSLATOR extends
|
|
140
|
+
export function customRefTranslator<TRANSLATOR extends TranslatorImpl<number, [reference: Reference, ...any[]]>>(refType: EnumReferenceTypes, _translator: TRANSLATOR, color?: (entry: string | number) => TranslationImpl): TRANSLATOR extends TranslatorImpl<infer ENTRY, [reference: Reference | undefined, ...infer ARGS]> ? Translator<ENTRY, ARGS> : never;
|
|
137
141
|
export const empty: () => Translation;
|
|
138
142
|
export const sentence: () => Translation;
|
|
139
143
|
export const count: (amount: number, noun?: TranslationArg) => Translation;
|
package/package.json
CHANGED