@mattilsynet/designsystem-svelte
Version:
Design system for Mattilsynet
28 lines (27 loc) • 1.46 kB
TypeScript
import type { ErrorDetail } from './types';
export declare function createInputAriaDescribedby(name?: string, error?: ErrorDetail, maxlength?: number): string | undefined;
export declare function toKebabCase(text: string): string;
export declare function displayDataTime(lang: string, isoDate?: string): string;
interface CompareDates {
lang: string;
publishFrom?: string;
publishedFromLabel: string;
professionallyUpdated?: string;
professionallyUpdatedLabel: string;
}
export declare function compareDates({ lang, publishFrom, publishedFromLabel, professionallyUpdated, professionallyUpdatedLabel }: CompareDates): {
date: string;
iso?: string;
label?: string;
} | null;
export declare function addDays(date: Date, days: number): Date;
export declare function longMonthDate(format: DateTimeFormat, date: Date): string;
export declare function getFileExtension(fileName?: string): string | null;
export declare function mapRelExternal(url?: string): 'external' | undefined;
export declare function interpolate(string: string, replacers: string[]): string;
export declare function prefersReducedMotion(): boolean;
export declare function isMobileOrTablet(): boolean;
export declare function detectMobileOrTablet(agent: string): boolean;
export declare function forceArray<A>(data: A | Array<A> | undefined): Array<A>;
export declare function forceArray<A>(data: A | ReadonlyArray<A> | undefined): ReadonlyArray<A>;
export {};