@kulupu-linku/sona 0.3.7 → 2.1.0
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-7uKIarVW.d.mts +1495 -0
- package/dist/index-N8h8E1s6.d.mts +398 -0
- package/dist/index-nmyNJa57.d.mts +300 -0
- package/dist/lib/v1/client.d.mts +1610 -0
- package/dist/lib/v1/client.mjs +8 -0
- package/dist/lib/v1/client.test.d.mts +30 -0
- package/dist/lib/v1/client.test.mjs +2 -0
- package/dist/lib/v1/index.d.mts +2 -0
- package/dist/lib/v1/index.mjs +137 -0
- package/dist/lib/v1/types.d.mts +2 -0
- package/dist/lib/v1/types.mjs +1 -0
- package/dist/lib/v1/utils.d.mts +26 -0
- package/dist/lib/v1/utils.mjs +35 -0
- package/dist/lib/v2/client.d.mts +1610 -0
- package/dist/lib/v2/client.mjs +8 -0
- package/dist/lib/v2/client.test.d.mts +35 -0
- package/dist/lib/v2/client.test.mjs +2 -0
- package/dist/lib/v2/index.d.mts +2 -0
- package/dist/lib/v2/index.mjs +192 -0
- package/dist/lib/v2/types.d.mts +2 -0
- package/dist/lib/v2/types.mjs +1 -0
- package/dist/lib/v2/utils.d.mts +44 -0
- package/dist/lib/v2/utils.mjs +38 -0
- package/dist/server/index.d.mts +2 -0
- package/dist/server/index.mjs +35 -0
- package/dist/server/utils.d.mts +27 -0
- package/dist/server/utils.mjs +31 -0
- package/dist/server/v1/index.d.mts +902 -0
- package/dist/server/v1/index.mjs +2 -0
- package/dist/server/v2/index.d.mts +1112 -0
- package/dist/server/v2/index.mjs +2 -0
- package/dist/server/versioning.d.mts +2019 -0
- package/dist/server/versioning.mjs +2 -0
- package/dist/v1-Da4_o5R1.mjs +261 -0
- package/generated/{commentary_translation.json → v1/commentary_translation.json} +1 -1
- package/generated/{definition_translation.json → v1/definition_translation.json} +1 -1
- package/generated/{etymology_translation.json → v1/etymology_translation.json} +2 -4
- package/generated/{fingerspelling.json → v1/fingerspelling.json} +5 -20
- package/generated/{fingerspelling_sign.json → v1/fingerspelling_sign.json} +4 -16
- package/generated/{font.json → v1/font.json} +1 -1
- package/generated/{fonts.json → v1/fonts.json} +1 -1
- package/generated/{icon_translation.json → v1/icon_translation.json} +1 -1
- package/generated/{languages.json → v1/languages.json} +4 -14
- package/generated/{parameters_translation.json → v1/parameters_translation.json} +1 -1
- package/generated/{sign.json → v1/sign.json} +3 -8
- package/generated/{signs.json → v1/signs.json} +4 -12
- package/generated/{sitelen_pona_translation.json → v1/sitelen_pona_translation.json} +1 -1
- package/generated/{word.json → v1/word.json} +6 -29
- package/generated/v2/fingerspelling.json +184 -0
- package/generated/v2/fingerspellings.json +198 -0
- package/generated/v2/font.json +164 -0
- package/generated/v2/fonts.json +178 -0
- package/generated/v2/glyph.json +186 -0
- package/generated/v2/glyphs.json +196 -0
- package/generated/v2/language.json +76 -0
- package/generated/v2/languages.json +86 -0
- package/generated/v2/sign.json +221 -0
- package/generated/v2/signs.json +235 -0
- package/generated/v2/word.json +449 -0
- package/generated/v2/words.json +459 -0
- package/package.json +66 -35
- package/dist/client.d.ts +0 -2
- package/dist/client.js +0 -172
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -223
- package/dist/lib/client.d.ts +0 -743
- package/dist/lib/client.test.d.ts +0 -27
- package/dist/lib/index.d.ts +0 -962
- package/dist/lib/types.d.ts +0 -17
- package/dist/lib/utils.d.ts +0 -13
- package/dist/server/index.d.ts +0 -685
- package/dist/server/utils.d.ts +0 -19
- package/dist/server/v1/index.d.ts +0 -677
- package/dist/server/versioning.d.ts +0 -2423
- package/dist/utils-B3Jq5OVZ.js +0 -2899
- package/dist/utils.d.ts +0 -2
- package/dist/utils.js +0 -9
- package/generated/words.json +0 -315
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { client } from "./client.mjs";
|
|
2
|
+
import { d as LocalizedFingerspellingSign, f as LocalizedSign, g as Signs, i as Fingerspelling, l as Language, o as Font, p as LocalizedWord, s as Fonts, u as Languages, y as Words } from "../../index-nmyNJa57.mjs";
|
|
3
|
+
import { ClientResponse } from "hono/client";
|
|
4
|
+
import { Equal, Expect } from "hono/utils/types";
|
|
5
|
+
|
|
6
|
+
//#region src/lib/v1/client.test.d.ts
|
|
7
|
+
type ResponseType<F> = F extends {
|
|
8
|
+
$get: (...args: any[]) => Promise<ClientResponse<infer O>>;
|
|
9
|
+
} ? O : never;
|
|
10
|
+
type ClientType = ReturnType<typeof client>;
|
|
11
|
+
type Result<T> = {
|
|
12
|
+
ok: true;
|
|
13
|
+
data: T;
|
|
14
|
+
} | {
|
|
15
|
+
ok: false;
|
|
16
|
+
message: string;
|
|
17
|
+
};
|
|
18
|
+
type WordsTest = Expect<Equal<ResponseType<ClientType["v1"]["words"]>, Words>>;
|
|
19
|
+
type WordTest = Expect<Equal<ResponseType<ClientType["v1"]["words"][":word"]>, Result<LocalizedWord>>>;
|
|
20
|
+
type SignsTest = Expect<Equal<ResponseType<ClientType["v1"]["luka_pona"]["signs"]>, Signs>>;
|
|
21
|
+
type SignTest = Expect<Equal<ResponseType<ClientType["v1"]["luka_pona"]["signs"][":sign"]>, Result<LocalizedSign>>>;
|
|
22
|
+
type FingerspellingsTest = Expect<Equal<ResponseType<ClientType["v1"]["luka_pona"]["fingerspelling"]>, Fingerspelling>>;
|
|
23
|
+
type FingerspellingTest = Expect<Equal<ResponseType<ClientType["v1"]["luka_pona"]["fingerspelling"][":sign"]>, Result<LocalizedFingerspellingSign>>>;
|
|
24
|
+
type SandboxTest = Expect<Equal<ResponseType<ClientType["v1"]["sandbox"]>, Words>>;
|
|
25
|
+
type FontsTest = Expect<Equal<ResponseType<ClientType["v1"]["fonts"]>, Fonts>>;
|
|
26
|
+
type FontTest = Expect<Equal<ResponseType<ClientType["v1"]["fonts"][":font"]>, Result<Font>>>;
|
|
27
|
+
type LanguagesTest = Expect<Equal<ResponseType<ClientType["v1"]["languages"]>, Languages>>;
|
|
28
|
+
type LanguageTest = Expect<Equal<ResponseType<ClientType["v1"]["languages"][":language"]>, Result<Language>>>;
|
|
29
|
+
//#endregion
|
|
30
|
+
export { FingerspellingTest, FingerspellingsTest, FontTest, FontsTest, LanguageTest, LanguagesTest, SandboxTest, SignTest, SignsTest, WordTest, WordsTest };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as WordKuData, C as LocalizedWordDefinition, D as SignVideo, E as SignEtymology, F as WordUsage, M as WordRepresentations, N as WordTranslation, O as SignWriting, P as WordTranslations, S as LocalizedWordCommentary, T as LocalizedWordSitelenEtymology, _ as SitelenPonaTranslation, a as FingerspellingSign, b as FontLinks, c as IconTranslation, d as LocalizedFingerspellingSign, f as LocalizedSign, g as Signs, h as Sign, i as Fingerspelling, j as WordPuVerbatim, k as WordAudio, l as Language, m as ParametersTranslation, n as DefinitionTranslation, o as Font, p as LocalizedWord, r as EtymologyTranslation, s as Fonts, t as CommentaryTranslation, u as Languages, v as Word, w as LocalizedWordEtymology, x as LocalizedSignParameters, y as Words } from "../../index-nmyNJa57.mjs";
|
|
2
|
+
export { CommentaryTranslation, DefinitionTranslation, EtymologyTranslation, Fingerspelling, FingerspellingSign, Font, FontLinks, Fonts, IconTranslation, Language, Languages, LocalizedFingerspellingSign, LocalizedSign, LocalizedSignParameters, LocalizedWord, LocalizedWordCommentary, LocalizedWordDefinition, LocalizedWordEtymology, LocalizedWordSitelenEtymology, ParametersTranslation, Sign, SignEtymology, SignVideo, SignWriting, Signs, SitelenPonaTranslation, Word, WordAudio, WordKuData, WordPuVerbatim, WordRepresentations, WordTranslation, WordTranslations, WordUsage, Words };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { Book, CoinedEra, UsageCategory, WritingSystem } from "./utils.mjs";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
//#region src/lib/v1/index.ts
|
|
4
|
+
const YearMonth = z.string().regex(/^20\d{2}-(0[1-9]|1[0-2])$/g);
|
|
5
|
+
const Word = z.object({
|
|
6
|
+
id: z.string().min(1).describe(`A unique identifier for the word. Usually the word but may have an integer added in case of a word with multiple definitions (like "we")`),
|
|
7
|
+
author_verbatim: z.string().describe("The author's original definition, taken verbatim in their words"),
|
|
8
|
+
author_verbatim_source: z.string().describe("Where the author's original definition is located (usually Discord)"),
|
|
9
|
+
book: Book.describe("Which official Toki Pona book was this word featured in, if any."),
|
|
10
|
+
coined_era: CoinedEra.or(z.literal("")).describe("When this word was coined (relative to the publication dates of the official Toki Pona books, if known)"),
|
|
11
|
+
coined_year: z.string().describe("The year when this word was coined (if known)"),
|
|
12
|
+
creator: z.array(z.string()).describe("The person who created this word (if known)"),
|
|
13
|
+
ku_data: z.record(z.string().min(1).describe("A translation of the word into English proposed in ku"), z.number().min(0).max(100).describe("The percentage of ku survey respondents who report this translation as accurate to their usage.")).optional().describe("The usage data of the word as described in ku (the official Toki Pona dictionary)"),
|
|
14
|
+
see_also: z.array(z.string()).describe("A list of related words"),
|
|
15
|
+
resources: z.object({
|
|
16
|
+
sona_pona: z.string().url().optional().describe("A link to the word's page on sona.pona.la, a Toki Pona wiki. May redirect for words with references but no dedicated page."),
|
|
17
|
+
lipamanka_semantic: z.string().url().optional().describe("A link to lipamanka's description of the word's semantic space.")
|
|
18
|
+
}).optional().describe("Non-Linku resources related to the specific word, such as wiki links."),
|
|
19
|
+
representations: z.object({
|
|
20
|
+
sitelen_emosi: z.string().emoji().optional().describe("The sitelen emosi representation of this word, a script for writing Toki Pona using emoji"),
|
|
21
|
+
sitelen_jelo: z.array(z.string().emoji()).min(1).optional().describe("One or more example emojis for how the word can be written in sitelen jelo"),
|
|
22
|
+
ligatures: z.array(z.string().min(1)).optional().describe("A list of sitelen Lasina representations of the word, used by ligature fonts to visually convert latin characters into sitelen pona"),
|
|
23
|
+
sitelen_sitelen: z.string().url().optional().describe("A URL pointing to an image of this word's sitelen sitelen hieroglyphic block"),
|
|
24
|
+
ucsur: z.string().regex(/^U\+[\da-fA-F]{4,6}$/g).optional().describe("The word's UCSUR codepoint, as defined in https://www.kreativekorp.com/ucsur/charts/sitelen.html")
|
|
25
|
+
}).optional().describe("Ways of representing this word in the real world, via text/computers"),
|
|
26
|
+
source_language: z.string().describe("The language this word originated from"),
|
|
27
|
+
usage_category: UsageCategory.describe("The word's usage category, according to a survey performed by the Linku Project"),
|
|
28
|
+
word: z.string().describe(`The word's actual text, in case of a word with multiple definitions (like "we")`),
|
|
29
|
+
deprecated: z.boolean().describe("Whether or not the word is considered deprecated by its author."),
|
|
30
|
+
etymology: z.array(z.object({
|
|
31
|
+
word: z.string().optional().describe("One of the root words of this word, as written out in its language of origin"),
|
|
32
|
+
alt: z.string().optional().describe(`A latinized representation of the "word" field`)
|
|
33
|
+
})).describe("Unlocalized etymological values regarding this word's origin"),
|
|
34
|
+
audio: z.array(z.object({
|
|
35
|
+
author: z.string().describe("The author of the audio file in `link`."),
|
|
36
|
+
link: z.string().url().describe("A link to the audio file for the word, pronounced by `author`.")
|
|
37
|
+
}).describe("Audio files of the words pronounced out loud")),
|
|
38
|
+
pu_verbatim: z.object({
|
|
39
|
+
en: z.string().describe("The original definition in the English version of pu"),
|
|
40
|
+
fr: z.string().describe("The original definition in the French version of pu"),
|
|
41
|
+
de: z.string().describe("The original definition in the German version of pu"),
|
|
42
|
+
eo: z.string().describe("The original definition in the Esperanto version of pu")
|
|
43
|
+
}).optional().describe("The original definition of the word in pu, the first official Toki Pona book"),
|
|
44
|
+
usage: z.record(z.string().regex(/^20\d{2}-(0[1-9]|1[0-2])$/g), z.number().min(0).max(100)).describe("The percentage of people in the Toki Pona community who use this word, according to surveys performed by the Linku Project")
|
|
45
|
+
}).describe("General info on a Toki Pona word");
|
|
46
|
+
const CommentaryTranslation = z.record(z.string().min(1), z.string()).describe("Localized commentary regarding Toki Pona words");
|
|
47
|
+
const DefinitionTranslation = z.record(z.string().min(1), z.string().min(1)).describe("Localized definitions of Toki Pona words");
|
|
48
|
+
const SitelenPonaTranslation = z.record(z.string().min(1), z.string()).describe("Localized descriptions of the origins of the sitelen pona glyphs for Toki Pona words");
|
|
49
|
+
const EtymologyTranslation = z.record(z.string().min(1), z.array(z.object({
|
|
50
|
+
definition: z.string().optional().describe("The localized definition of the root word in its origin language"),
|
|
51
|
+
language: z.string().describe("The localized name of the language this word originated from")
|
|
52
|
+
}))).describe("Localized etymological values for Toki Pona words");
|
|
53
|
+
const Sign = z.object({
|
|
54
|
+
definition: z.string().describe("The definition of the sign as a single toki pona word."),
|
|
55
|
+
id: z.string().describe("A globally unique name for the sign which is also a gloss."),
|
|
56
|
+
is_two_handed: z.boolean().describe("Whether the sign is two-handed or not."),
|
|
57
|
+
new_gloss: z.string().describe("The more recent, preferred gloss for this sign."),
|
|
58
|
+
old_gloss: z.string().describe("The older gloss for this sign, similar to `id`."),
|
|
59
|
+
etymology: z.array(z.object({
|
|
60
|
+
language: z.string().describe("The language of the sign."),
|
|
61
|
+
sign: z.string().optional().describe("The name of the sign such that it could be found in a sign language dictionary.")
|
|
62
|
+
})).describe("Unlocalized etymological values regarding this sign's origin"),
|
|
63
|
+
signwriting: z.object({
|
|
64
|
+
fsw: z.string().describe("The [Formal SignWriting](https://en.wikipedia.org/wiki/SignWriting) representation of the sign."),
|
|
65
|
+
swu: z.string().describe("The [SignWriting with Unicode](https://en.wikipedia.org/wiki/SignWriting) representation of the sign.")
|
|
66
|
+
}).describe("Scripts for representing a sign as characters."),
|
|
67
|
+
video: z.object({
|
|
68
|
+
gif: z.string().optional().describe("A link to a gif of the sign being signed."),
|
|
69
|
+
mp4: z.string().optional().describe("a link to an mp4 of the sign being signed.")
|
|
70
|
+
}).describe("Videos of the sign being performed, by format.")
|
|
71
|
+
}).describe("Unlocalized info on a Luka Pona sign");
|
|
72
|
+
const FingerspellingSign = z.object({
|
|
73
|
+
id: z.string().describe("A globally unique name for the sign which is also a gloss."),
|
|
74
|
+
is_two_handed: z.boolean().describe("Whether the sign is two-handed or not."),
|
|
75
|
+
etymology: z.array(z.object({
|
|
76
|
+
language: z.string().describe("The language of the sign."),
|
|
77
|
+
sign: z.string().describe("The name of the sign such that it could be found in a sign language dictionary.")
|
|
78
|
+
})).describe("Unlocalized etymological values regarding this sign's origin"),
|
|
79
|
+
signwriting: z.object({
|
|
80
|
+
fsw: z.string().describe("The Formal Sign Writing representation of the sign."),
|
|
81
|
+
swu: z.string().describe("The Sign Writing with Unicode representation of hte sign.")
|
|
82
|
+
}).describe("Scripts for representing a sign as characters."),
|
|
83
|
+
video: z.object({
|
|
84
|
+
gif: z.string().optional().describe("A link to a gif of the sign being signed."),
|
|
85
|
+
mp4: z.string().optional().describe("a link to an mp4 of the sign being signed.")
|
|
86
|
+
}).describe("Videos of the sign being performed, by format.")
|
|
87
|
+
}).describe("Unlocalized info on a fingerspelling sign.");
|
|
88
|
+
const ParametersTranslation = z.record(z.string().min(1), z.object({
|
|
89
|
+
handshape: z.string().optional().describe("The shape of the hand when signing, identified by its name in ASL. Should not be translated in any language other than Toki Pona"),
|
|
90
|
+
movement: z.string().optional().describe("The motion of the hand when signing."),
|
|
91
|
+
placement: z.string().optional().describe("The placement of the hand when signing."),
|
|
92
|
+
orientation: z.string().optional().describe("The orientation of the hand when signing.")
|
|
93
|
+
})).describe("Partly localized descriptions of how a sign is signed.");
|
|
94
|
+
const IconTranslation = z.record(z.string().min(1), z.string()).describe("Localized descriptions of the thing a sign represents.");
|
|
95
|
+
const Font = z.object({
|
|
96
|
+
id: z.string().min(1).describe("The font's unique ID, identifying it among other fonts"),
|
|
97
|
+
creator: z.array(z.string()).describe("a list of this font's creators"),
|
|
98
|
+
features: z.array(z.string()).describe("a list of features this font supports"),
|
|
99
|
+
filename: z.string().regex(/^(?:.+\.(ttf|otf|woff2|woff))?$/).describe("the name of the file this font is stored in at https://github.com/lipu-linku/ijo"),
|
|
100
|
+
last_updated: YearMonth.optional().describe("the rough date of this font's last update"),
|
|
101
|
+
license: z.string().describe("an SPDX expression describing this font's license: https://spdx.org/licenses/"),
|
|
102
|
+
ligatures: z.boolean().describe("whether this font supports ligatures"),
|
|
103
|
+
name: z.string().min(1).describe("this font's name"),
|
|
104
|
+
style: z.string().min(1).describe("the general style of this font"),
|
|
105
|
+
ucsur: z.boolean().describe("whether this font conforms to the UCSUR standard: https://www.kreativekorp.com/ucsur/charts/sitelen.html"),
|
|
106
|
+
version: z.string().describe("the current version of this font"),
|
|
107
|
+
writing_system: WritingSystem.describe("the writing system this font uses as its script"),
|
|
108
|
+
links: z.object({
|
|
109
|
+
fontfile: z.string().url().optional().describe("a link to the font file published by the original author (not the mirror on the Linku Project's GitHub)"),
|
|
110
|
+
repo: z.string().url().optional().describe("a link to a web hosted repository of this font's source files (usually hosted on GitHub or GitLab)"),
|
|
111
|
+
webpage: z.string().url().optional().describe("a link to this font's home page, usually showcasing its features and usage/installation")
|
|
112
|
+
})
|
|
113
|
+
}).describe("Info on a font for Toki Pona");
|
|
114
|
+
const Words = z.record(z.string().min(1), Word.extend({ translations: z.record(z.string(), z.object({
|
|
115
|
+
commentary: CommentaryTranslation.valueType,
|
|
116
|
+
definition: DefinitionTranslation.valueType,
|
|
117
|
+
etymology: EtymologyTranslation.valueType,
|
|
118
|
+
sp_etymology: SitelenPonaTranslation.valueType
|
|
119
|
+
})) })).describe("A raw data object containing dictionary info about Toki Pona words");
|
|
120
|
+
const Signs = z.record(z.string().min(1), Sign.extend({ translations: z.record(z.string(), z.object({
|
|
121
|
+
parameters: ParametersTranslation.valueType,
|
|
122
|
+
icons: IconTranslation.valueType
|
|
123
|
+
})) })).describe("A raw data object containing information about Luka Pona signs");
|
|
124
|
+
const Fingerspelling = z.record(z.string().min(1), FingerspellingSign.extend({ translations: z.record(z.string(), z.object({ parameters: ParametersTranslation.valueType })) })).describe("A raw data object containing information about Luka Pona fingerspelling signs");
|
|
125
|
+
const Fonts = z.record(z.string(), Font).describe("A raw data object containing all the fonts data in sona");
|
|
126
|
+
const Languages = z.record(z.string().min(2).describe("The language code used by Crowdin. Approximates 2 letter code -> 3 letter code."), z.object({
|
|
127
|
+
id: z.string().min(2).describe("The language code used by Crowdin. Approximates 2 letter code -> 3 letter code."),
|
|
128
|
+
locale: z.string().describe("The locale code corresponding to the language."),
|
|
129
|
+
direction: z.union([z.literal("ltr"), z.literal("rtl")]).describe("The direction of the language's script."),
|
|
130
|
+
name: z.object({
|
|
131
|
+
en: z.string().describe("The name of the language in English."),
|
|
132
|
+
tok: z.string().optional().describe("The name of the language in Toki Pona."),
|
|
133
|
+
endonym: z.string().optional().describe("The name of the language in that language.")
|
|
134
|
+
})
|
|
135
|
+
}).describe("The languages offered by sona Linku."));
|
|
136
|
+
//#endregion
|
|
137
|
+
export { CommentaryTranslation, DefinitionTranslation, EtymologyTranslation, Fingerspelling, FingerspellingSign, Font, Fonts, IconTranslation, Languages, ParametersTranslation, Sign, Signs, SitelenPonaTranslation, Word, Words };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as WordKuData, C as LocalizedWordDefinition, D as SignVideo, E as SignEtymology, F as WordUsage, M as WordRepresentations, N as WordTranslation, O as SignWriting, P as WordTranslations, S as LocalizedWordCommentary, T as LocalizedWordSitelenEtymology, b as FontLinks, j as WordPuVerbatim, k as WordAudio, w as LocalizedWordEtymology, x as LocalizedSignParameters } from "../../index-nmyNJa57.mjs";
|
|
2
|
+
export { FontLinks, LocalizedSignParameters, LocalizedWordCommentary, LocalizedWordDefinition, LocalizedWordEtymology, LocalizedWordSitelenEtymology, SignEtymology, SignVideo, SignWriting, WordAudio, WordKuData, WordPuVerbatim, WordRepresentations, WordTranslation, WordTranslations, WordUsage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { A as WordKuData, C as LocalizedWordDefinition, D as SignVideo, E as SignEtymology, F as WordUsage, M as WordRepresentations, N as WordTranslation, O as SignWriting, P as WordTranslations, S as LocalizedWordCommentary, T as LocalizedWordSitelenEtymology, b as FontLinks, j as WordPuVerbatim, k as WordAudio, w as LocalizedWordEtymology, x as LocalizedSignParameters } from "../../index-nmyNJa57.mjs";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
|
|
4
|
+
//#region src/lib/v1/utils.d.ts
|
|
5
|
+
declare const Book: z.ZodUnion<readonly [z.ZodLiteral<"pu">, z.ZodLiteral<"ku suli">, z.ZodLiteral<"ku lili">, z.ZodLiteral<"none">]>;
|
|
6
|
+
type Book = z.infer<typeof Book>;
|
|
7
|
+
declare const CoinedEra: z.ZodUnion<readonly [z.ZodLiteral<"pre-pu">, z.ZodLiteral<"post-pu">, z.ZodLiteral<"post-ku">]>;
|
|
8
|
+
type CoinedEra = z.infer<typeof CoinedEra>;
|
|
9
|
+
declare const UsageCategory: z.ZodUnion<readonly [z.ZodLiteral<"core">, z.ZodLiteral<"common">, z.ZodLiteral<"uncommon">, z.ZodLiteral<"obscure">, z.ZodLiteral<"sandbox">]>;
|
|
10
|
+
type UsageCategory = z.infer<typeof UsageCategory>;
|
|
11
|
+
declare const WritingSystem: z.ZodEnum<{
|
|
12
|
+
"sitelen pona": "sitelen pona";
|
|
13
|
+
"sitelen sitelen": "sitelen sitelen";
|
|
14
|
+
alphabet: "alphabet";
|
|
15
|
+
syllabary: "syllabary";
|
|
16
|
+
logography: "logography";
|
|
17
|
+
"tokiponido alphabet": "tokiponido alphabet";
|
|
18
|
+
"tokiponido syllabary": "tokiponido syllabary";
|
|
19
|
+
"tokiponido logography": "tokiponido logography";
|
|
20
|
+
}>;
|
|
21
|
+
type WritingSystem = z.infer<typeof WritingSystem>;
|
|
22
|
+
declare function getTranslatedData<Obj extends {
|
|
23
|
+
translations: Record<string, object>;
|
|
24
|
+
}, Key extends keyof Obj["translations"][string]>(data: Obj, key: Key, language: string): Obj["translations"][string][Key];
|
|
25
|
+
//#endregion
|
|
26
|
+
export { Book, CoinedEra, FontLinks, LocalizedSignParameters, LocalizedWordCommentary, LocalizedWordDefinition, LocalizedWordEtymology, LocalizedWordSitelenEtymology, SignEtymology, SignVideo, SignWriting, UsageCategory, WordAudio, WordKuData, WordPuVerbatim, WordRepresentations, WordTranslation, WordTranslations, WordUsage, WritingSystem, getTranslatedData };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
//#region src/lib/v1/utils.ts
|
|
3
|
+
const Book = z.union([
|
|
4
|
+
z.literal("pu"),
|
|
5
|
+
z.literal("ku suli"),
|
|
6
|
+
z.literal("ku lili"),
|
|
7
|
+
z.literal("none")
|
|
8
|
+
]);
|
|
9
|
+
const CoinedEra = z.union([
|
|
10
|
+
z.literal("pre-pu"),
|
|
11
|
+
z.literal("post-pu"),
|
|
12
|
+
z.literal("post-ku")
|
|
13
|
+
]);
|
|
14
|
+
const UsageCategory = z.union([
|
|
15
|
+
z.literal("core"),
|
|
16
|
+
z.literal("common"),
|
|
17
|
+
z.literal("uncommon"),
|
|
18
|
+
z.literal("obscure"),
|
|
19
|
+
z.literal("sandbox")
|
|
20
|
+
]);
|
|
21
|
+
const WritingSystem = z.enum([
|
|
22
|
+
"sitelen pona",
|
|
23
|
+
"sitelen sitelen",
|
|
24
|
+
"alphabet",
|
|
25
|
+
"syllabary",
|
|
26
|
+
"logography",
|
|
27
|
+
"tokiponido alphabet",
|
|
28
|
+
"tokiponido syllabary",
|
|
29
|
+
"tokiponido logography"
|
|
30
|
+
]);
|
|
31
|
+
function getTranslatedData(data, key, language) {
|
|
32
|
+
return (data.translations[language] ?? data.translations["en"])[key];
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { Book, CoinedEra, UsageCategory, WritingSystem, getTranslatedData };
|