@vocoder/types 0.1.0 → 0.1.1

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.
package/dist/index.d.ts CHANGED
@@ -0,0 +1,36 @@
1
+ import type { ReactNode, ReactElement } from 'react';
2
+ export interface TranslationsMap {
3
+ [locale: string]: {
4
+ [key: string]: string;
5
+ };
6
+ }
7
+ export interface VocoderContextValue {
8
+ locale: string;
9
+ setLocale: (locale: string) => void;
10
+ t: (text: string, values?: Record<string, any>) => string;
11
+ availableLocales: string[];
12
+ isLoading: boolean;
13
+ error: string | null;
14
+ }
15
+ export interface VocoderProviderProps {
16
+ apiKey?: string;
17
+ children: ReactNode;
18
+ defaultLocale?: string;
19
+ translations?: TranslationsMap;
20
+ }
21
+ export interface TProps {
22
+ children?: ReactNode;
23
+ id?: string;
24
+ context?: string;
25
+ formality?: 'formal' | 'informal' | 'auto';
26
+ components?: Record<string, ReactElement>;
27
+ [key: string]: any;
28
+ }
29
+ export interface LocaleSelectorProps {
30
+ className?: string;
31
+ placeholder?: string;
32
+ }
33
+ export interface TranslationContextValue extends VocoderContextValue {
34
+ }
35
+ export interface TranslationProviderProps extends VocoderProviderProps {
36
+ }
package/dist/index.js CHANGED
@@ -1 +1,2 @@
1
- // types entry point
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,21 +1,47 @@
1
1
  {
2
2
  "name": "@vocoder/types",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "TypeScript types for Vocoder SDK",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
- "files": ["dist"],
7
+ "files": [
8
+ "dist"
9
+ ],
8
10
  "publishConfig": {
9
11
  "access": "public"
10
12
  },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "https://github.com/vocoder/vocoder-sdk.git",
16
+ "directory": "packages/types"
17
+ },
18
+ "keywords": [
19
+ "i18n",
20
+ "internationalization",
21
+ "translation",
22
+ "typescript",
23
+ "types",
24
+ "localization"
25
+ ],
26
+ "author": "Vocoder <admin@vocoder.app>",
27
+ "license": "MIT",
28
+ "homepage": "https://github.com/vocoder/vocoder-sdk#readme",
29
+ "bugs": {
30
+ "url": "https://github.com/vocoder/vocoder-sdk/issues"
31
+ },
11
32
  "scripts": {
12
33
  "build": "tsc --outDir dist src/index.ts && tsc --declaration --emitDeclarationOnly --outDir dist src/index.ts",
13
34
  "dev": "tsc --watch --outDir dist src/index.ts",
35
+ "watch": "tsc --watch --outDir dist src/index.ts",
14
36
  "test": "vitest",
15
37
  "lint": "eslint . --ext .ts"
16
38
  },
17
39
  "devDependencies": {
40
+ "@types/react": "^18.2.0",
18
41
  "tsup": "^7.2.0",
19
42
  "vitest": "^1.0.0"
43
+ },
44
+ "peerDependencies": {
45
+ "react": ">=18.0.0"
20
46
  }
21
- }
47
+ }