Reference
TypeScript
Public Tarikh types and compile-time contracts for the core API and React entry point.
Start Here
Use this page when you want to know which types to import before wiring the API.
Public Types
import type {
BanglaCalendarDate,
BanglaCalendarDateLocalized,
BanglaCalendarFormatOptions,
BanglaCalendarOptions,
BanglaCalendarResult,
BanglaCalendarDayFormat,
BanglaCalendarDaySpokenVariant,
BanglaDayFormatOptions,
DateFormatOptions,
DateInput,
DateParseDetailedResult,
DateParseFailureReason,
DateParseOptions,
FormatMode,
FormatOptions,
HijriCalendarDate,
HijriCalendarDateLocalized,
HijriCalendarFormatOptions,
HijriCalendarOptions,
HijriCalendarResult,
HijriCalendarSystem,
HijriTimeZone,
HybridDateFormatOptions,
Language,
Locale,
MonthFormat,
RelativeTimeOptions,
RelativeTimeStyle,
StandardFormatPreset,
TimeFormat,
WeekdayFormat,
YearFormat
} from "@coreify/tarikh";
import type { TarikhProps } from "@coreify/tarikh/react";import type {
BanglaDateProps,
HijriDateProps,
RelativeTimeProps
} from "@coreify/tarikh/react";Key Contracts
| Type | Purpose |
|---|---|
FormatOptions | Main formatting contract for format() |
FormatMode | The supported standard, bangla, hijri, and hybrid modes |
StandardFormatPreset | Preset shortcuts like date, dateTime, and isoLike |
DateInput | Accepted input shape for core APIs |
RelativeTimeOptions | Options for fromNow(), including baseDate, style, and threshold |
DateParseOptions | Parser controls, including calendar: "bangla" and strict |
DateParseDetailedResult | Structured parse success and failure result |
HijriTimeZone | The supported Hijri timezone union |
HijriCalendarSystem | The supported Hijri calculation backends |
Locale-Aware Structured Results
import type {
BanglaCalendarResult,
HijriCalendarResult,
Locale,
} from "@coreify/tarikh";
type BanglaEnglish = BanglaCalendarResult<"en-BD">;
// -> numeric fields
type BanglaBangla = BanglaCalendarResult<"bn-BD">;
// -> localized string fields
type DynamicLocaleResult = HijriCalendarResult<Locale>;
// -> safe union of both shapesReact Types
| Type | Purpose |
|---|---|
TarikhProps | Props for the main React <Tarikh /> component |
BanglaDateProps | Props for Tarikh.Bangla |
HijriDateProps | Props for Tarikh.Hijri |
RelativeTimeProps | Props for Tarikh.Relative, including relativeStyle |
Compile-Time Rules
| Rule | Behavior |
|---|---|
pattern formatting | Disallows mode in TypeScript |
mode: "standard" | Uses DateFormatOptions |
mode: "bangla" | Uses Bangla calendar options |
mode: "hijri" | Uses Hijri calendar options |
mode: "hybrid" | Uses hybrid date formatting options |
locale: "bn-BD" | Narrows structured calendar results to localized strings |
locale: Locale | Produces a safe union result |
These types are designed so invalid
format()combinations fail at compile time before they reach runtime.