bigbuffet-rw/packages/pl-api/lib/entities/preview-card-author.ts

18 lines
471 B
TypeScript
Raw Normal View History

import * as v from 'valibot';
import { accountSchema } from './account';
/**
* @category Schemas
* @see {@link https://docs.joinmastodon.org/entities/PreviewCardAuthor/}
*/
const previewCardAuthorSchema = v.object({
name: v.string(),
url: v.pipe(v.string(), v.url()),
account: v.fallback(v.nullable(accountSchema), null),
});
type PreviewCardAuthor = v.InferOutput<typeof previewCardAuthorSchema>;
export { previewCardAuthorSchema, type PreviewCardAuthor };