1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

added callbacks to upload

This commit is contained in:
Fedor Katurov 2019-11-19 11:46:17 +07:00
parent 59252232e0
commit b6756bb3e5
5 changed files with 95 additions and 58 deletions

View file

@ -1,7 +1,7 @@
import { DetailedHTMLProps, InputHTMLAttributes } from 'react';
import { DIALOGS } from '~/redux/modal/constants';
import { ERRORS } from '~/constants/errors';
import { IUser } from './auth/types';
import { DetailedHTMLProps, InputHTMLAttributes } from "react";
import { DIALOGS } from "~/redux/modal/constants";
import { ERRORS } from "~/constants/errors";
import { IUser } from "./auth/types";
export interface ITag {
id: number;
@ -55,7 +55,7 @@ export interface IResultWithStatus<T> {
export type UUID = string;
export type IUploadType = 'image' | 'text' | 'audio' | 'video' | 'other';
export type IUploadType = "image" | "text" | "audio" | "video" | "other";
export interface IFile {
id?: number;
@ -91,15 +91,17 @@ export interface IFileWithUUID {
subject?: string;
target: string;
type: string;
onSuccess?: (file: IFile) => void;
onFail?: () => void;
}
export interface IBlockText {
type: 'text';
type: "text";
text: string;
}
export interface IBlockEmbed {
type: 'video';
type: "video";
url: string;
}
@ -122,7 +124,7 @@ export interface INode {
is_heroic?: boolean;
flow: {
display: 'single' | 'vertical' | 'horizontal' | 'quadro';
display: "single" | "vertical" | "horizontal" | "quadro";
show_description: boolean;
};
@ -145,7 +147,7 @@ export interface IComment {
update_at?: string;
}
export type IMessage = Omit<IComment, 'user' | 'node'> & {
export type IMessage = Omit<IComment, "user" | "node"> & {
from: IUser;
to: IUser;
};
@ -153,7 +155,7 @@ export type IMessage = Omit<IComment, 'user' | 'node'> & {
export interface ICommentGroup {
user: IUser;
comments: IComment[];
ids: IComment['id'][];
ids: IComment["id"][];
}
export type IUploadProgressHandler = (progress: ProgressEvent) => void;
@ -162,25 +164,25 @@ export type IValidationErrors = Record<string, IError>;
export type InputHandler<T = string> = (val: T) => void;
export const NOTIFICATION_TYPES = {
message: 'message',
comment: 'comment',
node: 'node',
message: "message",
comment: "comment",
node: "node"
};
export type IMessageNotification = {
type: typeof NOTIFICATION_TYPES['message'];
type: typeof NOTIFICATION_TYPES["message"];
content: Partial<IMessage>;
created_at: string;
};
export type ICommentNotification = {
type: typeof NOTIFICATION_TYPES['comment'];
type: typeof NOTIFICATION_TYPES["comment"];
content: Partial<IComment>;
created_at: string;
};
export type INodeNotification = {
type: typeof NOTIFICATION_TYPES['node'];
type: typeof NOTIFICATION_TYPES["node"];
content: Partial<INode>;
created_at: string;
};