2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-30 10:28:12 -07:00
|
|
|
|
2024-11-29 06:52:33 -08:00
|
|
|
/**
|
|
|
|
* @category Directory schemas
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
const directoryLanguageSchema = v.object({
|
|
|
|
locale: v.string(),
|
|
|
|
language: v.string(),
|
2024-10-14 13:50:34 -07:00
|
|
|
servers_count: v.fallback(v.nullable(v.pipe(v.unknown(), v.transform(Number))), null),
|
2024-08-30 10:28:12 -07:00
|
|
|
});
|
|
|
|
|
2024-11-29 06:52:33 -08:00
|
|
|
/**
|
2024-11-29 07:01:54 -08:00
|
|
|
* @category Directory entity types
|
2024-11-29 06:52:33 -08:00
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
type DirectoryLanguage = v.InferOutput<typeof directoryLanguageSchema>;
|
2024-08-30 10:28:12 -07:00
|
|
|
|
|
|
|
export { directoryLanguageSchema, type DirectoryLanguage };
|