Skip to content

Commit

Permalink
Reefactor #1749 - Added d.ts and exports
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Jan 10, 2021
1 parent 25ca61d commit 69de51e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
6 changes: 2 additions & 4 deletions exports/api.d.ts
Original file line number Diff line number Diff line change
@@ -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';
9 changes: 7 additions & 2 deletions exports/api.js
Original file line number Diff line number Diff line change
@@ -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;
11 changes: 11 additions & 0 deletions src/components/api/index.d.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 69de51e

Please sign in to comment.