18 lines
471 B
TypeScript
18 lines
471 B
TypeScript
|
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 };
|