Files
Momento/memento-note/lib/note-change-sync.ts
Antigravity e2672cd2c2
Some checks failed
CI / Lint, Test & Build (push) Failing after 1m19s
CI / Deploy production (on server) (push) Has been skipped
feat(notes): liens internes, onglet Réseau, living blocks et consentement IA
Rend les liens entre notes visibles et persistants (sync NoteLink au save, auto-save, graphe réseau rafraîchi), ajoute living blocks, Memory Echo, recherche globale, consentement IA explicite et consolide les prototypes design en architectural-grid.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-24 14:27:29 +00:00

24 lines
935 B
TypeScript

import type { Note } from '@/lib/types'
export const NOTE_CHANGE_EVENT = 'memento-note-changed'
export const NOTE_REQUEST_SAVE_EVENT = 'memento-request-note-save'
export type NoteChangeEvent =
| { type: 'updated'; note: Note }
| { type: 'deleted'; noteId: string; notebookId?: string | null }
| { type: 'created'; note: Note }
export type NoteCollectionActions = {
onTogglePin?: (note: Note) => void | Promise<void>
onDeleteNote?: (note: Note) => void | Promise<void>
onArchiveNote?: (note: Note) => void | Promise<void>
onMoveToNotebook?: (note: Note, notebookId: string | null) => void | Promise<void>
onNotePatch?: (noteId: string, patch: Partial<Note>) => void
onNoteIllustrationGenerated?: (noteId: string) => void | Promise<void>
}
export function emitNoteChange(detail: NoteChangeEvent) {
if (typeof window === 'undefined') return
window.dispatchEvent(new CustomEvent(NOTE_CHANGE_EVENT, { detail }))
}