Fix conversion between database and Lysand types

This commit is contained in:
Jesse Wierzbinski 2024-04-09 13:54:10 -10:00
parent 6d0a8a6478
commit 8563c97403
No known key found for this signature in database
7 changed files with 118 additions and 136 deletions

View file

@ -44,9 +44,19 @@ export interface Entity {
created_at: string;
uri: string;
type: string;
extensions?: {
"org.lysand:custom_emojis"?: {
emojis: Emoji[];
};
[key: string]: object | undefined;
};
}
export interface Publication {
export interface InlineCustomEmojis {
[key: string]: Emoji;
}
export interface Publication extends Entity {
type: "Note" | "Patch";
author: string;
content?: ContentFormat;
@ -57,6 +67,19 @@ export interface Publication {
subject?: string;
is_sensitive?: boolean;
visibility: Visibility;
extensions?: Entity["extensions"] & {
"org.lysand:reactions"?: {
reactions: string;
};
"org.lysand:polls"?: {
poll: {
options: ContentFormat[];
votes: number[];
multiple_choice?: boolean;
expires_at: string;
};
};
};
}
export enum Visibility {
@ -96,6 +119,9 @@ export interface User extends Entity {
dislikes: string;
inbox: string;
outbox: string;
extensions?: Entity["extensions"] & {
"org.lysand:vanity"?: VanityExtension;
};
}
export interface Field {