diff --git a/exports/api.d.ts b/exports/api.d.ts index a6c3d0c1ff..03454f3601 100644 --- a/exports/api.d.ts +++ b/exports/api.d.ts @@ -1,7 +1,5 @@ -import PrimeReact from './components/api/PrimeReact'; - -export default PrimeReact; -export * from './components/api/Locale'; export * from './components/menuitem/MenuItem'; export * from './components/selectitem/SelectItem'; export * from './components/treenode/TreeNode'; +export { default } from './components/api'; +export * from './components/api'; diff --git a/exports/api.js b/exports/api.js index bd0d863a76..46a16f675e 100644 --- a/exports/api.js +++ b/exports/api.js @@ -1,4 +1,9 @@ 'use strict'; -module.exports = require('./components/api/PrimeReact'); -module.exports = require('./components/api/Locale'); +var module = module.exports = require('./components/api/PrimeReact'); +module.locale = require('./components/api/Locale').locale; +module.addLocale = require('./components/api/Locale').addLocale; +module.updateLocaleOption = require('./components/api/Locale').updateLocaleOption; +module.updateLocaleOptions = require('./components/api/Locale').updateLocaleOptions; +module.localeOption = require('./components/api/Locale').localeOption; +module.localeOptions = require('./components/api/Locale').localeOptions; diff --git a/src/components/api/index.d.ts b/src/components/api/index.d.ts new file mode 100644 index 0000000000..cc6ebb1894 --- /dev/null +++ b/src/components/api/index.d.ts @@ -0,0 +1,11 @@ +export default PrimeReact = { + ripple?: boolean, + locale?: string +}; + +export function locale(locale: string): object; +export function addLocale(locale: string, options: object): void; +export function updateLocaleOption(key: string, value: any, locale: string): void; +export function updateLocaleOptions(options: object, locale: string): void; +export function localeOption(key: string, locale: string): void; +export function localeOptions(locale: string): void;