import * as i0 from '@angular/core'; import { PipeTransform } from '@angular/core'; import { WrDateFormat } from 'ngwr/date-adapter'; import { SafeHtml } from '@angular/platform-browser'; /** * Humanise a byte count using binary (1024-based) units. * * @example * ```html * {{ 1234 | wrBytes }} * {{ 1234567 | wrBytes: 0 }} * {{ 0 | wrBytes }} * ``` */ declare class WrBytes implements PipeTransform { transform(value: number | string | null | undefined, decimals?: number): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Locale-aware date formatting. Delegates to `WrDateAdapter` when * `provideWrDateAdapter()` is in the provider tree (giving access to named * format keys like `'shortDate'` and `'longDate'`), otherwise falls back to * a minimal `Intl.DateTimeFormat`-based formatter so the pipe still works * without the date-adapter package wired up. * * @example * ```html * {{ now | wrDate }} * {{ now | wrDate: 'mediumDateTime' }} * {{ now | wrDate: 'dd.MM.yyyy' }} * ``` */ declare class WrDate implements PipeTransform { private readonly adapter; private readonly locale; transform(value: Date | string | number | null | undefined, format?: WrDateFormat | (string & {})): string; /** Tiny fallback for the named keys when no adapter is provided. */ private fallback; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE */ /** * Wrap every occurrence of `query` in `` tags. Useful for highlighting * search-term matches in autocomplete results, lists, and table cells. * * The output is `SafeHtml` — bind with `[innerHTML]`. Input is escaped first * so user-supplied values can't inject markup. * * @example * ```html * * * * * ``` */ declare class WrMark implements PipeTransform { private readonly sanitizer; /** * @param value Source text. * @param query Search term to highlight. Empty/null skips the wrap. * @param caseSensitive Match exactly. @default false */ transform(value: string | null | undefined, query: string | null | undefined, caseSensitive?: boolean): SafeHtml; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** Word forms keyed by CLDR plural category. Only `other` is required. */ type WrPluralForms = Partial> & { readonly other: string; }; interface WrPluralOptions { /** Prefix the formatted count before the word. @default true */ readonly includeValue?: boolean; /** Locale override; defaults to Angular's `LOCALE_ID`. */ readonly locale?: string; } /** Built-in style shortcuts — pick a sensible `Intl.NumberFormat` preset by name. */ type WrNumberStyle = 'decimal' | 'percent' | 'currency'; /** * Locale-aware number formatting via `Intl.NumberFormat`. Uses Angular's * `LOCALE_ID` as the default locale. * * Accepts either a style shortcut (with optional currency code) or a full * `Intl.NumberFormatOptions` object for fine-grained control. * * @example * ```html * {{ 1234.5 | wrNumber }} * {{ 0.875 | wrNumber: 'percent' }} * {{ 19.99 | wrNumber: 'currency': 'USD' }} * {{ 19.99 | wrNumber: { minimumFractionDigits: 2 } }} * ``` */ declare class WrNumber implements PipeTransform { private readonly locale; transform(value: number | string | null | undefined, styleOrOptions?: WrNumberStyle | Intl.NumberFormatOptions, currency?: string): string; private toOptions; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Locale-aware pluralization via `Intl.PluralRules`. Picks the right word * form for the count — including languages with more than two forms * (Russian, Polish, Arabic, …) — without hand-rolled `n % 10` rules. * * Categories follow CLDR: `zero` / `one` / `two` / `few` / `many` / * `other`. Missing categories fall back to `other`. * * @example * ```html * {{ 1 | wrPlural: { one: 'comment', other: 'comments' } }} * * * {{ 5 | wrPlural: { one: 'файл', few: 'файла', other: 'файлов' } }} * * * {{ count() | wrPlural: forms : { includeValue: false } }} * * ``` */ declare class WrPlural implements PipeTransform { private readonly locale; transform(value: number | null | undefined, forms: WrPluralForms, options?: WrPluralOptions): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Creates an array of sequential indices `[0, 1, 2, ..., n-1]`. * * Useful for repeating template blocks a fixed number of times. * * @example * ```html * @for (i of (5 | wrRange); track i) { *
Item {{ i }}
* } * ``` */ declare class WrRange implements PipeTransform { transform(length: number): number[]; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * Clamp a string to `length` characters, appending `ellipsis` when truncated. * * @example * ```html * {{ 'Hello, world' | wrTruncate: 5 }} * {{ 'Hello, world' | wrTruncate: 8: '...' }} * ``` */ declare class WrTruncate implements PipeTransform { transform(value: string | null | undefined, length?: number, ellipsis?: string): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } export { WrBytes, WrDate, WrMark, WrNumber, WrPlural, WrRange, WrTruncate }; export type { WrNumberStyle, WrPluralForms, WrPluralOptions };