diff --git a/package-lock.json b/package-lock.json index 1a210ff..a3fffdf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pashto-inflector", - "version": "5.8.3", + "version": "5.8.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pashto-inflector", - "version": "5.8.3", + "version": "5.8.4", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index e74161b..3f860a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pashto-inflector", - "version": "5.8.3", + "version": "5.8.4", "author": "lingdocs.com", "description": "A Pashto inflection and verb conjugation engine, inculding React components for displaying Pashto text, inflections, and conjugations", "homepage": "https://verbs.lingdocs.com", diff --git a/src/components/package.json b/src/components/package.json index 9a5b18f..1dc0423 100644 --- a/src/components/package.json +++ b/src/components/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/ps-react", - "version": "5.8.3", + "version": "5.8.4", "description": "Pashto inflector library module with React components", "main": "dist/components/library.js", "module": "dist/components/library.js", diff --git a/src/lib/library.ts b/src/lib/library.ts index 728a579..594317f 100644 --- a/src/lib/library.ts +++ b/src/lib/library.ts @@ -72,7 +72,7 @@ import { dictionaryEntryBooleanFields, dictionaryEntryNumberFields, dictionaryEntryTextFields, -} from "./src/fields"; +} from "../types"; import { validateEntry, standardizeEntry, @@ -162,7 +162,7 @@ import { import shuffleArray from "./src/shuffle-array"; import defaultTextOptions from "./src/default-text-options"; import * as grammarUnits from "./src/grammar-units"; -import * as Types from "../types"; +import type * as Types from "../types"; import * as typePredicates from "./src/type-predicates"; import * as blockUtils from "./src/phrase-building/blocks-utils"; diff --git a/src/lib/package.json b/src/lib/package.json index d983d5e..a917aa3 100644 --- a/src/lib/package.json +++ b/src/lib/package.json @@ -1,6 +1,6 @@ { "name": "@lingdocs/inflect", - "version": "5.8.3", + "version": "5.8.4", "description": "Pashto inflector library", "main": "dist/index.js", "types": "dist/lib/library.d.ts", diff --git a/src/lib/src/fields.ts b/src/lib/src/fields.ts deleted file mode 100644 index b0823cd..0000000 --- a/src/lib/src/fields.ts +++ /dev/null @@ -1,35 +0,0 @@ -import * as T from "../../types"; - -export const dictionaryEntryTextFields: T.DictionaryEntryTextField[] = [ - "p", - "f", - "e", - "c", - "infap", - "infaf", - "infbp", - "infbf", - "app", - "apf", - "ppp", - "ppf", - "psp", - "psf", - "ssp", - "ssf", - "prp", - "prf", - "pprtp", - "pprtf", - "tppp", - "tppf", - "ec", - "ep", -]; - -export const dictionaryEntryBooleanFields: T.DictionaryEntryBooleanField[] = [ - "noInf", "shortIntrans", "noOo", "sepOo", "diacExcept", -]; -export const dictionaryEntryNumberFields: T.DictionaryEntryNumberField[] = [ - "ts", "r", "i", "l", "separationAtP", "separationAtF", -]; \ No newline at end of file diff --git a/src/types.ts b/src/types.ts index ce77387..7f98f17 100644 --- a/src/types.ts +++ b/src/types.ts @@ -145,9 +145,42 @@ export type DictionaryEntryNoFVars = DictionaryEntry & { __brand: "name for a di export type PsStringNoFVars = PsString & { __brand: "name for a ps string with all the phonetics variations removed" }; export type FStringNoFVars = string & { __brand: "name for a phonetics string with all the phonetics variations removed" }; -export type DictionaryEntryTextField = "p" | "f" | "e" | "c" | "infap" | "infaf" | "infbp" | "infbf" | "app" | "apf" | "ppp" | "ppf" | "psp" | "psf" | "ssp" | "ssf" | "prp" | "prf" | "pprtp" | "pprtf" | "tppp" | "tppf" | "ec" | "ep"; -export type DictionaryEntryBooleanField = "noInf" | "shortIntrans" | "noOo" | "sepOo" | "diacExcept"; -export type DictionaryEntryNumberField = "ts" | "r" | "i" | "l" | "separationAtP" | "separationAtF"; + +export const dictionaryEntryTextFields = [ + "p", + "f", + "e", + "c", + "infap", + "infaf", + "infbp", + "infbf", + "app", + "apf", + "ppp", + "ppf", + "psp", + "psf", + "ssp", + "ssf", + "prp", + "prf", + "pprtp", + "pprtf", + "tppp", + "tppf", + "ec", + "ep", +] as const; +export type DictionaryEntryTextField = typeof dictionaryEntryTextFields[number]; +export const dictionaryEntryBooleanFields = [ + "noInf", "shortIntrans", "noOo", "sepOo", "diacExcept", +] as const; +export const dictionaryEntryNumberFields = [ + "ts", "r", "i", "l", "separationAtP", "separationAtF", +] as const; +export type DictionaryEntryBooleanField = typeof dictionaryEntryBooleanFields[number]; +export type DictionaryEntryNumberField = typeof dictionaryEntryNumberFields[number]; export type DictionaryEntryField = DictionaryEntryTextField | DictionaryEntryBooleanField | DictionaryEntryNumberField; // TODO: make