mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 21:24:05 +02:00
feat: universal types for rust and ts
This commit is contained in:
parent
a94496dbdb
commit
ed0dfa41ae
2 changed files with 94 additions and 29 deletions
|
@ -1,21 +1,35 @@
|
|||
export interface HistoryItem {
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
|
||||
export enum ContentType {
|
||||
Text = "text",
|
||||
Image = "image",
|
||||
File = "file",
|
||||
Link = "link",
|
||||
Color = "color",
|
||||
Code = "code",
|
||||
}
|
||||
|
||||
export class HistoryItem {
|
||||
id: string;
|
||||
content_type: ContentType;
|
||||
content: string;
|
||||
favicon: string;
|
||||
favicon?: string;
|
||||
timestamp: Date;
|
||||
|
||||
constructor(content_type: ContentType, content: string, favicon?: string) {
|
||||
this.id = uuidv4();
|
||||
this.content_type = content_type;
|
||||
this.content = content;
|
||||
this.favicon = favicon;
|
||||
this.timestamp = new Date();
|
||||
}
|
||||
|
||||
toRow(): [string, string, string, string | undefined, Date] {
|
||||
return [this.id, this.content_type, this.content, this.favicon, this.timestamp];
|
||||
}
|
||||
}
|
||||
|
||||
export interface Settings {
|
||||
key: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export enum ContentType {
|
||||
TEXT,
|
||||
IMAGE,
|
||||
FILE,
|
||||
LINK,
|
||||
COLOR,
|
||||
CODE,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue