import { Serialized } from "schema-type"; import { Packed } from "./schemas"; export type ID = Packed<'Id'>; export type DateString = string; type TODO = Record; // NOTE: 極力この型を使うのは避け、UserLite か UserDetailed か明示するように export type User = Serialized>; export type UserLite = Serialized>; export type UserDetailed = Serialized>; export type UserList = Serialized>; export type MeDetailed = Serialized>; export type DriveFile = Serialized>; export type DriveFolder = Serialized>; export type GalleryPost = Serialized>; export type Note = Serialized>; export type NoteReaction = Serialized>; export type NoteFavorite = Serialized>; export type Notification = Serialized>; export type CustomEmoji = Serialized | Packed<'EmojiDetailed'>>; export type Page = Serialized>; export type PageEvent = { pageId: Page['id']; event: string; var: any; userId: User['id']; user: User; }; export type Announcement = Serialized>; export type Antenna = Serialized>; export type App = Serialized>; export type Ad = Serialized>; export type Clip = Serialized>; export type Channel = Serialized>; export type Following = Serialized>; export type Blocking = Serialized>; export type Relay = Serialized>; export type Role = Serialized>; export type RoleAssign = Serialized>; export type RolePolicy = Serialized>; export type RoleCondFormula = Serialized>; export type LiteInstanceMetadata = { maintainerName: string | null; maintainerEmail: string | null; version: string; name: string | null; uri: string; description: string | null; langs: string[]; tosUrl: string | null; repositoryUrl: string; feedbackUrl: string; disableRegistration: boolean; disableLocalTimeline: boolean; disableGlobalTimeline: boolean; driveCapacityPerLocalUserMb: number; driveCapacityPerRemoteUserMb: number; emailRequiredForSignup: boolean; enableHcaptcha: boolean; hcaptchaSiteKey: string | null; enableRecaptcha: boolean; recaptchaSiteKey: string | null; enableTurnstile: boolean; turnstileSiteKey: string | null; swPublickey: string | null; themeColor: string | null; mascotImageUrl: string | null; bannerUrl: string | null; errorImageUrl: string | null; iconUrl: string | null; backgroundImageUrl: string | null; logoImageUrl: string | null; maxNoteTextLength: number; enableEmail: boolean; enableTwitterIntegration: boolean; enableGithubIntegration: boolean; enableDiscordIntegration: boolean; enableServiceWorker: boolean; emojis: CustomEmoji[]; defaultDarkTheme: string | null; defaultLightTheme: string | null; ads: { id: ID; ratio: number; place: string; url: string; imageUrl: string; }[]; translatorAvailable: boolean; serverRules: string[]; }; export type DetailedInstanceMetadata = LiteInstanceMetadata & { pinnedPages: string[]; pinnedClipId: string | null; cacheRemoteFiles: boolean; requireSetup: boolean; proxyAccountName: string | null; features: Record; }; export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata; export type ServerInfo = Serialized>; export type Stats = { notesCount: number; originalNotesCount: number; usersCount: number; originalUsersCount: number; instances: number; driveUsageLocal: number; driveUsageRemote: number; }; export type AuthSession = Serialized>; export type FollowRequest = { id: ID; follower: User; followee: User; }; export type FollowingFolloweePopulated = Following & { followee: UserDetailed; }; export type FollowingFollowerPopulated = Following & { follower: UserDetailed; }; export type Instance = { id: ID; caughtAt: DateString; host: string; usersCount: number; notesCount: number; followingCount: number; followersCount: number; driveUsage: number; driveFiles: number; latestRequestSentAt: DateString | null; latestStatus: number | null; latestRequestReceivedAt: DateString | null; lastCommunicatedAt: DateString; isNotResponding: boolean; isSuspended: boolean; softwareName: string | null; softwareVersion: string | null; openRegistrations: boolean | null; name: string | null; description: string | null; maintainerName: string | null; maintainerEmail: string | null; iconUrl: string | null; faviconUrl: string | null; themeColor: string | null; infoUpdatedAt: DateString | null; }; export type Signin = Serialized>; export type UserSorting = | '+follower' | '-follower' | '+createdAt' | '-createdAt' | '+updatedAt' | '-updatedAt'; export type OriginType = 'combined' | 'local' | 'remote';