import type { CSSProperties, HTMLAttributes } from "react";
import type { SxValue } from "../CSSFab";

export type DateType =
  | "default"
  | "line"
  | "full"
  | "full-line"
  | "year-week"
  | "year-week-line"
  | "week-time"
  | "no-s"
  | "no-s-line";

export type DateI18nKey = DateType | (string & {});

export type DateLocaleText = Partial<{
  weekdayPrefix: string;
  weekdayShortPrefix: string;
}>;

export interface DateProps
  extends Omit<HTMLAttributes<HTMLDivElement>, "style" | "className"> {
  /** 显示格式类型 */
  type?: DateType;
  /** 中文星期简写：true 显示"周X"，false 显示"星期X" */
  single?: boolean;
  /** Style extension via CSSFab sx */
  sx?: SxValue;
  style?: CSSProperties;
  className?: string;
  /** i18n key，可指定 type 作为快捷格式 */
  i18nKey?: DateI18nKey;
  /** 覆盖 locale 文案 */
  localeText?: DateLocaleText;
}

declare function DateDisplay(props: DateProps): JSX.Element;

export { DateDisplay };
export default DateDisplay;
