cumulocity-cypress
Version:
Cypress commands for Cumulocity IoT
60 lines (59 loc) • 2.21 kB
TypeScript
import localeDe from "@angular/common/locales/de";
import localeEn from "@angular/common/locales/en-GB";
import { Locale } from "date-fns";
export declare enum FormatWidth {
Short = 0,
Medium = 1,
Long = 2,
Full = 3
}
export { localeDe, localeEn };
export declare enum NgLocaleDataIndex {
LocaleId = 0,
DayPeriodsFormat = 1,
DayPeriodsStandalone = 2,
DaysFormat = 3,
DaysStandalone = 4,
MonthsFormat = 5,
MonthsStandalone = 6,
Eras = 7,
FirstDayOfWeek = 8,
WeekendRange = 9,
DateFormat = 10,
TimeFormat = 11,
DateTimeFormat = 12,
NumberSymbols = 13,
NumberFormats = 14,
CurrencyCode = 15,
CurrencySymbol = 16,
CurrencyName = 17,
Currencies = 18,
Directionality = 19,
PluralCase = 20,
ExtraData = 21,
DfnsLocale = 22
}
export declare function getNgLocaleId(locale: string): string;
/**
* Registers a locale with the given ID and data. Registered locale can be used
* with `cy.setLanguage` to set the locale for date formatting and other
* locale-specific operations in `cy.toDate`, `cy.toISODate`, etc.
* @param c8yLocaleId The Cumulocity locale ID (e.g., "en", "de").
* @param angularLocale The Angular locale data.
* @param dfnsLocale The date-fns locale data (optional).
* @param extraData Additional data to be stored in the locale (optional).
*/
export declare function registerLocale(c8yLocaleId: string, angularLocale: unknown[], dfnsLocale?: Locale | null, extraData?: unknown): void;
/**
* Registers default locales `de` and `en` with their respective
* Angular and date-fns locales for use in tests.
*/
export declare function registerDefaultLocales(): void;
export declare function getNgLocale(localeId: string): any;
export declare function localizedTimeFormat(localeId?: string, formatWidth?: FormatWidth | number): string;
export declare function localizedDateFormat(localeId?: string, formatWidth?: FormatWidth | number): string;
export declare function localizedDateTimeFormat(localeId?: string, formatWidth?: FormatWidth | number): string;
export declare function buildMatchFn(args: any): (string: string, options?: any) => {
value: any;
rest: string;
} | null;