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

Improve type definition

parent d9fbddc2
No related branches found
No related tags found
No related merge requests found
......@@ -257,7 +257,7 @@ export type Endpoints = {
'messaging/messages/read': { req: TODO; res: TODO; };
// meta
'meta': { req: { detail?: boolean; }; res: InstanceMetadata; };
'meta': { req: { detail?: boolean; }; res: InstanceMetadata; }; // TODO: 「detail が true なら DetailedInstanceMetadata を返す」のような型付けをしたい
// miauth
'miauth/gen-token': { req: TODO; res: TODO; };
......
......@@ -154,7 +154,30 @@ export type MessagingMessage = {
groupId: string; // TODO
};
export type InstanceMetadata = {
export type LiteInstanceMetadata = {
maintainerName: string | null;
maintainerEmail: string | null;
version: string;
name: string | null;
uri: string;
description: string | null;
tosUrl: string | null;
disableRegistration: boolean;
disableLocalTimeline: boolean;
disableGlobalTimeline: boolean;
driveCapacityPerLocalUserMb: number;
driveCapacityPerRemoteUserMb: number;
enableHcaptcha: boolean;
hcaptchaSiteKey: string | null;
enableRecaptcha: boolean;
recaptchaSiteKey: string | null;
swPublickey: string | null;
maxNoteTextLength: number;
enableEmail: boolean;
enableTwitterIntegration: boolean;
enableGithubIntegration: boolean;
enableDiscordIntegration: boolean;
enableServiceWorker: boolean;
emojis: {
id: string;
name: string;
......@@ -171,6 +194,12 @@ export type InstanceMetadata = {
}[];
};
export type DetailedInstanceMetadata = LiteInstanceMetadata & {
features: Record<string, any>;
};
export type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata;
export type ServerInfo = {
machine: string;
cpu: {
......
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