2024-10-13 15:25:30 -07:00
|
|
|
import * as v from 'valibot';
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
import { statusSchema } from './status';
|
|
|
|
|
2024-10-29 14:26:53 -07:00
|
|
|
/**
|
|
|
|
* @category Schemas
|
|
|
|
* @see {@link https://docs.joinmastodon.org/entities/Context/}
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
const contextSchema = v.object({
|
2024-10-14 13:50:34 -07:00
|
|
|
ancestors: v.array(statusSchema),
|
|
|
|
descendants: v.array(statusSchema),
|
2024-08-28 04:43:23 -07:00
|
|
|
});
|
|
|
|
|
2024-11-29 07:01:54 -08:00
|
|
|
/**
|
|
|
|
* @category Entity types
|
|
|
|
*/
|
2024-10-13 15:25:30 -07:00
|
|
|
type Context = v.InferOutput<typeof contextSchema>;
|
2024-08-28 04:43:23 -07:00
|
|
|
|
|
|
|
export { contextSchema, type Context };
|