// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // This file is automatically generated. DO NOT EDIT /** * DocumentService provides document management functionality * @module */ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore: Unused imports import {Call as $Call, Create as $Create} from "@wailsio/runtime"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore: Unused imports import * as application$0 from "../../../github.com/wailsapp/wails/v3/pkg/application/models.js"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore: Unused imports import * as models$0 from "../models/models.js"; /** * CreateDocument creates a new document and returns the created document with ID */ export function CreateDocument(title: string): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(3360680842, title) as any; let $typingPromise = $resultPromise.then(($result: any) => { return $$createType1($result); }) as any; $typingPromise.cancel = $resultPromise.cancel.bind($resultPromise); return $typingPromise; } /** * DeleteDocument marks a document as deleted (default document with ID=1 cannot be deleted) */ export function DeleteDocument(id: number): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(412287269, id) as any; return $resultPromise; } /** * GetDocumentByID gets a document by ID */ export function GetDocumentByID(id: number): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(3468193232, id) as any; let $typingPromise = $resultPromise.then(($result: any) => { return $$createType1($result); }) as any; $typingPromise.cancel = $resultPromise.cancel.bind($resultPromise); return $typingPromise; } /** * GetFirstDocumentID gets the first active document's ID for frontend initialization */ export function GetFirstDocumentID(): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(2970773833) as any; return $resultPromise; } /** * ListAllDocumentsMeta lists all active (non-deleted) document metadata */ export function ListAllDocumentsMeta(): Promise<(models$0.Document | null)[]> & { cancel(): void } { let $resultPromise = $Call.ByID(3073950297) as any; let $typingPromise = $resultPromise.then(($result: any) => { return $$createType2($result); }) as any; $typingPromise.cancel = $resultPromise.cancel.bind($resultPromise); return $typingPromise; } /** * ListDeletedDocumentsMeta lists all deleted document metadata */ export function ListDeletedDocumentsMeta(): Promise<(models$0.Document | null)[]> & { cancel(): void } { let $resultPromise = $Call.ByID(490143787) as any; let $typingPromise = $resultPromise.then(($result: any) => { return $$createType2($result); }) as any; $typingPromise.cancel = $resultPromise.cancel.bind($resultPromise); return $typingPromise; } /** * LockDocument 锁定文档,防止删除 */ export function LockDocument(id: number): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(1889494473, id) as any; return $resultPromise; } /** * RestoreDocument restores a deleted document */ export function RestoreDocument(id: number): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(784200778, id) as any; return $resultPromise; } /** * ServiceStartup initializes the service when the application starts */ export function ServiceStartup(options: application$0.ServiceOptions): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(1474135487, options) as any; return $resultPromise; } /** * UnlockDocument 解锁文档 */ export function UnlockDocument(id: number): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(222307930, id) as any; return $resultPromise; } /** * UpdateDocumentContent updates the content of a document */ export function UpdateDocumentContent(id: number, content: string): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(3251897116, id, content) as any; return $resultPromise; } /** * UpdateDocumentTitle updates the title of a document */ export function UpdateDocumentTitle(id: number, title: string): Promise & { cancel(): void } { let $resultPromise = $Call.ByID(2045530459, id, title) as any; return $resultPromise; } // Private type creation functions const $$createType0 = models$0.Document.createFrom; const $$createType1 = $Create.Nullable($$createType0); const $$createType2 = $Create.Array($$createType1);