Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

use-intl

Package Overview
Dependencies
Maintainers
1
Versions
266
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-intl - npm Package Compare versions

Comparing version 4.0.0-beta-7b755e9 to 4.0.0-beta-8cce53e

11

dist/types/core/createTranslator.d.ts

@@ -8,12 +8,15 @@ import type { ReactNode } from 'react';

import type { MessageKeys, NamespaceKeys, NestedKeyOf, NestedValueOf } from './MessageKeys.tsx';
import type { ICUArg, MarkupTagsFunction, RichTagsFunction } from './TranslationValues.tsx';
import type { MarkupTagsFunction, RichTagsFunction, TranslationValues } from './TranslationValues.tsx';
import { type Formatters, type IntlCache } from './formatters.tsx';
import type { Prettify } from './types.tsx';
type ICUArgsWithTags<MessageString extends string, TagsFn extends RichTagsFunction | MarkupTagsFunction = never> = ICUArgs<MessageString, {
ICUArgument: string | number | boolean | Date;
ICUArgument: string;
ICUNumberArgument: number;
ICUDateArgument: Date | number;
ICUDateArgument: Date;
}> & ([TagsFn] extends [never] ? {} : ICUTags<MessageString, TagsFn>);
type OnlyOptional<T> = Partial<T> extends T ? true : false;
type TranslateArgs<Value extends string, TagsFn extends RichTagsFunction | MarkupTagsFunction = never> = string extends Value ? [values?: Record<string, ICUArg | TagsFn>, formats?: Formats] : (Value extends any ? (key: ICUArgsWithTags<Value, TagsFn>) => void : never) extends (key: infer Args) => void ? OnlyOptional<Args> extends true ? [values?: undefined, formats?: Formats] : [values: Prettify<Args>, formats?: Formats] : never;
type TranslateArgs<Value extends string, TagsFn extends RichTagsFunction | MarkupTagsFunction = never> = string extends Value ? [
values?: Record<string, TranslationValues[string] | TagsFn>,
formats?: Formats
] : (Value extends any ? (key: ICUArgsWithTags<Value, TagsFn>) => void : never) extends (key: infer Args) => void ? OnlyOptional<Args> extends true ? [values?: undefined, formats?: Formats] : [values: Prettify<Args>, formats?: Formats] : never;
type NamespacedMessageKeys<TranslatorMessages extends Messages, Namespace extends NamespaceKeys<TranslatorMessages, NestedKeyOf<TranslatorMessages>> = never> = MessageKeys<NestedValueOf<{

@@ -20,0 +23,0 @@ '!': TranslatorMessages;

export type { default as AbstractIntlMessages } from './AbstractIntlMessages.tsx';
export type { TranslationValues, ICUArg, RichTranslationValues, MarkupTranslationValues, RichTagsFunction, MarkupTagsFunction } from './TranslationValues.tsx';
export type { TranslationValues, RichTranslationValues, MarkupTranslationValues, RichTagsFunction, MarkupTagsFunction } from './TranslationValues.tsx';
export type { default as Formats } from './Formats.tsx';

@@ -4,0 +4,0 @@ export type { default as IntlConfig } from './IntlConfig.tsx';

import type { ReactNode } from 'react';
export type ICUArg = string | number | boolean | Date;
export type TranslationValues = Record<string, ICUArg>;
export type TranslationValues = Record<string, string | number | Date>;
export type RichTagsFunction = (chunks: ReactNode) => ReactNode;
export type MarkupTagsFunction = (chunks: string) => string;
export type RichTranslationValues = Record<string, ICUArg | RichTagsFunction>;
export type MarkupTranslationValues = Record<string, ICUArg | MarkupTagsFunction>;
export type RichTranslationValues = Record<string, TranslationValues[string] | RichTagsFunction>;
export type MarkupTranslationValues = Record<string, TranslationValues[string] | MarkupTagsFunction>;
{
"name": "use-intl",
"version": "4.0.0-beta-7b755e9",
"version": "4.0.0-beta-8cce53e",
"sideEffects": false,

@@ -67,3 +67,3 @@ "author": "Jan Amann <jan@amann.work>",

},
"gitHead": "ff4d528b0becc2d1c27232ea8f53351ff655cc50"
"gitHead": "1d8e497bf88194490b9fe8e61b8d69cc69bde205"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc