feat: 🎸 add frontend api support

This commit is contained in:
Jin
2025-04-01 19:13:09 +02:00
parent 486696220f
commit 50009bfb6e
4 changed files with 33 additions and 0 deletions

View File

@@ -365,6 +365,14 @@ interface Api {
*/
getWeekFirstDayNote: typeof dateNotesService.getWeekFirstDayNote;
/**
* Returns week note for given date. If such a note doesn't exist, it is automatically created.
*
* @param date in YYYY-MM-DD format
* @param rootNote - specify calendar root note, normally leave empty to use the default calendar
*/
getWeekNote: typeof dateNotesService.getWeekNote;
/**
* Returns month-note. If it doesn't exist, it is automatically created.
*
@@ -372,6 +380,14 @@ interface Api {
*/
getMonthNote: typeof dateNotesService.getMonthNote;
/**
* Returns quarter note for given date. If such a note doesn't exist, it is automatically created.
*
* @param date in YYYY-MM format
* @param rootNote - specify calendar root note, normally leave empty to use the default calendar
*/
getQuarterNote: typeof dateNotesService.getQuarterNote;
/**
* Returns year-note. If it doesn't exist, it is automatically created.
*
@@ -652,7 +668,9 @@ function FrontendScriptApi(this: Api, startNote: FNote, currentNote: FNote, orig
this.getTodayNote = dateNotesService.getTodayNote;
this.getDayNote = dateNotesService.getDayNote;
this.getWeekFirstDayNote = dateNotesService.getWeekFirstDayNote;
this.getWeekNote = dateNotesService.getWeekNote;
this.getMonthNote = dateNotesService.getMonthNote;
this.getQuarterNote = dateNotesService.getQuarterNote;
this.getYearNote = dateNotesService.getYearNote;
this.setHoistedNoteId = (noteId) => {