Skip to content

Commit

Permalink
feat: Support instance configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Nov 7, 2021
1 parent 0e1ead0 commit b7e5f23
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions src/entities/instance.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
import { Account } from '.';

export interface InstanceStatusesConfiguration {
maxCharacters: number;
maxMediaAttachments: number;
charactersReservedPerUrl: string;
}

export interface InstanceMediaAttachmentsConfiguration {
supportedMimeTypes: string[];
imageSizeLimit: number;
imageMatrixLimit: number;
videoSizeLimit: number;
videoFrameRateLimit: number;
videoMatrixLimit: number;
}

export interface InstancePollsConfiguration {
supportedMimeTypes: string[];
imageSizeLimit: number;
imageMatrixLimit: number;
videoSizeLimit: number;
videoFrameRateLimit: number;
videoMatrixLimit: number;
}

/**
* @see https://github.com/mastodon/mastodon/pull/16485
*/
export interface InstanceConfiguration {
statuses: InstanceStatusesConfiguration;
mediaAttachments: InstanceMediaAttachmentsConfiguration;
polls: InstancePollsConfiguration;
}

/**
* Represents the software instance of Mastodon running on this domain.
* @see https://docs.joinmastodon.org/entities/instance/
Expand Down Expand Up @@ -29,6 +62,8 @@ export interface Instance {
stats: InstanceStats;
/** Whether invitation in enabled */
invitesEnabled: boolean;
/** List various values like file size limits and supported mime types */
configuration: InstanceConfiguration;

/** Banner image for the website. */
thumbnail?: string | null;
Expand Down

0 comments on commit b7e5f23

Please sign in to comment.