feat(w5): ship v2.0.0 platform sync, undo persistence, and updates
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import type { UndoOperation, UndoStackEntry } from '../../shared/undo'
|
||||
import { UndoStackRepository } from '../db/repositories/undo.repo'
|
||||
import type { SqliteDb } from '../db/types'
|
||||
|
||||
export class UndoStackService {
|
||||
constructor(private db: SqliteDb) {}
|
||||
|
||||
push(chapterId: string, operation: UndoOperation): UndoStackEntry {
|
||||
return new UndoStackRepository(this.db).push(chapterId, operation)
|
||||
}
|
||||
|
||||
list(chapterId: string): UndoStackEntry[] {
|
||||
return new UndoStackRepository(this.db).list(chapterId)
|
||||
}
|
||||
|
||||
apply(entryId: number): UndoOperation | null {
|
||||
const entry = new UndoStackRepository(this.db).get(entryId)
|
||||
return entry?.operation ?? null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user