feat: 初始化 kenaito-notebook 桌面记事本项目

This commit is contained in:
2026-06-13 21:08:00 +08:00
commit 5fafcd28e3
55 changed files with 9722 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
import {models} from '../models';
export function CreateNote(arg1:number,arg2:string,arg3:boolean):Promise<models.Note>;
export function DeleteNote(arg1:number):Promise<void>;
export function EmptyTrash():Promise<void>;
export function ExportAllMarkdown():Promise<string>;
export function ExportFolderMarkdown(arg1:number):Promise<string>;
export function ExportHTML(arg1:string,arg2:string):Promise<string>;
export function ExportMarkdown(arg1:string,arg2:string):Promise<string>;
export function GetAssetsPath():Promise<string>;
export function GetFileServerURL():Promise<string>;
export function GetNote(arg1:number):Promise<models.Note>;
export function GetNoteTree():Promise<Array<models.NoteTree>>;
export function GetTrashNotes():Promise<Array<models.Note>>;
export function GetUser():Promise<Record<string, any>>;
export function IsLoggedIn():Promise<boolean>;
export function Login(arg1:string,arg2:string):Promise<string>;
export function Logout():Promise<void>;
export function PermanentDeleteNote(arg1:number):Promise<void>;
export function Register(arg1:string,arg2:string,arg3:string):Promise<string>;
export function ResetPassword(arg1:string,arg2:string,arg3:string):Promise<void>;
export function RestoreNote(arg1:number):Promise<void>;
export function RevealInFinder(arg1:string):Promise<void>;
export function SaveFile(arg1:string,arg2:string):Promise<string>;
export function SaveImage(arg1:string):Promise<string>;
export function SearchNotes(arg1:string):Promise<Array<models.Note>>;
export function SelectDirectory(arg1:string):Promise<string>;
export function SelectSaveFile(arg1:string,arg2:string):Promise<string>;
export function SendVerifyCode(arg1:string,arg2:string):Promise<void>;
export function UpdateNote(arg1:number,arg2:string,arg3:string,arg4:string):Promise<void>;
export function VerifyCode(arg1:string,arg2:string,arg3:string):Promise<void>;
+119
View File
@@ -0,0 +1,119 @@
// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
export function CreateNote(arg1, arg2, arg3) {
return window['go']['main']['App']['CreateNote'](arg1, arg2, arg3);
}
export function DeleteNote(arg1) {
return window['go']['main']['App']['DeleteNote'](arg1);
}
export function EmptyTrash() {
return window['go']['main']['App']['EmptyTrash']();
}
export function ExportAllMarkdown() {
return window['go']['main']['App']['ExportAllMarkdown']();
}
export function ExportFolderMarkdown(arg1) {
return window['go']['main']['App']['ExportFolderMarkdown'](arg1);
}
export function ExportHTML(arg1, arg2) {
return window['go']['main']['App']['ExportHTML'](arg1, arg2);
}
export function ExportMarkdown(arg1, arg2) {
return window['go']['main']['App']['ExportMarkdown'](arg1, arg2);
}
export function GetAssetsPath() {
return window['go']['main']['App']['GetAssetsPath']();
}
export function GetFileServerURL() {
return window['go']['main']['App']['GetFileServerURL']();
}
export function GetNote(arg1) {
return window['go']['main']['App']['GetNote'](arg1);
}
export function GetNoteTree() {
return window['go']['main']['App']['GetNoteTree']();
}
export function GetTrashNotes() {
return window['go']['main']['App']['GetTrashNotes']();
}
export function GetUser() {
return window['go']['main']['App']['GetUser']();
}
export function IsLoggedIn() {
return window['go']['main']['App']['IsLoggedIn']();
}
export function Login(arg1, arg2) {
return window['go']['main']['App']['Login'](arg1, arg2);
}
export function Logout() {
return window['go']['main']['App']['Logout']();
}
export function PermanentDeleteNote(arg1) {
return window['go']['main']['App']['PermanentDeleteNote'](arg1);
}
export function Register(arg1, arg2, arg3) {
return window['go']['main']['App']['Register'](arg1, arg2, arg3);
}
export function ResetPassword(arg1, arg2, arg3) {
return window['go']['main']['App']['ResetPassword'](arg1, arg2, arg3);
}
export function RestoreNote(arg1) {
return window['go']['main']['App']['RestoreNote'](arg1);
}
export function RevealInFinder(arg1) {
return window['go']['main']['App']['RevealInFinder'](arg1);
}
export function SaveFile(arg1, arg2) {
return window['go']['main']['App']['SaveFile'](arg1, arg2);
}
export function SaveImage(arg1) {
return window['go']['main']['App']['SaveImage'](arg1);
}
export function SearchNotes(arg1) {
return window['go']['main']['App']['SearchNotes'](arg1);
}
export function SelectDirectory(arg1) {
return window['go']['main']['App']['SelectDirectory'](arg1);
}
export function SelectSaveFile(arg1, arg2) {
return window['go']['main']['App']['SelectSaveFile'](arg1, arg2);
}
export function SendVerifyCode(arg1, arg2) {
return window['go']['main']['App']['SendVerifyCode'](arg1, arg2);
}
export function UpdateNote(arg1, arg2, arg3, arg4) {
return window['go']['main']['App']['UpdateNote'](arg1, arg2, arg3, arg4);
}
export function VerifyCode(arg1, arg2, arg3) {
return window['go']['main']['App']['VerifyCode'](arg1, arg2, arg3);
}
+113
View File
@@ -0,0 +1,113 @@
export namespace models {
export class Note {
id: number;
parentId: number;
title: string;
content: string;
sortOrder: number;
isFolder: boolean;
tag: string;
// Go type: time
createdAt: any;
// Go type: time
updatedAt: any;
// Go type: time
deletedAt?: any;
children?: Note[];
static createFrom(source: any = {}) {
return new Note(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.parentId = source["parentId"];
this.title = source["title"];
this.content = source["content"];
this.sortOrder = source["sortOrder"];
this.isFolder = source["isFolder"];
this.tag = source["tag"];
this.createdAt = this.convertValues(source["createdAt"], null);
this.updatedAt = this.convertValues(source["updatedAt"], null);
this.deletedAt = this.convertValues(source["deletedAt"], null);
this.children = this.convertValues(source["children"], Note);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
export class NoteTree {
id: number;
parentId: number;
title: string;
content: string;
sortOrder: number;
isFolder: boolean;
tag: string;
// Go type: time
createdAt: any;
// Go type: time
updatedAt: any;
// Go type: time
deletedAt?: any;
children?: Note[];
children: NoteTree[];
static createFrom(source: any = {}) {
return new NoteTree(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.id = source["id"];
this.parentId = source["parentId"];
this.title = source["title"];
this.content = source["content"];
this.sortOrder = source["sortOrder"];
this.isFolder = source["isFolder"];
this.tag = source["tag"];
this.createdAt = this.convertValues(source["createdAt"], null);
this.updatedAt = this.convertValues(source["updatedAt"], null);
this.deletedAt = this.convertValues(source["deletedAt"], null);
this.children = this.convertValues(source["children"], Note);
this.children = this.convertValues(source["children"], NoteTree);
}
convertValues(a: any, classs: any, asMap: boolean = false): any {
if (!a) {
return a;
}
if (a.slice && a.map) {
return (a as any[]).map(elem => this.convertValues(elem, classs));
} else if ("object" === typeof a) {
if (asMap) {
for (const key of Object.keys(a)) {
a[key] = new classs(a[key]);
}
return a;
}
return new classs(a);
}
return a;
}
}
}