bigbuffet-rw/packages/pl-api/lib/entities/search.ts
marcin mikołajczak 77c0689321 pl-api: Avoid barrel imports
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-10-20 12:53:12 +02:00

19 lines
582 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';
/** @see {@link https://docs.joinmastodon.org/entities/Search} */
const searchSchema = v.object({
accounts: filteredArray(accountSchema),
statuses: filteredArray(statusSchema),
hashtags: filteredArray(tagSchema),
groups: filteredArray(groupSchema),
});
type Search = v.InferOutput<typeof searchSchema>;
export { searchSchema, type Search };