Skip to content

Commit 83b465c

Browse files
committed
feat(react-intl-universal): update version to 2.13.4 and enhance TypeScript definitions
- Update package version from 2.12.0 to 2.13.4 - Import JSX type alongside ReactNode in type definitions - Simplify JSDoc comment for formatList nodeList parameter - Add missing method exports (formatList, formatParentheses, getColon, formatNumber) - Wrap String interface in global scope to properly extend built-in String type
1 parent 57ed6c5 commit 83b465c

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

packages/react-intl-universal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-intl-universal",
3-
"version": "2.12.0",
3+
"version": "2.13.4",
44
"description": "Internationalize React apps. Not only for React component but also for Vanilla JS.",
55
"keywords": [
66
"intl",

packages/react-intl-universal/typings/index.d.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReactNode } from "react";
1+
import { JSX, ReactNode } from "react";
22

33
declare module "react-intl-universal" {
44
/**
@@ -90,7 +90,7 @@ declare module "react-intl-universal" {
9090
* Formats a list of React nodes for proper internationalized formatting.
9191
* This method properly handles locale-specific list formatting with appropriate separators and conjunctions.
9292
*
93-
* @param {React.ReactNode[]} nodeList - Array of React nodes to format. Can include strings, numbers, or React elements.
93+
* @param {React.ReactNode[]} nodeList - Array of React nodes to format.
9494
* @param {Intl.ListFormatOptions} options - Intl.ListFormat options for customizing the formatting style and type.
9595
* - style: 'long' | 'short' | 'narrow' - Controls the length of the separators (default: 'narrow')
9696
* - type: 'conjunction' | 'disjunction' | 'unit' - Controls the type of list pattern (default: 'conjunction')
@@ -230,12 +230,18 @@ declare module "react-intl-universal" {
230230
getInitOptions: typeof getInitOptions;
231231
init: typeof init;
232232
load: typeof load;
233+
formatList: typeof formatList;
234+
formatParentheses: typeof formatParentheses;
235+
getColon: typeof getColon;
236+
formatNumber: typeof formatNumber;
233237
};
234238

235239
export default intl;
236240
}
237241

238-
declare interface String {
239-
defaultMessage(msg: string | JSX.Element): string;
240-
d(msg: string | JSX.Element): string;
242+
declare global {
243+
interface String {
244+
defaultMessage(msg: string | JSX.Element): string;
245+
d(msg: string | JSX.Element): string;
246+
}
241247
}

0 commit comments

Comments
 (0)