refactor: more TS code

This commit is contained in:
Tristan Yang
2022-07-29 22:59:22 +08:00
parent 6bb7af46a0
commit 33c24baecb
52 changed files with 232 additions and 273 deletions
+8 -1
View File
@@ -1,11 +1,16 @@
import { createSlice, PayloadAction } from "@reduxjs/toolkit";
import BASE_URL, { ContentTypes } from "../config";
import { isImage } from "../../common/utils";
import { ContentType } from "../../types/message";
export interface MessagePayload {
mid: number;
from_uid?: number;
read?: boolean;
created_at?: number;
sending: boolean;
content_type: string;
content_type: ContentType;
content: string;
expires_in?: number | null;
properties?: {
content_type: string;
size: number;
@@ -13,6 +18,8 @@ export interface MessagePayload {
file_path?: string;
download?: string;
thumbnail?: string;
edited?: boolean | number;
reply_mid?: number;
}
export interface State {
[key: number]: MessagePayload;
+8 -1
View File
@@ -8,7 +8,14 @@ export interface State {
menuExpand: boolean;
// todo
fileListView: string;
uploadFiles: { [key: string]: any };
uploadFiles: {
[key: string]: {
name: string;
url: string;
size: number;
type: string;
}[];
};
selectMessages: { [key: string]: any };
draftMarkdown: { [key: string]: any };
draftMixedText: { [key: string]: any };