@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
- type Translator<ENTRY extends number = number, ARGS extends any[] = []> = (entry: string | ENTRY, ...args: ARGS) => Translation;
134
- export function translator<ENTRY extends number = number, ARGS extends any[] = []>(_translator: Translator<ENTRY, ARGS> | Dictionary): Translator<ENTRY, ARGS>;
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 Translator<number, [reference: Reference, ...any[]]>>(refType: EnumReferenceTypes, _translator: TRANSLATOR, color?: (entry: string | number) => TranslationImpl): TRANSLATOR extends Translator<infer ENTRY, [reference: Reference | undefined, ...infer ARGS]> ? Translator<ENTRY, ARGS> : never;
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wayward/types",
3
3
  "description": "TypeScript declarations for Wayward, used for modding.",
4
- "version": "2.14.0-beta.dev.20241202.1",
4
+ "version": "2.14.0-beta.dev.20241203.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",