This commit is contained in:
2026-04-27 19:17:02 +08:00
parent 9947701fc4
commit 14828597db
88 changed files with 1897 additions and 274 deletions

View File

View File

@@ -0,0 +1,27 @@
export type VersionVector = {
deviceId: string; // 一个手机可能会有多个浏览器登录,通常一个浏览器被称为一个设备
};
export interface IBookmarkNode {
id: string;
title: string;
parentId: string | null;
rename(title: string): void;
}
export class BookmarkNode implements IBookmarkNode {
id: string;
title: string;
parentId: string | null;
constructor(id: string, title: string) {
this.id = id;
this.title = title;
this.parentId = null;
}
rename(title: string) {
this.title = title;
}
}

View File

@@ -0,0 +1,39 @@
import { BookmarkNode } from "./bookmark-node";
export interface IFolderNode {
id: string;
title: string;
parentId: string | null;
bookmarkNode: BookmarkNode[];
addBookmarkNode(node: BookmarkNode): void;
rename(title: string): void;
}
export class FolderNode implements IFolderNode {
id: string;
title: string;
parentId: string | null;
bookmarkNode: BookmarkNode[];
constructor(
id: string,
title: string,
parentId: string | null = null,
bookmarkNode: BookmarkNode[],
) {
this.id = id;
this.title = title;
this.parentId = parentId;
this.bookmarkNode = bookmarkNode;
}
addBookmarkNode(node: BookmarkNode): void {
this.bookmarkNode.push(node);
node.parentId = this.id;
}
rename(title: string) {
this.title = title;
}
}

View File

@@ -0,0 +1,17 @@
export class Server {
serverUrl: string;
constructor(serverUrl: string) {
this.serverUrl = serverUrl;
}
login(email: string, password: string) {
const result = false;
return result;
}
logout(email: string, password: string) {
const result = false;
return result;
}
}