@intlify/core-base 10.0.0-beta.6 → 10.0.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.
@@ -328,9 +328,13 @@ export declare type DefaultCoreLocaleMessageSchema<Schema = RemoveIndexSignature
328
328
  export declare interface DefineCoreLocaleMessage extends LocaleMessage<string> {
329
329
  }
330
330
 
331
- declare type ExtractToStringFunction<T> = T[ExtractToStringKey<T>];
331
+ export declare type EmptyObject = {
332
+ [emptyObjectSymbol]?: never;
333
+ };
334
+
335
+ declare const emptyObjectSymbol: unique symbol;
332
336
 
333
- declare type ExtractToStringKey<T> = Extract<keyof T, 'toString'>;
337
+ export declare type ExtractToStringKey<T> = Extract<keyof T, 'toString'>;
334
338
 
335
339
  /** @VueI18nGeneral */
336
340
  export declare type FallbackLocale = Locale | Locale[] | {
@@ -431,7 +435,9 @@ export declare function initI18nDevTools(i18n: unknown, version: string, meta?:
431
435
 
432
436
  /* Excluded from this release type: isAlmostSameLocale */
433
437
 
434
- export declare type IsEmptyObject<T> = IsNever<keyof T> extends true ? true : false;
438
+ export declare type IsEmptyObject<T> = T extends {
439
+ [emptyObjectSymbol]?: never;
440
+ } ? true : false;
435
441
 
436
442
  /* Excluded from this release type: isImplicitFallback */
437
443
 
@@ -441,10 +447,16 @@ export declare const isMessageFunction: <T>(val: unknown) => val is MessageFunct
441
447
 
442
448
  export declare type IsNever<T> = [T] extends [never] ? true : false;
443
449
 
450
+ export declare type IsObject<T> = IsTuple<T> extends true ? false : [T] extends [object] ? true : false;
451
+
452
+ export declare type IsRecord<T> = IsTuple<T> extends true ? false : [T] extends [Record<string, any>] ? true : false;
453
+
444
454
  /* Excluded from this release type: isTranslateFallbackWarn */
445
455
 
446
456
  /* Excluded from this release type: isTranslateMissingWarn */
447
457
 
458
+ export declare type IsTuple<T> = IsNever<T> extends true ? false : T extends readonly any[] ? number extends T['length'] ? false : true : false;
459
+
448
460
  export declare type IsUnion<T, B = T> = T extends B ? [B] extends [T] ? false : true : never;
449
461
 
450
462
  export declare type JsonPaths<T, Key extends keyof T = keyof T> = Key extends string ? T[Key] extends Record<string, any> ? `${Key}.${JsonPaths<T[Key]>}` : `${Key}` : never;
@@ -1023,7 +1035,10 @@ export declare interface SpecificNumberFormatOptions extends Intl.NumberFormatOp
1023
1035
  formatMatcher?: FormatMatcher;
1024
1036
  }
1025
1037
 
1026
- declare type StringConvertable<T> = ExtractToStringKey<T> extends never ? unknown : ExtractToStringFunction<T> extends (...args: any) => string ? T : unknown;
1038
+ /**
1039
+ * weather the type `T` is able to convert to string with `toString` method
1040
+ */
1041
+ export declare type StringConvertable<T, Extracted = ExtractToStringKey<T>> = IsNever<Extracted> extends true ? T extends boolean ? T : T extends Function ? T : IsObject<T> extends true ? T : unknown : T;
1027
1042
 
1028
1043
  /**
1029
1044
  * TODO: