use-intl 4.10.0 → 4.11.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.
@@ -1,7 +1,7 @@
1
1
  import { c as createIntlFormatters, b as createCache } from './formatters-r4aAmsMP.js';
2
2
  export { I as IntlError, a as IntlErrorCode } from './formatters-r4aAmsMP.js';
3
- import { r as resolveNamespace, a as createBaseTranslator, d as defaultGetMessageFallback, b as defaultOnError } from './initializeConfig-B5qJiBCm.js';
4
- export { c as createFormatter, i as initializeConfig } from './initializeConfig-B5qJiBCm.js';
3
+ import { r as resolveNamespace, a as createBaseTranslator, d as defaultGetMessageFallback, b as defaultOnError } from './initializeConfig-CUsOI8u2.js';
4
+ export { c as createFormatter, i as initializeConfig } from './initializeConfig-CUsOI8u2.js';
5
5
 
6
6
 
7
7
 
@@ -1,6 +1,6 @@
1
1
  export { I as IntlError, a as IntlErrorCode, b as _createCache, c as _createIntlFormatters } from './formatters-r4aAmsMP.js';
2
2
  export { createTranslator, hasLocale } from './core.js';
3
- export { c as createFormatter, i as initializeConfig } from './initializeConfig-B5qJiBCm.js';
3
+ export { c as createFormatter, i as initializeConfig } from './initializeConfig-CUsOI8u2.js';
4
4
  export { IntlProvider, _useExtracted, useFormatter, useLocale, useMessages, useNow, useTimeZone, useTranslations } from './react.js';
5
5
 
6
6
 
@@ -428,12 +428,19 @@ function createFormatter(props) {
428
428
  }
429
429
  }, () => String(value));
430
430
  }
431
+ function displayName(value, formatOrOptions, overrides) {
432
+ return getFormattedValue(formatOrOptions, overrides, formats?.displayName, options =>
433
+ // `options` is guaranteed non-null because our overloads require
434
+ // either inline options or a named format that resolves to options.
435
+ formatters.getDisplayNames(locale, options).of(value), () => value);
436
+ }
431
437
  return {
432
438
  dateTime,
433
439
  number,
434
440
  relativeTime,
435
441
  list,
436
- dateTimeRange
442
+ dateTimeRange,
443
+ displayName
437
444
  };
438
445
  }
439
446
 
@@ -1,6 +1,6 @@
1
1
  import { createContext, useContext, useMemo, useState, useEffect } from 'react';
2
2
  import { b as createCache, c as createIntlFormatters, I as IntlError, a as IntlErrorCode } from './formatters-r4aAmsMP.js';
3
- import { i as initializeConfig, r as resolveNamespace, a as createBaseTranslator, c as createFormatter } from './initializeConfig-B5qJiBCm.js';
3
+ import { i as initializeConfig, r as resolveNamespace, a as createBaseTranslator, c as createFormatter } from './initializeConfig-CUsOI8u2.js';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5
 
6
6
 
@@ -1 +1 @@
1
- import{c as e,b as r}from"./formatters-CJcico0N.js";export{I as IntlError,a as IntlErrorCode}from"./formatters-CJcico0N.js";import{r as s,a as t,d as o,b as m}from"./initializeConfig-Brh10fyG.js";export{c as createFormatter,i as initializeConfig}from"./initializeConfig-Brh10fyG.js";function n({_cache:a=r(),_formatters:i=e(a),getMessageFallback:n=o,messages:c,namespace:f,onError:g=m,...l}){return function({messages:e,namespace:a,...r},o){return e=e[o],a=s(a,o),t({...r,messages:e,namespace:a})}({...l,onError:g,cache:a,formatters:i,getMessageFallback:n,messages:{"!":c},namespace:f?`!.${f}`:"!"},"!")}function f(e,a){return e.includes(a)}export{r as _createCache,e as _createIntlFormatters,n as createTranslator,f as hasLocale};
1
+ import{c as e,b as r}from"./formatters-CJcico0N.js";export{I as IntlError,a as IntlErrorCode}from"./formatters-CJcico0N.js";import{r as s,a as t,d as o,b as m}from"./initializeConfig-CHgjheii.js";export{c as createFormatter,i as initializeConfig}from"./initializeConfig-CHgjheii.js";function n({_cache:a=r(),_formatters:i=e(a),getMessageFallback:n=o,messages:c,namespace:f,onError:g=m,...l}){return function({messages:e,namespace:a,...r},o){return e=e[o],a=s(a,o),t({...r,messages:e,namespace:a})}({...l,onError:g,cache:a,formatters:i,getMessageFallback:n,messages:{"!":c},namespace:f?`!.${f}`:"!"},"!")}function f(e,a){return e.includes(a)}export{r as _createCache,e as _createIntlFormatters,n as createTranslator,f as hasLocale};
@@ -1 +1 @@
1
- export{I as IntlError,a as IntlErrorCode,b as _createCache,c as _createIntlFormatters}from"./formatters-CJcico0N.js";export{createTranslator,hasLocale}from"./core.js";export{c as createFormatter,i as initializeConfig}from"./initializeConfig-Brh10fyG.js";export{IntlProvider,_useExtracted,useFormatter,useLocale,useMessages,useNow,useTimeZone,useTranslations}from"./react.js";
1
+ export{I as IntlError,a as IntlErrorCode,b as _createCache,c as _createIntlFormatters}from"./formatters-CJcico0N.js";export{createTranslator,hasLocale}from"./core.js";export{c as createFormatter,i as initializeConfig}from"./initializeConfig-CHgjheii.js";export{IntlProvider,_useExtracted,useFormatter,useLocale,useMessages,useNow,useTimeZone,useTranslations}from"./react.js";
@@ -1 +1 @@
1
- import{cloneElement as e,isValidElement as t}from"react";import r from"use-intl/format-message";import{I as n,a as o,c as a,b as s}from"./formatters-CJcico0N.js";function c(...e){return e.filter(Boolean).join(".")}function i(e){return c(e.namespace,e.key)}function u(e){console.error(e)}function m(e,t,r,n){const o=c(n,r);if(!t)throw new Error(o);let a=t;return r.split(".").forEach((t=>{const r=a[t];if(null==t||null==r)throw new Error(o+` (${e})`);a=r})),a}function f(a){const s=function(e,t,r){try{if(!t)throw new Error(void 0);const n=r?m(e,t,r):t;if(!n)throw new Error(r);return n}catch(e){return new n(o.MISSING_MESSAGE,e.message)}}(a.locale,a.messages,a.namespace);return function({cache:a,formats:s,formatters:u,getMessageFallback:f=i,locale:l,messagesOrError:g,namespace:y,onError:h,timeZone:w}){const E=g instanceof n;function S(e,t,r,o){const a=new n(t,r);return h(a),o??f({error:a,key:e,namespace:y})}function d(i,d,p,M){const T=M;let R;if(E){if(!T)return h(g),f({error:g,key:i,namespace:y});R=T}else{const e=g;try{R=m(l,e,i,y)}catch(e){if(!T)return S(i,o.MISSING_MESSAGE,e.message,T);R=T}}try{const n=c(y,i);return r(n,R,d?function(r){const n={};return Object.keys(r).forEach((o=>{let a=0;const s=r[o];let c;c="function"==typeof s?r=>{const n=s(r);return t(n)?e(n,{key:o+a++}):n}:s,n[o]=c})),n}(d):d,{cache:a,formatters:u,globalFormats:s,formats:p,locale:l,timeZone:w})}catch(e){let t,r;return e instanceof n?(t=e.code,r=e.originalMessage):(t=o.FORMATTING_ERROR,r=e.message),S(i,t,r,T)}}function p(e,t,r,n){const a=d(e,t,r,n);return"string"!=typeof a?S(e,o.INVALID_MESSAGE,void 0):a}return p.rich=d,p.markup=(e,t,r,n)=>d(e,t,r,n),p.raw=e=>{if(E)return h(g),f({error:g,key:e,namespace:y});const t=g;try{return m(l,t,e,y)}catch(t){return S(e,o.MISSING_MESSAGE,t.message)}},p.has=e=>{if(E)return!1;try{return m(l,g,e,y),!0}catch{return!1}},p}({...a,messagesOrError:s})}function l(e,t){return e===t?void 0:e.slice((t+".").length)}const g=3600,y=86400,h=7*y,w=2628e3,E=7884e3,S=365*y,d={second:1,seconds:1,minute:60,minutes:60,hour:g,hours:g,day:y,days:y,week:h,weeks:h,month:w,months:w,quarter:E,quarters:E,year:S,years:S};function p(e){const{_cache:t=s(),_formatters:r=a(t),formats:c,locale:i,onError:m=u,timeZone:f}=e;function l(e){return e?.timeZone||(f?e={...e,timeZone:f}:m(new n(o.ENVIRONMENT_FALLBACK,void 0))),e}function E(e,t,r,a,s){let c;try{c=function(e,t,r){let a;if("string"==typeof t){const r=t;if(a=e?.[r],!a){const e=new n(o.MISSING_FORMAT,void 0);throw m(e),e}}else a=t;return r&&(a={...a,...r}),a}(r,e,t)}catch{return s()}try{return a(c)}catch(e){return m(new n(o.FORMATTING_ERROR,e.message)),s()}}function p(e,t,n){return E(t,n,c?.dateTime,(t=>(t=l(t),r.getDateTimeFormat(i,t).format(e))),(()=>String(e)))}function M(){return e.now?e.now:(m(new n(o.ENVIRONMENT_FALLBACK,void 0)),new Date)}return{dateTime:p,number:function(e,t,n){return E(t,n,c?.number,(t=>r.getNumberFormat(i,t).format(e)),(()=>String(e)))},relativeTime:function(e,t){try{let n,o;const a={};t instanceof Date||"number"==typeof t?n=new Date(t):t&&(n=null!=t.now?new Date(t.now):M(),o=t.unit,a.style=t.style,a.numberingSystem=t.numberingSystem),n||(n=M());const s=(new Date(e).getTime()-n.getTime())/1e3;o||(o=function(e){const t=Math.abs(e);return t<60?"second":t<g?"minute":t<y?"hour":t<h?"day":t<w?"week":t<S?"month":"year"}(s)),a.numeric="second"===o?"auto":"always";const c=function(e,t){return Math.round(e/d[t])}(s,o);return r.getRelativeTimeFormat(i,a).format(c,o)}catch(t){return m(new n(o.FORMATTING_ERROR,t.message)),String(e)}},list:function(e,t,n){const o=[],a=new Map;let s=0;for(const t of e){let e;"object"==typeof t?(e=String(s),a.set(e,t)):e=String(t),o.push(e),s++}return E(t,n,c?.list,(e=>{const t=r.getListFormat(i,e).formatToParts(o).map((e=>"literal"===e.type?e.value:a.get(e.value)||e.value));return a.size>0?t:t.join("")}),(()=>String(e)))},dateTimeRange:function(e,t,n,o){return E(n,o,c?.dateTime,(n=>(n=l(n),r.getDateTimeFormat(i,n).formatRange(e,t))),(()=>[p(e),p(t)].join(" – ")))}}}function M({formats:e,getMessageFallback:t,messages:r,onError:n,...o}){return{...o,formats:e||void 0,messages:r||void 0,onError:n||u,getMessageFallback:t||i}}export{f as a,u as b,p as c,i as d,M as i,l as r};
1
+ import{cloneElement as e,isValidElement as t}from"react";import r from"use-intl/format-message";import{I as n,a as o,c as a,b as s}from"./formatters-CJcico0N.js";function c(...e){return e.filter(Boolean).join(".")}function i(e){return c(e.namespace,e.key)}function u(e){console.error(e)}function m(e,t,r,n){const o=c(n,r);if(!t)throw new Error(o);let a=t;return r.split(".").forEach((t=>{const r=a[t];if(null==t||null==r)throw new Error(o+` (${e})`);a=r})),a}function f(a){const s=function(e,t,r){try{if(!t)throw new Error(void 0);const n=r?m(e,t,r):t;if(!n)throw new Error(r);return n}catch(e){return new n(o.MISSING_MESSAGE,e.message)}}(a.locale,a.messages,a.namespace);return function({cache:a,formats:s,formatters:u,getMessageFallback:f=i,locale:l,messagesOrError:g,namespace:y,onError:h,timeZone:w}){const E=g instanceof n;function d(e,t,r,o){const a=new n(t,r);return h(a),o??f({error:a,key:e,namespace:y})}function p(i,p,S,M){const T=M;let N;if(E){if(!T)return h(g),f({error:g,key:i,namespace:y});N=T}else{const e=g;try{N=m(l,e,i,y)}catch(e){if(!T)return d(i,o.MISSING_MESSAGE,e.message,T);N=T}}try{const n=c(y,i);return r(n,N,p?function(r){const n={};return Object.keys(r).forEach((o=>{let a=0;const s=r[o];let c;c="function"==typeof s?r=>{const n=s(r);return t(n)?e(n,{key:o+a++}):n}:s,n[o]=c})),n}(p):p,{cache:a,formatters:u,globalFormats:s,formats:S,locale:l,timeZone:w})}catch(e){let t,r;return e instanceof n?(t=e.code,r=e.originalMessage):(t=o.FORMATTING_ERROR,r=e.message),d(i,t,r,T)}}function S(e,t,r,n){const a=p(e,t,r,n);return"string"!=typeof a?d(e,o.INVALID_MESSAGE,void 0):a}return S.rich=p,S.markup=(e,t,r,n)=>p(e,t,r,n),S.raw=e=>{if(E)return h(g),f({error:g,key:e,namespace:y});const t=g;try{return m(l,t,e,y)}catch(t){return d(e,o.MISSING_MESSAGE,t.message)}},S.has=e=>{if(E)return!1;try{return m(l,g,e,y),!0}catch{return!1}},S}({...a,messagesOrError:s})}function l(e,t){return e===t?void 0:e.slice((t+".").length)}const g=3600,y=86400,h=7*y,w=2628e3,E=7884e3,d=365*y,p={second:1,seconds:1,minute:60,minutes:60,hour:g,hours:g,day:y,days:y,week:h,weeks:h,month:w,months:w,quarter:E,quarters:E,year:d,years:d};function S(e){const{_cache:t=s(),_formatters:r=a(t),formats:c,locale:i,onError:m=u,timeZone:f}=e;function l(e){return e?.timeZone||(f?e={...e,timeZone:f}:m(new n(o.ENVIRONMENT_FALLBACK,void 0))),e}function E(e,t,r,a,s){let c;try{c=function(e,t,r){let a;if("string"==typeof t){const r=t;if(a=e?.[r],!a){const e=new n(o.MISSING_FORMAT,void 0);throw m(e),e}}else a=t;return r&&(a={...a,...r}),a}(r,e,t)}catch{return s()}try{return a(c)}catch(e){return m(new n(o.FORMATTING_ERROR,e.message)),s()}}function S(e,t,n){return E(t,n,c?.dateTime,(t=>(t=l(t),r.getDateTimeFormat(i,t).format(e))),(()=>String(e)))}function M(){return e.now?e.now:(m(new n(o.ENVIRONMENT_FALLBACK,void 0)),new Date)}return{dateTime:S,number:function(e,t,n){return E(t,n,c?.number,(t=>r.getNumberFormat(i,t).format(e)),(()=>String(e)))},relativeTime:function(e,t){try{let n,o;const a={};t instanceof Date||"number"==typeof t?n=new Date(t):t&&(n=null!=t.now?new Date(t.now):M(),o=t.unit,a.style=t.style,a.numberingSystem=t.numberingSystem),n||(n=M());const s=(new Date(e).getTime()-n.getTime())/1e3;o||(o=function(e){const t=Math.abs(e);return t<60?"second":t<g?"minute":t<y?"hour":t<h?"day":t<w?"week":t<d?"month":"year"}(s)),a.numeric="second"===o?"auto":"always";const c=function(e,t){return Math.round(e/p[t])}(s,o);return r.getRelativeTimeFormat(i,a).format(c,o)}catch(t){return m(new n(o.FORMATTING_ERROR,t.message)),String(e)}},list:function(e,t,n){const o=[],a=new Map;let s=0;for(const t of e){let e;"object"==typeof t?(e=String(s),a.set(e,t)):e=String(t),o.push(e),s++}return E(t,n,c?.list,(e=>{const t=r.getListFormat(i,e).formatToParts(o).map((e=>"literal"===e.type?e.value:a.get(e.value)||e.value));return a.size>0?t:t.join("")}),(()=>String(e)))},dateTimeRange:function(e,t,n,o){return E(n,o,c?.dateTime,(n=>(n=l(n),r.getDateTimeFormat(i,n).formatRange(e,t))),(()=>[S(e),S(t)].join(" – ")))},displayName:function(e,t,n){return E(t,n,c?.displayName,(t=>r.getDisplayNames(i,t).of(e)),(()=>e))}}}function M({formats:e,getMessageFallback:t,messages:r,onError:n,...o}){return{...o,formats:e||void 0,messages:r||void 0,onError:n||u,getMessageFallback:t||i}}export{f as a,u as b,S as c,i as d,M as i,l as r};
@@ -1 +1 @@
1
- import{createContext as e,useContext as r,useMemo as t,useState as o,useEffect as n}from"react";import{b as a,c as s,I as c,a as i}from"./formatters-CJcico0N.js";import{i as m,r as f,a as u,c as l}from"./initializeConfig-Brh10fyG.js";import{jsx as g}from"react/jsx-runtime";const d=e(void 0);function v({children:e,formats:o,getMessageFallback:n,locale:c,messages:i,now:f,onError:u,timeZone:l}){const v=r(d),w=t((()=>v?.cache||a()),[c,v?.cache]),p=t((()=>v?.formatters||s(w)),[w,v?.formatters]),h=t((()=>({...m({locale:c,formats:void 0===o?v?.formats:o,getMessageFallback:n||v?.getMessageFallback,messages:void 0===i?v?.messages:i,now:f||v?.now,onError:u||v?.onError,timeZone:l||v?.timeZone}),formatters:p,cache:w})),[w,o,p,n,c,i,f,u,v,l]);return g(d.Provider,{value:h,children:e})}function w(){const e=r(d);if(!e)throw new Error(void 0);return e}let p=!1;const h="undefined"==typeof window;function E(e){return function(e,r,o){const{cache:n,formats:a,formatters:s,getMessageFallback:m,locale:l,onError:g,timeZone:d}=w(),v=e[o],E=f(r,o);return d||p||!h||(p=!0,g(new c(i.ENVIRONMENT_FALLBACK,void 0))),t((()=>u({cache:n,formatters:s,getMessageFallback:m,messages:v,namespace:E,onError:g,formats:a,locale:l,timeZone:d})),[n,s,m,v,E,g,a,l,d])}({"!":w().messages},e?`!.${e}`:"!","!")}function Z(){return w().locale}function k(){return new Date}function b(e){const r=e?.updateInterval,{now:t}=w(),[a,s]=o(t||k());return n((()=>{if(!r)return;const e=setInterval((()=>{s(k())}),r);return()=>{clearInterval(e)}}),[t,r]),null==r&&t?t:a}function F(){return w().timeZone}function M(){const e=w();if(!e.messages)throw new Error(void 0);return e.messages}function I(){const{formats:e,formatters:r,locale:o,now:n,onError:a,timeZone:s}=w();return t((()=>l({formats:e,locale:o,now:n,onError:a,timeZone:s,_formatters:r})),[e,r,n,o,a,s])}function j(e,...r){let t,o;return"string"==typeof e?(t=r[0],o=r[1]):(t=e.values,o=e.formats),[void 0,t,o,void 0]}function x(e){const r=E(e);function t(...e){return r(...j(...e))}return t.rich=(...e)=>r.rich(...j(...e)),t.markup=(...e)=>r.markup(...j(...e)),t.has=function(e){return!0},t}export{v as IntlProvider,x as _useExtracted,I as useFormatter,Z as useLocale,M as useMessages,b as useNow,F as useTimeZone,E as useTranslations};
1
+ import{createContext as e,useContext as r,useMemo as t,useState as o,useEffect as n}from"react";import{b as a,c as s,I as c,a as i}from"./formatters-CJcico0N.js";import{i as m,r as f,a as u,c as l}from"./initializeConfig-CHgjheii.js";import{jsx as g}from"react/jsx-runtime";const d=e(void 0);function v({children:e,formats:o,getMessageFallback:n,locale:c,messages:i,now:f,onError:u,timeZone:l}){const v=r(d),w=t((()=>v?.cache||a()),[c,v?.cache]),p=t((()=>v?.formatters||s(w)),[w,v?.formatters]),h=t((()=>({...m({locale:c,formats:void 0===o?v?.formats:o,getMessageFallback:n||v?.getMessageFallback,messages:void 0===i?v?.messages:i,now:f||v?.now,onError:u||v?.onError,timeZone:l||v?.timeZone}),formatters:p,cache:w})),[w,o,p,n,c,i,f,u,v,l]);return g(d.Provider,{value:h,children:e})}function w(){const e=r(d);if(!e)throw new Error(void 0);return e}let p=!1;const h="undefined"==typeof window;function E(e){return function(e,r,o){const{cache:n,formats:a,formatters:s,getMessageFallback:m,locale:l,onError:g,timeZone:d}=w(),v=e[o],E=f(r,o);return d||p||!h||(p=!0,g(new c(i.ENVIRONMENT_FALLBACK,void 0))),t((()=>u({cache:n,formatters:s,getMessageFallback:m,messages:v,namespace:E,onError:g,formats:a,locale:l,timeZone:d})),[n,s,m,v,E,g,a,l,d])}({"!":w().messages},e?`!.${e}`:"!","!")}function Z(){return w().locale}function k(){return new Date}function b(e){const r=e?.updateInterval,{now:t}=w(),[a,s]=o(t||k());return n((()=>{if(!r)return;const e=setInterval((()=>{s(k())}),r);return()=>{clearInterval(e)}}),[t,r]),null==r&&t?t:a}function F(){return w().timeZone}function M(){const e=w();if(!e.messages)throw new Error(void 0);return e.messages}function I(){const{formats:e,formatters:r,locale:o,now:n,onError:a,timeZone:s}=w();return t((()=>l({formats:e,locale:o,now:n,onError:a,timeZone:s,_formatters:r})),[e,r,n,o,a,s])}function j(e,...r){let t,o;return"string"==typeof e?(t=r[0],o=r[1]):(t=e.values,o=e.formats),[void 0,t,o,void 0]}function x(e){const r=E(e);function t(...e){return r(...j(...e))}return t.rich=(...e)=>r.rich(...j(...e)),t.markup=(...e)=>r.markup(...j(...e)),t.has=function(e){return!0},t}export{v as IntlProvider,x as _useExtracted,I as useFormatter,Z as useLocale,M as useMessages,b as useNow,F as useTimeZone,E as useTranslations};
@@ -9,16 +9,20 @@ export type FormatNames = AppConfig extends {
9
9
  dateTime: AppFormats extends {
10
10
  dateTime: infer AppDateTimeFormats;
11
11
  } ? keyof AppDateTimeFormats : string;
12
- number: AppFormats extends {
13
- number: infer AppNumberFormats;
14
- } ? keyof AppNumberFormats : string;
12
+ displayName: AppFormats extends {
13
+ displayName: infer AppDisplayNameFormats;
14
+ } ? keyof AppDisplayNameFormats : string;
15
15
  list: AppFormats extends {
16
16
  list: infer AppListFormats;
17
17
  } ? keyof AppListFormats : string;
18
+ number: AppFormats extends {
19
+ number: infer AppNumberFormats;
20
+ } ? keyof AppNumberFormats : string;
18
21
  } : {
19
22
  dateTime: string;
20
- number: string;
23
+ displayName: string;
21
24
  list: string;
25
+ number: string;
22
26
  };
23
27
  export type Messages = AppConfig extends {
24
28
  Messages: infer AppMessages;
@@ -1,8 +1,9 @@
1
1
  import type DateTimeFormatOptions from './DateTimeFormatOptions.js';
2
2
  import type NumberFormatOptions from './NumberFormatOptions.js';
3
3
  type Formats = {
4
- number?: Record<string, NumberFormatOptions>;
5
4
  dateTime?: Record<string, DateTimeFormatOptions>;
5
+ displayName?: Record<string, Intl.DisplayNamesOptions>;
6
6
  list?: Record<string, Intl.ListFormatOptions>;
7
+ number?: Record<string, NumberFormatOptions>;
7
8
  };
8
9
  export default Formats;
@@ -39,5 +39,9 @@ export default function createFormatter(props: Props): {
39
39
  (start: Date | number, end: Date | number, options?: DateTimeFormatOptions): string;
40
40
  (start: Date | number, end: Date | number, format?: FormatNames["dateTime"], options?: DateTimeFormatOptions): string;
41
41
  };
42
+ displayName: {
43
+ (value: string, options: Intl.DisplayNamesOptions): string;
44
+ (value: string, format: FormatNames["displayName"], options?: Intl.DisplayNamesOptions): string;
45
+ };
42
46
  };
43
47
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-intl",
3
- "version": "4.10.0",
3
+ "version": "4.11.0",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -77,11 +77,11 @@
77
77
  "dependencies": {
78
78
  "@formatjs/fast-memoize": "^3.1.0",
79
79
  "@schummar/icu-type-parser": "1.21.5",
80
- "icu-minify": "^4.10.0",
80
+ "icu-minify": "^4.11.0",
81
81
  "intl-messageformat": "^11.1.0"
82
82
  },
83
83
  "peerDependencies": {
84
84
  "react": "^17.0.0 || ^18.0.0 || >=19.0.0-rc <19.0.0 || ^19.0.0"
85
85
  },
86
- "gitHead": "d4648b884c609400b53da58ab0def5feb22ab654"
86
+ "gitHead": "e68a5910bdc301c58859fec56bb196b4b3510419"
87
87
  }