bigbuffet-rw/packages/pl-api/lib/entities/search.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

25 lines
641 B
TypeScript

import * as v from 'valibot';
import { accountSchema } from './account';
import { groupSchema } from './group';
import { statusSchema } from './status';
import { tagSchema } from './tag';
import { filteredArray } from './utils';
/**
* @category Schemas
* @see {@link https://docs.joinmastodon.org/entities/Search}
*/
const searchSchema = v.object({
accounts: filteredArray(accountSchema),
statuses: filteredArray(statusSchema),
hashtags: filteredArray(tagSchema),
groups: filteredArray(groupSchema),
});
/**
* @category Entity types
*/
type Search = v.InferOutput<typeof searchSchema>;
export { searchSchema, type Search };