pangea-lib 1.16.11 → 1.16.13

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,16 +1,12 @@
1
- import { Props } from './i18n.types';
2
-
3
- export declare function createI18n(): <T extends "PgaDatePicker" | "PgaModal", K extends keyof {
4
- PgaDatePicker: {
5
- es: {
6
- cancelBtn: string;
7
- selectBtn: string;
8
- };
9
- };
10
- PgaModal: {
11
- es: {
12
- cancelBtn: string;
13
- acceptBtn: string;
14
- };
15
- };
16
- }[T]["es"]>(fileName: T) => (messageKey: K, props?: Props) => string;
1
+ export type Props = {
2
+ [prop: string]: string | number;
3
+ count?: number;
4
+ };
5
+ export declare function createI18n(storeId: string, defaultLanguage: string, messages: any): {
6
+ useI18nStore: import('pinia').StoreDefinition<string, {
7
+ currentLanguage: string;
8
+ }, {}, {
9
+ setLanguage(language: string): void;
10
+ }>;
11
+ useI18n: (fileName: string) => (messageKey: string, props?: Props) => string;
12
+ };
@@ -1,14 +1,5 @@
1
- export declare const useI18n: <T extends "PgaDatePicker" | "PgaModal", K extends keyof {
2
- PgaDatePicker: {
3
- es: {
4
- cancelBtn: string;
5
- selectBtn: string;
6
- };
7
- };
8
- PgaModal: {
9
- es: {
10
- cancelBtn: string;
11
- acceptBtn: string;
12
- };
13
- };
14
- }[T]["es"]>(fileName: T) => (messageKey: K, props?: import('./i18n.types').Props) => string;
1
+ export declare const useI18nStore: import('pinia').StoreDefinition<string, {
2
+ currentLanguage: string;
3
+ }, {}, {
4
+ setLanguage(language: string): void;
5
+ }>, useI18n: (fileName: string) => (messageKey: string, props?: import('./create-i18n').Props) => string;
@@ -1,9 +1,5 @@
1
- import { Language } from './i18n.types';
2
-
3
- type I18nStoreState = {
4
- currentLanguage: Language;
5
- };
6
- export declare const useI18nStore: import('pinia').StoreDefinition<"pga-i18n", I18nStoreState, {}, {
7
- setLanguage(language: Language): void;
1
+ export declare function createI18nStore<L extends string>(id: string, defaultLanguage: L): import('pinia').StoreDefinition<string, {
2
+ currentLanguage: L;
3
+ }, {}, {
4
+ setLanguage(language: L): void;
8
5
  }>;
9
- export {};
@@ -1,9 +1,5 @@
1
- import { default as allMessages } from './i18n.messages';
1
+ import { default as messages } from './i18n.messages';
2
2
 
3
3
  export type Language = 'es';
4
- export type FileName = keyof typeof allMessages;
5
- export type MessageKey<T extends FileName> = keyof (typeof allMessages)[T][Language];
6
- export type Props = {
7
- [prop: string]: string | number;
8
- count?: number;
9
- };
4
+ export type FileName = keyof typeof messages;
5
+ export type MessageKey<T extends FileName> = keyof (typeof messages)[T][Language];
@@ -1,2 +1 @@
1
1
  export { createI18n } from './create-i18n';
2
- export { useI18nStore } from './i18n.store';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pangea-lib",
3
3
  "description": "",
4
- "version": "1.16.11",
4
+ "version": "1.16.13",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",