Skip to content

Commit

Permalink
docs: use @ignore tag
Browse files Browse the repository at this point in the history
Use `@ignore` tag to remove deprecated things from API reference
  • Loading branch information
gpbl committed Dec 12, 2024
1 parent 4c2a8ff commit 828b8d5
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 41 deletions.
15 changes: 12 additions & 3 deletions src/classes/DateLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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;
5 changes: 4 additions & 1 deletion src/labels/labelDayButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ export function labelDayButton(
return label;
}

/** @deprecated Use `labelDayButton` instead. */
/**
* @ignore
* @deprecated Use `labelDayButton` instead.
*/
export const labelDay = labelDayButton;
6 changes: 3 additions & 3 deletions src/labels/labelGrid.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -17,7 +17,7 @@ export function labelGrid(
}

/**
* @ignore
* @deprecated Use {@link labelGrid} instead.
* @protected
*/
export const labelCaption = labelGrid;
62 changes: 31 additions & 31 deletions src/types/deprecated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<unknown>` instead
* @protected
*/
export type DayPickerDefaultProps = NonNullable<unknown>;

/**
* @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
Expand All @@ -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<React.MouseEvent>;

/**
* @ignore
* @deprecated This type will be removed. Use `DayEventHandler<React.FocusEvent
* | React.KeyboardEvent>` instead.
* @protected
*/
export type DayFocusEventHandler = DayEventHandler<
React.FocusEvent | React.KeyboardEvent
>;

/**
* @ignore
* @deprecated This type will be removed. Use
* `DayEventHandler<React.KeyboardEvent>` instead.
* @protected
*/
export type DayKeyboardEventHandler = DayEventHandler<React.KeyboardEvent>;

/**
* @ignore
* @deprecated This type will be removed. Use
* `DayEventHandler<React.MouseEvent>` instead.
* @protected
*/
export type DayMouseEventHandler = DayEventHandler<React.MouseEvent>;

/**
* @ignore
* @deprecated This type will be removed. Use
* `DayEventHandler<React.PointerEvent>` instead.
* @protected
*/
export type DayPointerEventHandler = DayEventHandler<React.PointerEvent>;

/**
* @ignore
* @deprecated This type will be removed. Use
* `DayEventHandler<React.TouchEvent>` instead.
* @protected
*/
export type DayTouchEventHandler = DayEventHandler<React.TouchEvent>;
15 changes: 12 additions & 3 deletions src/types/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
};

Expand All @@ -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;
Expand Down

0 comments on commit 828b8d5

Please sign in to comment.