@asadi/angular-date-components
Version:
`Angular Date Components` is a comprehensive angular library of date-related components designed to meet the needs of applications that require localization based on various calendar systems. While the package currently includes two powerful components (S
80 lines (78 loc) • 2.67 kB
TypeScript
import { InjectionToken } from "@angular/core";
import { ADCIDateAdapter, ADCIOptions, ADCIDateFormatter, ADCILabels } from "./interface";
/**
* Injection token for providing date adapter for `Angular Date Components`.
* Date Adapter is a class that implements `ADCIDateAdapter` interface.
* implement methods of this interface to customize `Angular Date Components` for your calendar type.
*/
export declare const ADC_DATE_ADAPTER: InjectionToken<ADCIDateAdapter>;
/**
* Injection token for providing some global options for `Angular Date Components`.
* Use it to do some customization for `Angular Date Components` components.
* It needs a class that implements `ADCIOptions` interface.
*/
export declare const ADC_OPTIONS: InjectionToken<ADCIOptions>;
/**
* Injection token for providing date formats for Angular Date Components.
* Use this token to provide a class that implements `ADCIDateFormatter` interface.
*
* @example
* // Example usage
*
* ```typescript
* export class DateFormatterPersian implements ADCIDateFormatter
{
get DateSplitter(): ADCDateSplitter {
return ADCDateSplitter.slash
}
}
* @NgModule({
* providers: [
* { provide: ADC_DATE_FORMATTER, useClass: new DateFormatterPersian()}
* ]
* })
* export class AppModule {}
* ```
*/
export declare const ADC_DATE_FORMATTER: InjectionToken<ADCIDateFormatter>;
/**
* Injection token for providing custom labels used across Angular Date Components.
* Use this token to override the default labels by supplying an object that implements the `ADCILabels` interface.
* `monthsOfYear` record keys must be exact values of months provided in `ADCIDateAapter` interface
*
* @example
* // Example usage in an Angular module:
*
* ```typescript
* const customLabels: ADCILabels = {
* week: 'هفته',
* year: 'سال',
* day: 'روز',
* today: 'امروز',
* month: 'ماه',
* daysOfWeek: ['یکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'],
* monthsOfYear: {
* 'January': 'ژانویه',
* 'February': 'فوریه',
* 'March': 'مارس',
* 'April': 'اوریل',
* 'May': 'مه',
* 'June': 'ژوئن',
* 'July': 'ژوئیه',
* 'August': 'اوت',
* 'September': 'سپتامبر',
* 'October': 'اکتبر',
* 'November': 'نوامبر',
* 'December': 'دسامبر'
* }
* };
*
* @NgModule({
* providers: [
* { provide: ADC_LABELS, useValue: customLabels }
* ]
* })
* export class AppModule {}
* ```
*/
export declare const ADC_LABELS: InjectionToken<ADCILabels>;