Skip to content
Snippets Groups Projects
Commit bde22208 authored by syuilo's avatar syuilo
Browse files

refactor: fix types

parent d4eb1def
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ import { packedFederationInstanceSchema } from '@/models/schema/federation-insta
import { packedQueueCountSchema } from '@/models/schema/queue.js';
import { packedGalleryPostSchema } from '@/models/schema/gallery-post.js';
import { packedEmojiSchema } from '@/models/schema/emoji.js';
import { packedFlashSchema } from '@/models/schema/flash.js';
export const refs = {
UserLite: packedUserLiteSchema,
......@@ -57,6 +58,7 @@ export const refs = {
FederationInstance: packedFederationInstanceSchema,
GalleryPost: packedGalleryPostSchema,
Emoji: packedEmojiSchema,
Flash: packedFlashSchema,
};
export type Packed<x extends keyof typeof refs> = SchemaType<typeof refs[x]>;
......
export const packedFlashSchema = {
type: 'object',
properties: {
id: {
type: 'string',
optional: false, nullable: false,
format: 'id',
example: 'xxxxxxxxxx',
},
createdAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
updatedAt: {
type: 'string',
optional: false, nullable: false,
format: 'date-time',
},
title: {
type: 'string',
optional: false, nullable: false,
},
summary: {
type: 'string',
optional: false, nullable: false,
},
script: {
type: 'string',
optional: false, nullable: false,
},
userId: {
type: 'string',
optional: false, nullable: false,
format: 'id',
},
user: {
type: 'object',
ref: 'UserLite',
optional: false, nullable: false,
},
likedCount: {
type: 'number',
optional: false, nullable: true,
},
isLiked: {
type: 'boolean',
optional: true, nullable: false,
},
},
} as const;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment