import { App, TFile, moment } from "obsidian"; import moment$1 from "moment"; //#region src/moment-types.d.ts type Moment = moment$1.Moment; //#endregion //#region src/constants.d.ts declare const DEFAULT_DAILY_NOTE_FORMAT = "YYYY-MM-DD"; declare const DEFAULT_WEEKLY_NOTE_FORMAT = "gggg-[W]ww"; declare const DEFAULT_MONTHLY_NOTE_FORMAT = "YYYY-MM"; declare const DEFAULT_QUARTERLY_NOTE_FORMAT = "YYYY-[Q]Q"; declare const DEFAULT_YEARLY_NOTE_FORMAT = "YYYY"; //#endregion //#region src/daily.d.ts declare class DailyNotesFolderMissingError extends Error {} /** * This function mimics the behavior of the daily-notes plugin * so it will replace {{date}}, {{title}}, and {{time}} with the * formatted timestamp. * * Note: it has an added bonus that it's not 'today' specific. */ declare function createDailyNote(date: Moment): Promise; declare function getDailyNote(date: Moment, dailyNotes: Record): TFile; declare function getAllDailyNotes(): Record; //#endregion //#region src/weekly.d.ts declare class WeeklyNotesFolderMissingError extends Error {} declare function createWeeklyNote(date: Moment): Promise; declare function getWeeklyNote(date: Moment, weeklyNotes: Record): TFile; declare function getAllWeeklyNotes(): Record; //#endregion //#region src/monthly.d.ts declare class MonthlyNotesFolderMissingError extends Error {} /** * This function mimics the behavior of the daily-notes plugin * so it will replace {{date}}, {{title}}, and {{time}} with the * formatted timestamp. * * Note: it has an added bonus that it's not 'today' specific. */ declare function createMonthlyNote(date: Moment): Promise; declare function getMonthlyNote(date: Moment, monthlyNotes: Record): TFile; declare function getAllMonthlyNotes(): Record; //#endregion //#region src/quarterly.d.ts declare class QuarterlyNotesFolderMissingError extends Error {} /** * This function mimics the behavior of the daily-notes plugin * so it will replace {{date}}, {{title}}, and {{time}} with the * formatted timestamp. * * Note: it has an added bonus that it's not 'today' specific. */ declare function createQuarterlyNote(date: Moment): Promise; declare function getQuarterlyNote(date: Moment, quarterly: Record): TFile; declare function getAllQuarterlyNotes(): Record; //#endregion //#region src/yearly.d.ts declare class YearlyNotesFolderMissingError extends Error {} /** * This function mimics the behavior of the daily-notes plugin * so it will replace {{date}}, {{title}}, and {{time}} with the * formatted timestamp. * * Note: it has an added bonus that it's not 'today' specific. */ declare function createYearlyNote(date: Moment): Promise; declare function getYearlyNote(date: Moment, yearlyNotes: Record): TFile; declare function getAllYearlyNotes(): Record; //#endregion //#region src/types.d.ts type IGranularity = "day" | "week" | "month" | "quarter" | "year"; /** * The shape returned by `get*NoteSettings()`. Fields are typed as * optional because `folder` and `template` may be empty strings rather * than meaningful values — and historically callers handle both cases. * In practice the resolver always populates each field (defaults fill * in for missing plugin settings). */ interface IPeriodicNoteSettings { folder?: string; format?: string; template?: string; } //#endregion //#region src/settings.d.ts /** * Read the user settings for the `daily-notes` plugin * to keep behavior of creating a new note in-sync. */ declare function getDailyNoteSettings(): IPeriodicNoteSettings; /** * Read the user settings for the `weekly-notes` plugin * to keep behavior of creating a new note in-sync. */ declare function getWeeklyNoteSettings(): IPeriodicNoteSettings; /** * Read the user settings for the `periodic-notes` plugin * to keep behavior of creating a new note in-sync. */ declare function getMonthlyNoteSettings(): IPeriodicNoteSettings; /** * Read the user settings for the `periodic-notes` plugin * to keep behavior of creating a new note in-sync. */ declare function getQuarterlyNoteSettings(): IPeriodicNoteSettings; /** * Read the user settings for the `periodic-notes` plugin * to keep behavior of creating a new note in-sync. */ declare function getYearlyNoteSettings(): IPeriodicNoteSettings; //#endregion //#region src/parse.d.ts /** * dateUID is a way of weekly identifying daily/weekly/monthly notes. * They are prefixed with the granularity to avoid ambiguity. */ declare function getDateUID(date: Moment, granularity?: IGranularity): string; declare function getDateFromFile(file: TFile, granularity: IGranularity): Moment | null; declare function getDateFromPath(path: string, granularity: IGranularity): Moment | null; //#endregion //#region src/vault.d.ts interface IFold { from: number; to: number; } interface IFoldInfo { folds: IFold[]; } declare function getTemplateInfo(template: string): Promise<[string, IFoldInfo | null]>; //#endregion //#region src/index.d.ts declare global { interface Window { app: App; moment: typeof moment; } } declare function appHasDailyNotesPluginLoaded(): boolean; /** * XXX: "Weekly Notes" live in either the Calendar plugin or the periodic-notes plugin. * Check both until the weekly notes feature is removed from the Calendar plugin. */ declare function appHasWeeklyNotesPluginLoaded(): boolean; declare function appHasMonthlyNotesPluginLoaded(): boolean; declare function appHasQuarterlyNotesPluginLoaded(): boolean; declare function appHasYearlyNotesPluginLoaded(): boolean; declare function getPeriodicNoteSettings(granularity: IGranularity): IPeriodicNoteSettings; declare function createPeriodicNote(granularity: IGranularity, date: Moment): Promise; //#endregion export { DEFAULT_DAILY_NOTE_FORMAT, DEFAULT_MONTHLY_NOTE_FORMAT, DEFAULT_QUARTERLY_NOTE_FORMAT, DEFAULT_WEEKLY_NOTE_FORMAT, DEFAULT_YEARLY_NOTE_FORMAT, DailyNotesFolderMissingError, type IGranularity, type IPeriodicNoteSettings, MonthlyNotesFolderMissingError, QuarterlyNotesFolderMissingError, WeeklyNotesFolderMissingError, YearlyNotesFolderMissingError, appHasDailyNotesPluginLoaded, appHasMonthlyNotesPluginLoaded, appHasQuarterlyNotesPluginLoaded, appHasWeeklyNotesPluginLoaded, appHasYearlyNotesPluginLoaded, createDailyNote, createMonthlyNote, createPeriodicNote, createQuarterlyNote, createWeeklyNote, createYearlyNote, getAllDailyNotes, getAllMonthlyNotes, getAllQuarterlyNotes, getAllWeeklyNotes, getAllYearlyNotes, getDailyNote, getDailyNoteSettings, getDateFromFile, getDateFromPath, getDateUID, getMonthlyNote, getMonthlyNoteSettings, getPeriodicNoteSettings, getQuarterlyNote, getQuarterlyNoteSettings, getTemplateInfo, getWeeklyNote, getWeeklyNoteSettings, getYearlyNote, getYearlyNoteSettings };