This commit is contained in:
tamaina
2023-05-29 16:47:49 +00:00
parent 68a2aa3efd
commit 931cea75b6
4 changed files with 67 additions and 35 deletions

View File

@@ -1,3 +1,4 @@
import { Serialized } from "schema-type";
import { Packed } from "./schemas";
export type ID = Packed<'Id'>;
@@ -6,21 +7,21 @@ export type DateString = string;
type TODO = Record<string, any>;
// NOTE: 極力この型を使うのは避け、UserLite か UserDetailed か明示するように
export type User = Packed<'User'>;
export type User = Serialized<Packed<'User'>>;
export type UserLite = Packed<'UserLite'>;
export type UserDetailed = Packed<'UserDetailed'>;
export type UserList = Packed<'UserList'>;
export type MeDetailed = Packed<'MeDetailed'>;
export type DriveFile = Packed<'DriveFile'>;
export type DriveFolder = Packed<'DriveFolder'>;
export type GalleryPost = Packed<'GalleryPost'>;
export type Note = Packed<'Note'>;
export type NoteReaction = Packed<'NoteReaction'>;
export type NoteFavorite = Packed<'NoteFavorite'>;
export type Notification = Packed<'NotificationStrict'>;
export type CustomEmoji = Packed<'EmojiSimple'> | Packed<'EmojiDetailed'>;
export type Page = Packed<'Page'>;
export type UserLite = Serialized<Packed<'UserLite'>>;
export type UserDetailed = Serialized<Packed<'UserDetailed'>>;
export type UserList = Serialized<Packed<'UserList'>>;
export type MeDetailed = Serialized<Packed<'MeDetailed'>>;
export type DriveFile = Serialized<Packed<'DriveFile'>>;
export type DriveFolder = Serialized<Packed<'DriveFolder'>>;
export type GalleryPost = Serialized<Packed<'GalleryPost'>>;
export type Note = Serialized<Packed<'Note'>>;
export type NoteReaction = Serialized<Packed<'NoteReaction'>>;
export type NoteFavorite = Serialized<Packed<'NoteFavorite'>>;
export type Notification = Serialized<Packed<'NotificationStrict'>>;
export type CustomEmoji = Serialized<Packed<'EmojiSimple'> | Packed<'EmojiDetailed'>>;
export type Page = Serialized<Packed<'Page'>>;
export type PageEvent = {
pageId: Page['id'];
@@ -30,19 +31,19 @@ export type PageEvent = {
user: User;
};
export type Announcement = Packed<'Announcement'>;
export type Antenna = Packed<'Antenna'>;
export type App = Packed<'App'>;
export type Ad = Packed<'Ad'>;
export type Clip = Packed<'Clip'>;
export type Channel = Packed<'Channel'>;
export type Following = Packed<'Following'>;
export type Blocking = Packed<'Blocking'>;
export type Relay = Packed<'Relay'>;
export type Role = Packed<'Role'>;
export type RoleAssign = Packed<'RoleAssign'>;
export type RolePolicy = Packed<'RolePolicy'>;
export type RoleCondFormula = Packed<'RoleCondFormula'>;
export type Announcement = Serialized<Packed<'Announcement'>>;
export type Antenna = Serialized<Packed<'Antenna'>>;
export type App = Serialized<Packed<'App'>>;
export type Ad = Serialized<Packed<'Ad'>>;
export type Clip = Serialized<Packed<'Clip'>>;
export type Channel = Serialized<Packed<'Channel'>>;
export type Following = Serialized<Packed<'Following'>>;
export type Blocking = Serialized<Packed<'Blocking'>>;
export type Relay = Serialized<Packed<'Relay'>>;
export type Role = Serialized<Packed<'Role'>>;
export type RoleAssign = Serialized<Packed<'RoleAssign'>>;
export type RolePolicy = Serialized<Packed<'RolePolicy'>>;
export type RoleCondFormula = Serialized<Packed<'RoleCondFormula'>>;
export type LiteInstanceMetadata = {
maintainerName: string | null;
@@ -106,7 +107,7 @@ export type DetailedInstanceMetadata = LiteInstanceMetadata & {
export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata;
export type ServerInfo = Packed<'ServerInfo'>;
export type ServerInfo = Selialized<Packed<'ServerInfo'>>;
export type Stats = {
notesCount: number;
@@ -167,13 +168,7 @@ export type Instance = {
infoUpdatedAt: DateString | null;
};
export type Signin = {
id: ID;
createdAt: DateString;
ip: string;
headers: Record<string, any>;
success: boolean;
};
export type Signin = Serialized<Packed<'SignIn'>>;
export type UserSorting =
| '+follower'