From 828b8d59d47914175e70eecbbed01c0cc73431ad Mon Sep 17 00:00:00 2001 From: gpbl Date: Thu, 12 Dec 2024 18:17:58 -0500 Subject: [PATCH] docs: use `@ignore` tag Use `@ignore` tag to remove deprecated things from API reference --- src/classes/DateLib.ts | 15 +++++++-- src/labels/labelDayButton.ts | 5 ++- src/labels/labelGrid.ts | 6 ++-- src/types/deprecated.ts | 62 ++++++++++++++++++------------------ src/types/shared.ts | 15 +++++++-- 5 files changed, 62 insertions(+), 41 deletions(-) diff --git a/src/classes/DateLib.ts b/src/classes/DateLib.ts index b5ffe9f33..c16ec4df3 100644 --- a/src/classes/DateLib.ts +++ b/src/classes/DateLib.ts @@ -42,9 +42,15 @@ import type { PropsBase } from "../types/props.js"; export type { Locale } from "date-fns/locale"; export type { Month as DateFnsMonth } from "date-fns"; -/** @deprecated Use {@link DateLibOptions} instead. */ +/** + * @ignore + * @deprecated Use {@link DateLibOptions} instead. + */ export type FormatOptions = DateLibOptions; -/** @deprecated Use {@link DateLibOptions} instead. */ +/** + * @ignore + * @deprecated Use {@link DateLibOptions} instead. + */ export type LabelOptions = DateLibOptions; /** @@ -502,5 +508,8 @@ export { enUS as defaultLocale } from "date-fns/locale/en-US"; */ export const defaultDateLib = new DateLib(); -/** @deprecated Use `defaultDateLib`. */ +/** + * @ignore + * @deprecated Use `defaultDateLib`. + */ export const dateLib = defaultDateLib; diff --git a/src/labels/labelDayButton.ts b/src/labels/labelDayButton.ts index ac9e4a231..20c1ff5b0 100644 --- a/src/labels/labelDayButton.ts +++ b/src/labels/labelDayButton.ts @@ -24,5 +24,8 @@ export function labelDayButton( return label; } -/** @deprecated Use `labelDayButton` instead. */ +/** + * @ignore + * @deprecated Use `labelDayButton` instead. + */ export const labelDay = labelDayButton; diff --git a/src/labels/labelGrid.ts b/src/labels/labelGrid.ts index ba36019c2..0f03bacd1 100644 --- a/src/labels/labelGrid.ts +++ b/src/labels/labelGrid.ts @@ -1,8 +1,8 @@ import { DateLib, type DateLibOptions } from "../classes/DateLib.js"; /** - * Return an ARIA label for the month grid, that will be announced when entering - * the grid. + * The ARIA label for the month grid, that will be announced when entering the + * grid. * * @defaultValue `LLLL y` (e.g. "November 2022") * @group Labels @@ -17,7 +17,7 @@ export function labelGrid( } /** + * @ignore * @deprecated Use {@link labelGrid} instead. - * @protected */ export const labelCaption = labelGrid; diff --git a/src/types/deprecated.ts b/src/types/deprecated.ts index 6239b3b58..b4a5e81bc 100644 --- a/src/types/deprecated.ts +++ b/src/types/deprecated.ts @@ -17,93 +17,93 @@ import type { PropsMulti, PropsRange, PropsSingle } from "./props.js"; import type { Mode, DayEventHandler } from "./shared.js"; /** + * @ignore * @deprecated This type will be removed. - * @protected */ export type RootProvider = any; /** + * @ignore * @deprecated This type will be removed. - * @protected */ export type RootProviderProps = any; /** + * @ignore * @deprecated This component has been renamed. Use `MonthCaption` instead. - * @protected * @group Components * @see https://daypicker.dev/guides/custom-components */ export const Caption = MonthCaption; /** + * @ignore * @deprecated This type has been renamed. Use `MonthCaptionProps` instead. - * @protected */ export type CaptionProps = MonthCaptionProps; /** + * @ignore * @deprecated This component has been removed. - * @protected * @group Components * @see https://daypicker.dev/guides/custom-components */ export type HeadRow = any; /** + * @ignore * @deprecated This component has been renamed. Use `Week` instead. - * @protected * @group Components * @see https://daypicker.dev/guides/custom-components */ export const Row = Week; /** + * @ignore * @deprecated This type has been removed. Use `WeekProps` instead. - * @protected */ export type RowProps = WeekProps; /** + * @ignore * @deprecated This type has been renamed. Use `PropsSingle` instead. - * @protected */ export type DayPickerSingleProps = PropsSingle; /** + * @ignore * @deprecated This type has been renamed. Use `PropsMulti` instead. - * @protected */ export type DayPickerMultipleProps = PropsMulti; /** + * @ignore * @deprecated This type has been renamed. Use `PropsRange` instead. - * @protected */ export type DayPickerRangeProps = PropsRange; /** + * @ignore * @deprecated This type will be removed. Use `NonNullable` instead - * @protected */ export type DayPickerDefaultProps = NonNullable; /** + * @ignore * @deprecated This type has been renamed. Use `Mode` instead. - * @protected */ export type DaySelectionMode = Mode; /** + * @ignore * @deprecated This type will be removed. Use `string` instead; - * @protected */ export type Modifier = string; /** + * @ignore * @deprecated This type will be removed. Use {@link DayFlag} or * {@link SelectionState} instead. - * @protected */ export type InternalModifier = | DayFlag.disabled @@ -115,114 +115,114 @@ export type InternalModifier = | SelectionState.selected; /** + * @ignore * @deprecated This type will be removed. Use `SelectHandler<"single">` instead. - * @protected */ export type SelectSingleEventHandler = PropsSingle["onSelect"]; /** + * @ignore * @deprecated This type will be removed. Use `SelectHandler<"multiple">` * instead. - * @protected */ export type SelectMultipleEventHandler = PropsMulti["onSelect"]; /** + * @ignore * @deprecated This type will be removed. Use `SelectHandler<"range">` instead. - * @protected */ export type SelectRangeEventHandler = PropsRange["onSelect"]; /** + * @ignore * @deprecated This type is not used anymore. - * @protected */ export type DayPickerProviderProps = any; /** + * @ignore * @deprecated This type has been removed to `useDayPicker`. - * @protected * @group Hooks */ export const useNavigation = useDayPicker; /** + * @ignore * @deprecated This hook has been removed. Use a custom `Day` component instead. - * @protected * @group Hooks * @see https://daypicker.dev/guides/custom-components */ export type useDayRender = any; /** + * @ignore * @deprecated This type is not used anymore. - * @protected */ export type ContextProvidersProps = any; /** + * @ignore * @deprecated Use `typeof labelDayButton` instead. - * @protected */ export type DayLabel = typeof labelDayButton; /** + * @ignore * @deprecated Use `typeof labelNext` or `typeof labelPrevious` instead. - * @protected */ export type NavButtonLabel = typeof labelNext; /** + * @ignore * @deprecated Use `typeof labelWeekday` instead. - * @protected */ export type WeekdayLabel = typeof labelWeekday; /** + * @ignore * @deprecated Use `typeof labelWeekNumber` instead. - * @protected */ export type WeekNumberLabel = typeof labelWeekNumber; /** + * @ignore * @deprecated Use {@link DayMouseEventHandler} instead. - * @protected */ export type DayClickEventHandler = DayEventHandler; /** + * @ignore * @deprecated This type will be removed. Use `DayEventHandler` instead. - * @protected */ export type DayFocusEventHandler = DayEventHandler< React.FocusEvent | React.KeyboardEvent >; /** + * @ignore * @deprecated This type will be removed. Use * `DayEventHandler` instead. - * @protected */ export type DayKeyboardEventHandler = DayEventHandler; /** + * @ignore * @deprecated This type will be removed. Use * `DayEventHandler` instead. - * @protected */ export type DayMouseEventHandler = DayEventHandler; /** + * @ignore * @deprecated This type will be removed. Use * `DayEventHandler` instead. - * @protected */ export type DayPointerEventHandler = DayEventHandler; /** + * @ignore * @deprecated This type will be removed. Use * `DayEventHandler` instead. - * @protected */ export type DayTouchEventHandler = DayEventHandler; diff --git a/src/types/shared.ts b/src/types/shared.ts index bb7492a8b..935d4e0c8 100644 --- a/src/types/shared.ts +++ b/src/types/shared.ts @@ -111,7 +111,10 @@ export type Formatters = { formatDay: typeof formatDay; /** Format the label in the month dropdown. */ formatMonthDropdown: typeof formatMonthDropdown; - /** @deprecated Use {@link Formatters.formatCaption} instead. */ + /** + * @ignore + * @deprecated Use {@link Formatters.formatCaption} instead. + */ formatMonthCaption: typeof formatMonthCaption; /** Format the week number. */ formatWeekNumber: typeof formatWeekNumber; @@ -121,7 +124,10 @@ export type Formatters = { formatWeekdayName: typeof formatWeekdayName; /** Format the label in the year dropdown. */ formatYearDropdown: typeof formatYearDropdown; - /** @deprecated Use {@link Formatters.formatYearDropdown} instead. */ + /** + * @ignore + * @deprecated Use {@link Formatters.formatYearDropdown} instead. + */ formatYearCaption: typeof formatYearCaption; }; @@ -143,7 +149,10 @@ export type Labels = { labelPrevious: typeof labelPrevious; /** The label for the day button. */ labelDayButton: typeof labelDayButton; - /** @deprecated Use {@link labelDayButton} instead. */ + /** + * @ignore + * @deprecated Use {@link labelDayButton} instead. + */ labelDay: typeof labelDayButton; /** The label for the weekday. */ labelWeekday: typeof labelWeekday;