bigbuffet-rw/packages/pl-api/lib/entities/status-source.ts
marcin mikołajczak bc65755862 pl-api: Update docs
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-11-29 16:01:54 +01:00

26 lines
737 B
TypeScript

import * as v from 'valibot';
import { locationSchema } from './location';
/**
* @category Schemas
* @see {@link https://docs.joinmastodon.org/entities/StatusSource/}
*/
const statusSourceSchema = v.object({
id: v.string(),
text: v.fallback(v.string(), ''),
spoiler_text: v.fallback(v.string(), ''),
content_type: v.fallback(v.string(), 'text/plain'),
location: v.fallback(v.nullable(locationSchema), null),
text_map: v.fallback(v.nullable(v.record(v.string(), v.string())), null),
spoiler_text_map: v.fallback(v.nullable(v.record(v.string(), v.string())), null),
});
/**
* @category Entity types
*/
type StatusSource = v.InferOutput<typeof statusSourceSchema>;
export { statusSourceSchema, type StatusSource };