diff --git a/public/scripts/AppCollapsible.js b/public/scripts/AppCollapsible.js index 02003ee..67e963f 100644 --- a/public/scripts/AppCollapsible.js +++ b/public/scripts/AppCollapsible.js @@ -1,3 +1,6 @@ +/** + * @param {HTMLElement} el + */ export function AppCollapsible(el) { const state = { show: true, diff --git a/public/scripts/AppDatePicker.js b/public/scripts/AppDatePicker.js index 6f8233a..5dad4af 100644 --- a/public/scripts/AppDatePicker.js +++ b/public/scripts/AppDatePicker.js @@ -17,6 +17,9 @@ const datesRow = ` `; +/** + * @param {HTMLElement} el + */ export function AppDatePicker(el) { const now = new Date(); const state = { diff --git a/public/scripts/AppDraggable.js b/public/scripts/AppDraggable.js index 885db05..055cbe3 100644 --- a/public/scripts/AppDraggable.js +++ b/public/scripts/AppDraggable.js @@ -1,3 +1,11 @@ +/** + * @param {HTMLElement} el + * @param {{ + * dropSelector: string; + * dragThreshold?: number; + * dropRange?: number; + * }} options + */ export function AppDraggable(el, options) { const dragThreshold = options.dragThreshold ?? 5; const dropRange = options.dropRange ?? 50; diff --git a/public/scripts/AppFlip.js b/public/scripts/AppFlip.js index 6800abd..5d8f013 100644 --- a/public/scripts/AppFlip.js +++ b/public/scripts/AppFlip.js @@ -1,3 +1,11 @@ +/** + * @param {HTMLElement} el + * @param {{ + * initialDelay?: number; + * removeTimeout: number; + * selector: string; + * }} options + */ export function AppFlip(el, options) { let enabled = options.initialDelay === 0; let first; diff --git a/public/scripts/AppFps.js b/public/scripts/AppFps.js index fe9a461..7a77f40 100644 --- a/public/scripts/AppFps.js +++ b/public/scripts/AppFps.js @@ -1,3 +1,6 @@ +/** + * @param {HTMLElement} el + */ export function AppFps(el) { const sampleSize = 20; let times = []; diff --git a/public/scripts/AppIcon.js b/public/scripts/AppIcon.js index 1233bc9..484211d 100644 --- a/public/scripts/AppIcon.js +++ b/public/scripts/AppIcon.js @@ -2,6 +2,9 @@ export const BASE_URL = 'https://unpkg.com/@primer/octicons@19.8.0/build/svg/'; const cache = {}; +/** + * @param {HTMLElement} el + */ export function AppIcon(el) { if (el.children.length > 0) return; diff --git a/public/scripts/AppSortable.js b/public/scripts/AppSortable.js index fa16379..d86da53 100644 --- a/public/scripts/AppSortable.js +++ b/public/scripts/AppSortable.js @@ -1,3 +1,9 @@ +/** + * @param {HTMLElement} el + * @param {{ + * direction?: 'horizontal' | 'vertical'; + * }} options + */ export function AppSortable(el, options) { let placeholder; let placeholderSource; diff --git a/public/scripts/TodoApp.js b/public/scripts/TodoApp.js index 1f0a937..b4b971e 100644 --- a/public/scripts/TodoApp.js +++ b/public/scripts/TodoApp.js @@ -7,6 +7,9 @@ import { TodoFrameDays } from './TodoFrameDays.js'; import { TodoStore } from './TodoStore.js'; import { formatDateId } from './util.js'; +/** + * @param {HTMLElement} el + */ export function TodoApp(el) { const state = { items: [], diff --git a/public/scripts/TodoCustomList.js b/public/scripts/TodoCustomList.js index f3f9452..71458eb 100644 --- a/public/scripts/TodoCustomList.js +++ b/public/scripts/TodoCustomList.js @@ -2,6 +2,9 @@ import { AppDraggable } from './AppDraggable.js'; import { AppIcon } from './AppIcon.js'; import { TodoList } from './TodoList.js'; +/** + * @param {HTMLElement} el + */ export function TodoCustomList(el) { const state = { list: null, diff --git a/public/scripts/TodoDay.js b/public/scripts/TodoDay.js index 263aaee..c4d45ac 100644 --- a/public/scripts/TodoDay.js +++ b/public/scripts/TodoDay.js @@ -1,6 +1,9 @@ import { TodoList } from './TodoList.js'; import { formatDate, formatDayOfWeek } from './util.js'; +/** + * @param {HTMLElement} el + */ export function TodoDay(el) { const state = { dateId: el.dataset.key, diff --git a/public/scripts/TodoFrameCustom.js b/public/scripts/TodoFrameCustom.js index efee7e1..bc8d5aa 100644 --- a/public/scripts/TodoFrameCustom.js +++ b/public/scripts/TodoFrameCustom.js @@ -2,6 +2,9 @@ import { AppIcon } from './AppIcon.js'; import { AppSortable } from './AppSortable.js'; import { TodoCustomList } from './TodoCustomList.js'; +/** + * @param {HTMLElement} el + */ export function TodoFrameCustom(el) { const state = { customLists: [], diff --git a/public/scripts/TodoFrameDays.js b/public/scripts/TodoFrameDays.js index 64bcf9c..62a4b3c 100644 --- a/public/scripts/TodoFrameDays.js +++ b/public/scripts/TodoFrameDays.js @@ -3,6 +3,9 @@ import { AppIcon } from './AppIcon.js'; import { TodoDay } from './TodoDay.js'; import { formatDateId } from './util.js'; +/** + * @param {HTMLElement} el + */ export function TodoFrameDays(el) { const RANGE = 14; const state = { diff --git a/public/scripts/TodoItem.js b/public/scripts/TodoItem.js index cb3dc52..b92ca20 100644 --- a/public/scripts/TodoItem.js +++ b/public/scripts/TodoItem.js @@ -1,6 +1,9 @@ import { AppDraggable } from './AppDraggable.js'; import { AppIcon } from './AppIcon.js'; +/** + * @param {HTMLElement} el + */ export function TodoItem(el) { const state = { item: null, diff --git a/public/scripts/TodoItemInput.js b/public/scripts/TodoItemInput.js index 9a9d338..96b87ca 100644 --- a/public/scripts/TodoItemInput.js +++ b/public/scripts/TodoItemInput.js @@ -1,5 +1,8 @@ import { AppIcon } from './AppIcon.js'; +/** + * @param {HTMLElement} el + */ export function TodoItemInput(el) { let saveOnBlur = true; diff --git a/public/scripts/TodoList.js b/public/scripts/TodoList.js index c476356..489ce8f 100644 --- a/public/scripts/TodoList.js +++ b/public/scripts/TodoList.js @@ -2,6 +2,9 @@ import { AppSortable } from './AppSortable.js'; import { TodoItem } from './TodoItem.js'; import { TodoItemInput } from './TodoItemInput.js'; +/** + * @param {HTMLElement} el + */ export function TodoList(el) { const state = { items: [], diff --git a/public/scripts/TodoStore.js b/public/scripts/TodoStore.js index b77733b..c8e07dd 100644 --- a/public/scripts/TodoStore.js +++ b/public/scripts/TodoStore.js @@ -1,5 +1,8 @@ import { formatDateId, uuid } from './util.js'; +/** + * @param {HTMLElement} el + */ export function TodoStore(el) { const state = { items: [], diff --git a/public/scripts/util.js b/public/scripts/util.js index c9bb47b..0388ca1 100644 --- a/public/scripts/util.js +++ b/public/scripts/util.js @@ -7,6 +7,10 @@ export function uuid() { }); } +/** + * @param {Date} date + * @returns {string} + */ export function formatDateId(date) { const y = date.getFullYear(); const m = date.getMonth() + 1; @@ -18,6 +22,10 @@ export function formatDateId(date) { return `${ys}-${ms}-${ds}`; } +/** + * @param {Date} date + * @returns {string} + */ export function formatDate(date) { const m = formatMonth(date); const d = formatDayOfMonth(date); @@ -26,6 +34,10 @@ export function formatDate(date) { return `${m} ${d} ${y}`; } +/** + * @param {Date} date + * @returns {string} + */ export function formatDayOfMonth(date) { const d = date.getDate(); const t = d % 10; @@ -51,6 +63,10 @@ export const DAY_NAMES = [ 'Saturday', ]; +/** + * @param {Date} date + * @returns {string} + */ export function formatDayOfWeek(date) { return DAY_NAMES[date.getDay()]; } @@ -70,6 +86,10 @@ export const MONTH_NAMES = [ 'December', ]; +/** + * @param {Date} date + * @returns {string} + */ export function formatMonth(date) { return MONTH_NAMES[date.getMonth()]; }