/// import { EventEmitter } from 'events'; import Sqlite from './sqlite_db'; import { Note, User } from '../common/interface'; export interface TagInfo { wizName?: string; wizFull?: string; [index: string]: TagInfo | string | undefined; } export interface QueryNotesOptions { tags?: string | string[]; trash?: boolean; starred?: boolean; archived?: boolean; onTop?: boolean; title?: string; searchText?: string; withText?: boolean; analysisTags?: boolean; } export interface CreateNoteOptions { guid?: string; type?: string; category?: string; markdown?: string; html?: string; tag?: string; images?: string[]; title?: string; created?: number; modified?: number; fileType?: string | undefined | null; name?: string | undefined | null; seo?: string | undefined | null; url?: string | undefined | null; tags?: string | undefined | null; owner?: string | undefined | null; } declare class WizDb extends EventEmitter { _basePath: string; _sqlite: Sqlite; _kbGuid: string; _userGuid: string; _downloadNoteHandler?: (database: WizDb, noteGuid: string) => Promise; constructor(userGuid: string, kbGuid: string, isPersonalKb: boolean); get userGuid(): string; setDownloadNoteHandler(handler: (database: WizDb, noteGuid: string) => Promise): void; setMeta(key: string, value: string | number): Promise; getMeta(key: string, defaultValue?: string | number): Promise; open(): Promise; close(): Promise; updateAccount(userId: string, password: string, server: string, user: User): Promise; updateUserInfo(user: User): Promise; getUserInfo(): Promise; getAccountInfo(): Promise; getKbGuid(): Promise; getServerUrl(): Promise; getObjectsVersion(objectType: string): Promise; setObjectsVersion(objectType: string, version: number): Promise; _getNotes(sqlWhere: string, values?: any[]): Promise; getNote(guid: string): Promise; getNotesGuidByTag(name: string): Promise; queryNotes(start: number, count: number, options?: QueryNotesOptions): Promise; getAllTitles(): Promise; getNotesByGuid(noteGuidArr: string[]): Promise; getModifiedNotes(): Promise; getNextNeedToBeDownloadedNote(includeTrash?: boolean): Promise; getDeletedNotes(): Promise; _changeTrashStatus(noteGuid: string, trash: number): Promise; moveNoteToTrash(noteGuid: string): Promise; putBackFromTrash(noteGuid: string): Promise; deletedFromTrash(noteGuid: string): Promise; permanentDeleteNotesByGuid(guids: string[]): Promise; setNoteVersion(noteGuid: string, version: number): Promise; setNoteLocalStatus(noteGuid: string, status: number): Promise; setNoteText(noteGuid: string, text: string): Promise; syncNote(note: Note): Promise; syncNoteData(noteGuid: string, html: string): Promise; downloadNoteMarkdown(noteGuid: string): Promise; getAllTagsName(): Promise; getAllTags(): Promise; getAllLinks(): Promise; getNoteTags(noteGuid: string): Promise; getNoteLinks(noteGuid: string): Promise; getNoteTagsFromMarkdown(markdown: string): string; updateNoteTags(noteGuid: string, markdown: string): Promise; updateNoteLinks(noteGuid: string, markdown: string): Promise; renameTag(from: string, to: string): Promise; setNoteMarkdown(noteGuid: string, markdown: string, options?: { noModifyTime?: boolean; noUpdateTags?: boolean; noUpdateLinks?: boolean; }): Promise; updateMarkdownLinksTask(guids: string[], oldTitle: string, newTitle: string): Promise; fixLinkedNotesMarkdown(guid: string, oldTitle: string, newTitle: string): Promise; getNoteMarkdown(noteGuid: string): Promise; createNote(orgNote?: CreateNoteOptions): Promise; getNotesGuidBySearchText(key: string): Promise<{ guids: any[]; rows: any[]; }>; setNoteStarred(noteGuid: string, starred: boolean): Promise; getBackwardLinkedNotes(title: string): Promise; hasNotesInTrash(): Promise; createGuideNote(): Promise; } export default WizDb;