ngx-transforms 0.0.5 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -71,8 +71,6 @@ interface AsciiArtOptions extends Partial<AsciiConfig> {
71
71
  * @example
72
72
  * // With inverted colors
73
73
  * {{ 'DARK' | asciiArt:{ inverted: true, charset: CharsetPreset.MINIMAL } }}
74
- *
75
- * @author Mofiro Jean
76
74
  */
77
75
  declare class AsciiArtPipe implements PipeTransform {
78
76
  private generator;
@@ -87,6 +85,286 @@ declare class AsciiArtPipe implements PipeTransform {
87
85
  static ɵpipe: i0.ɵɵPipeDeclaration<AsciiArtPipe, "asciiArt", true>;
88
86
  }
89
87
 
88
+ /**
89
+ * CamelCasePipe: Converts text to camelCase (e.g., "hello world" → "helloWorld").
90
+ *
91
+ * @param {string} value - The input string to transform.
92
+ * @returns {string} The string in camelCase, or an empty string if input is invalid.
93
+ *
94
+ * @example
95
+ * ```html
96
+ * {{ 'hello world' | camelCase }} <!-- Outputs: helloWorld -->
97
+ * ```
98
+ */
99
+ declare class CamelCasePipe implements PipeTransform {
100
+ transform(value: string): string;
101
+ static ɵfac: i0.ɵɵFactoryDeclaration<CamelCasePipe, never>;
102
+ static ɵpipe: i0.ɵɵPipeDeclaration<CamelCasePipe, "camelCase", true>;
103
+ }
104
+
105
+ /**
106
+ * HighlightPipe: Highlights occurrences of a search term within a string.
107
+ *
108
+ * This Angular pipe transforms a string input by wrapping all occurrences of a specified
109
+ * search term with a `<span>` element that has the class "highlight".
110
+ * It uses the Angular `DomSanitizer` to bypass security and render the highlighted HTML.
111
+ *
112
+ * @param {string} value - The input string in which to highlight the search term.
113
+ * @param {string} searchTerm - The string to search for and highlight.
114
+ * @returns {SafeHtml} - The input string with the search term highlighted, or an empty string if input or searchTerm are falsy.
115
+ *
116
+ * @example
117
+ * {{ 'This is a test string' | highlight: 'test' }} // Returns 'This is a <span class="highlight">test</span> string'
118
+ * {{ 'This is a test TEST string' | highlight: 'test' }} // Returns 'This is a <span class="highlight">test</span> <span class="highlight">TEST</span> string'
119
+ * {{ 'This is a test string' | highlight: '' }} // Returns 'This is a test string'
120
+ * {{ null | highlight: 'test' }} // Returns ''
121
+ * {{ undefined | highlight: 'test' }} // Returns ''
122
+ */
123
+ declare class HighlightPipe implements PipeTransform {
124
+ private sanitizer;
125
+ transform(value: string, searchTerm: string): SafeHtml;
126
+ static ɵfac: i0.ɵɵFactoryDeclaration<HighlightPipe, never>;
127
+ static ɵpipe: i0.ɵɵPipeDeclaration<HighlightPipe, "highlight", true>;
128
+ }
129
+
130
+ /**
131
+ * InitialsPipe: Extracts initials from a name.
132
+ *
133
+ * @param {string} value - The full name.
134
+ *
135
+ * @returns {string} - The initials (e.g., 'John Doe' → 'JD').
136
+ *
137
+ * @example
138
+ * {{ 'John Doe' | initials }} // Outputs: JD
139
+ * {{ 'Mary Jane Watson' | initials }} // Outputs: MJW
140
+ */
141
+ declare class InitialsPipe implements PipeTransform {
142
+ transform(value: string): string;
143
+ static ɵfac: i0.ɵɵFactoryDeclaration<InitialsPipe, never>;
144
+ static ɵpipe: i0.ɵɵPipeDeclaration<InitialsPipe, "initials", true>;
145
+ }
146
+
147
+ /**
148
+ * KebabCasePipe: Converts text to kebab-case (e.g., "hello world" → "hello-world").
149
+ *
150
+ * @param {string} value - The input string to transform.
151
+ * @returns {string} The string in kebab-case, or an empty string if input is invalid.
152
+ *
153
+ * @example
154
+ * ```html
155
+ * {{ 'hello world' | kebabCase }} <!-- Outputs: hello-world -->
156
+ * ```
157
+ */
158
+ declare class KebabCasePipe implements PipeTransform {
159
+ transform(value: string): string;
160
+ static ɵfac: i0.ɵɵFactoryDeclaration<KebabCasePipe, never>;
161
+ static ɵpipe: i0.ɵɵPipeDeclaration<KebabCasePipe, "kebabCase", true>;
162
+ }
163
+
164
+ /**
165
+ * MorseCodePipe: Converts text to Morse code.
166
+ *
167
+ * @param {string} value - The text to convert to Morse code.
168
+ *
169
+ * @returns {string} - The Morse code representation (e.g., 'SOS' → '... --- ...').
170
+ *
171
+ * @example
172
+ * {{ 'SOS' | morseCode }} // Outputs: '... --- ...'
173
+ * {{ 'HELP' | morseCode }} // Outputs: '.... . .-.. .--.'
174
+ * <p>{{ userInput | morseCode }}</p>
175
+ */
176
+ declare class MorseCodePipe implements PipeTransform {
177
+ private readonly morseCodeMap;
178
+ transform(value: string): string;
179
+ static ɵfac: i0.ɵɵFactoryDeclaration<MorseCodePipe, never>;
180
+ static ɵpipe: i0.ɵɵPipeDeclaration<MorseCodePipe, "morseCode", true>;
181
+ }
182
+
183
+ /**
184
+ * ReplacePipe: A custom Angular pipe that either highlights or replaces text based on a pattern.
185
+ *
186
+ * - If `isReplace` is `false`, it highlights occurrences of the pattern (if `highlightClass` is provided).
187
+ * - If `isReplace` is `true`, it replaces occurrences of the pattern with the replacement string, optionally highlighting the replacement.
188
+ *
189
+ * @param {string} value - The input string to transform.
190
+ * @param {string | RegExp} pattern - The pattern to match (string or RegExp). If an empty string, the value is returned as-is.
191
+ * @param {string} replacement - The string to replace matches with.
192
+ * @param {string} [highlightClass] - Optional CSS class for highlighting matched or replaced text (e.g., 'highlight').
193
+ * @param {boolean} [isReplace=true] - Whether to perform replacement (true) or only highlight matches (false).
194
+ *
195
+ * @returns {string | SafeHtml} - Returns the transformed string or SafeHtml with highlights.
196
+ */
197
+ declare class ReplacePipe implements PipeTransform {
198
+ private sanitizer;
199
+ transform(value: string, pattern: string | RegExp, replacement: string, highlightClass?: string, isReplace?: boolean): string | SafeHtml;
200
+ static ɵfac: i0.ɵɵFactoryDeclaration<ReplacePipe, never>;
201
+ static ɵpipe: i0.ɵɵPipeDeclaration<ReplacePipe, "replace", true>;
202
+ }
203
+
204
+ /**
205
+ * SnakeCasePipe: Converts text to snake_case (e.g., "hello world" → "hello_world").
206
+ *
207
+ * @param {string} value - The input string to transform.
208
+ * @returns {string} The string in snake_case, or an empty string if input is invalid.
209
+ *
210
+ * @example
211
+ * ```html
212
+ * {{ 'hello world' | snakeCase }} <!-- Outputs: hello_world -->
213
+ * ```
214
+ */
215
+ declare class SnakeCasePipe implements PipeTransform {
216
+ transform(value: string): string;
217
+ static ɵfac: i0.ɵɵFactoryDeclaration<SnakeCasePipe, never>;
218
+ static ɵpipe: i0.ɵɵPipeDeclaration<SnakeCasePipe, "snakeCase", true>;
219
+ }
220
+
221
+ /**
222
+ * TitleCasePipe: Capitalizes the first letter of each word in a string.
223
+ *
224
+ * @param {string} value - The input string to transform.
225
+ * @returns {string} The string with each word capitalized, or an empty string if input is invalid.
226
+ *
227
+ * @example
228
+ * ```html
229
+ * {{ 'hello world' | titleCase }} <!-- Outputs: Hello World -->
230
+ * ```
231
+ */
232
+ declare class TitleCasePipe implements PipeTransform {
233
+ transform(value: string): string;
234
+ static ɵfac: i0.ɵɵFactoryDeclaration<TitleCasePipe, never>;
235
+ static ɵpipe: i0.ɵɵPipeDeclaration<TitleCasePipe, "titleCase", true>;
236
+ }
237
+
238
+ /**
239
+ * TruncatePipe: Truncates a string to a specified maximum length, optionally preserving words.
240
+ *
241
+ * This Angular pipe transforms a string input by truncating it to the given `maxLength`.
242
+ * It provides options to customize the ellipsis and preserve word boundaries.
243
+ *
244
+ * @param {string} value - The input string to be truncated.
245
+ * @param {number} [maxLength=10] - The maximum length of the truncated string. Defaults to 10.
246
+ * @param {string} [ellipsis='...'] - The string to append to the truncated portion. Defaults to '...'.
247
+ * @param {boolean} [preserveWords=false] - If true, truncates at the last space before `maxLength` to avoid cutting words. Defaults to false.
248
+ * @returns {string} - The truncated string. Returns an empty string if the input is null, undefined, or not a string.
249
+ *
250
+ * @example
251
+ * {{ 'This is a long sentence' | truncate }} // Returns 'This is a...'
252
+ * {{ 'This is a long sentence' | truncate: 20 }} // Returns 'This is a long sente...'
253
+ * {{ 'This is a long sentence' | truncate: 15: ' [more]' }} // Returns 'This is a long [more]'
254
+ * {{ 'This is a long sentence' | truncate: 15: '...' : true }} // Returns 'This is a...'
255
+ * {{ 'This is a long sentence' | truncate: 20: '...' : true }} // Returns 'This is a long...'
256
+ * {{ null | truncate }} // Returns ''
257
+ * {{ undefined | truncate }} // Returns ''
258
+ */
259
+ declare class TruncatePipe implements PipeTransform {
260
+ transform(value: string, maxLength?: number, ellipsis?: string, preserveWords?: boolean): string;
261
+ static ɵfac: i0.ɵɵFactoryDeclaration<TruncatePipe, never>;
262
+ static ɵpipe: i0.ɵɵPipeDeclaration<TruncatePipe, "truncate", true>;
263
+ }
264
+
265
+ /**
266
+ * CreditCardMaskPipe: Masks all but the last four digits of a string, optionally controlled by a boolean flag.
267
+ * By default, masking is applied.
268
+ *
269
+ * @param {string} value - The input string to mask (e.g., credit card number).
270
+ * @param {boolean} shouldMask - (Optional) Determines if masking should be applied. Defaults to true.
271
+ * @returns {string} - The masked string or the original value if `shouldMask` is false or the value is too short.
272
+ *
273
+ * @example
274
+ * {{ '1234567890123456' | creditCardMask }} // Outputs: **** **** **** 3456
275
+ * {{ '1234-5678-9012-3456' | creditCardMask }} // Outputs: **** **** **** 3456
276
+ * {{ '1234567890123456' | creditCardMask: true }} // Outputs: **** **** **** 3456
277
+ * {{ '1234567890123456' | creditCardMask: false }} // Outputs: 1234567890123456
278
+ */
279
+ declare class CreditCardMaskPipe implements PipeTransform {
280
+ transform(value: string | null | undefined, shouldMask?: boolean): string | null | undefined;
281
+ static ɵfac: i0.ɵɵFactoryDeclaration<CreditCardMaskPipe, never>;
282
+ static ɵpipe: i0.ɵɵPipeDeclaration<CreditCardMaskPipe, "creditCardMask", true>;
283
+ }
284
+
285
+ /**
286
+ * EmailMaskPipe: Masks the local part of an email address, revealing only the first and last characters.
287
+ *
288
+ * This Angular pipe transforms an email address string by replacing the characters between the first and last characters of the local part (before the '@') with "***".
289
+ * If the local part is 2 characters or less, it masks all characters except the first.
290
+ *
291
+ * @param {string} value - The email address string to be masked.
292
+ * @returns {string} - The masked email address, or the original value if it's not a valid email or falsy.
293
+ *
294
+ * @example
295
+ * {{ 'test@example.com' | emailMask }} // Returns 't***t@example.com'
296
+ * {{ 'te@example.com' | emailMask }} // Returns 't***@example.com'
297
+ * {{ 't@example.com' | emailMask }} // Returns 't***@example.com'
298
+ * {{ 'example.com' | emailMask }} // Returns 'example.com'
299
+ * {{ null | emailMask }} // Returns ''
300
+ * {{ undefined | emailMask }} // Returns ''
301
+ */
302
+ declare class EmailMaskPipe implements PipeTransform {
303
+ transform(value: string): string;
304
+ static ɵfac: i0.ɵɵFactoryDeclaration<EmailMaskPipe, never>;
305
+ static ɵpipe: i0.ɵɵPipeDeclaration<EmailMaskPipe, "emailMask", true>;
306
+ }
307
+
308
+ /**
309
+ * Converts special HTML characters in a string to their corresponding HTML entities.
310
+ * This prevents the browser from interpreting the input as HTML, rendering it as plain text.
311
+ *
312
+ * @param {string} value - The input string containing HTML to escape.
313
+ * @returns {string} The string with special HTML characters escaped, or an empty string if input is invalid.
314
+ *
315
+ * @example
316
+ * ```html
317
+ * {{ '<p>Hello</p>' | htmlEscape }} <!-- Outputs: &lt;p&gt;Hello&lt;/p&gt; -->
318
+ * ```
319
+ */
320
+ declare class HtmlEscapePipe implements PipeTransform {
321
+ transform(value: string): string;
322
+ static ɵfac: i0.ɵɵFactoryDeclaration<HtmlEscapePipe, never>;
323
+ static ɵpipe: i0.ɵɵPipeDeclaration<HtmlEscapePipe, "htmlEscape", true>;
324
+ }
325
+
326
+ /**
327
+ * Sanitizes HTML input to remove unsafe elements while allowing safe HTML to be rendered.
328
+ * Uses Angular's DomSanitizer to mark the output as trusted for use in [innerHTML].
329
+ *
330
+ * @param {string} value - The input string containing HTML to sanitize.
331
+ * @returns {SafeHtml} The sanitized HTML marked as safe, or an empty string if input is invalid.
332
+ *
333
+ * @remarks
334
+ * WARNING: Use with caution. Only apply to trusted input to avoid XSS risks.
335
+ * Ensure input is pre-validated or sourced from a secure origin (e.g., a controlled rich-text editor).
336
+ *
337
+ * @example
338
+ * ```html
339
+ * <div [innerHTML]="'<p>Hello</p><script>alert(1)</script>' | htmlSanitize"></div>
340
+ * <!-- Renders: <p>Hello</p> (script tag removed) -->
341
+ * ```
342
+ */
343
+ declare class HtmlSanitizePipe implements PipeTransform {
344
+ private sanitizer;
345
+ transform(value: string): SafeHtml;
346
+ static ɵfac: i0.ɵɵFactoryDeclaration<HtmlSanitizePipe, never>;
347
+ static ɵpipe: i0.ɵɵPipeDeclaration<HtmlSanitizePipe, "htmlSanitize", true>;
348
+ }
349
+
350
+ /**
351
+ * IpAddressMaskPipe: Masks the last two octets of an IPv4 address.
352
+ *
353
+ * @param {string} value - The IPv4 address (e.g., 192.168.1.1).
354
+ * @param {boolean} shouldMask - (Optional) Determines if masking should be applied. Defaults to true..
355
+ *
356
+ * @returns {string} - The masked IP address (e.g., 192.168.*.*).
357
+ *
358
+ * @example
359
+ * {{ '192.168.1.1' | ipAddressMask }} // Outputs: 192.168.*.*
360
+ * {{ '10.0.0.255' | ipAddressMask }} // Outputs: 10.0.*.*
361
+ */
362
+ declare class IpAddressMaskPipe implements PipeTransform {
363
+ transform(value: string, shouldMask?: boolean): string;
364
+ static ɵfac: i0.ɵɵFactoryDeclaration<IpAddressMaskPipe, never>;
365
+ static ɵpipe: i0.ɵɵPipeDeclaration<IpAddressMaskPipe, "ipAddressMask", true>;
366
+ }
367
+
90
368
  /**
91
369
  * BarcodeElementType: Defines the type of element to render the barcode.
92
370
  *
@@ -129,8 +407,6 @@ interface BarcodeOptions {
129
407
  * @example
130
408
  * <div [innerHTML]="'123456789' | barcode:{elementType:'svg',format:'CODE128'} | async"></div>
131
409
  * <img [src]="'123456789' | barcode:{elementType:'img'} | async" />
132
- *
133
- * @author Mofiro Jean
134
410
  */
135
411
  declare class BarcodePipe implements PipeTransform {
136
412
  private sanitizer;
@@ -139,25 +415,6 @@ declare class BarcodePipe implements PipeTransform {
139
415
  static ɵpipe: i0.ɵɵPipeDeclaration<BarcodePipe, "barcode", true>;
140
416
  }
141
417
 
142
- /**
143
- * CamelCasePipe: Converts text to camelCase (e.g., "hello world" → "helloWorld").
144
- *
145
- * @param {string} value - The input string to transform.
146
- * @returns {string} The string in camelCase, or an empty string if input is invalid.
147
- *
148
- * @example
149
- * ```html
150
- * {{ 'hello world' | camelCase }} <!-- Outputs: helloWorld -->
151
- * ```
152
- *
153
- * @author Mofiro Jean
154
- */
155
- declare class CamelCasePipe implements PipeTransform {
156
- transform(value: string): string;
157
- static ɵfac: i0.ɵɵFactoryDeclaration<CamelCasePipe, never>;
158
- static ɵpipe: i0.ɵɵPipeDeclaration<CamelCasePipe, "camelCase", true>;
159
- }
160
-
161
418
  /**
162
419
  * ColorTargetType: Defines the target color format for conversion.
163
420
  *
@@ -207,8 +464,6 @@ type ColorTargetType = 'hex' | 'rgb' | 'rgba';
207
464
  * // Alpha channel support
208
465
  * {{ '#FF000080' | colorConvert:'rgba' }} // rgba(255, 0, 0, 0.5)
209
466
  * {{ 'rgba(255, 0, 0, 0.5)' | colorConvert:'hex' }} // #FF000080
210
- *
211
- * @author Mofiro Jean
212
467
  */
213
468
  declare class ColorConvertPipe implements PipeTransform {
214
469
  transform(value: string, target: ColorTargetType): string;
@@ -216,32 +471,60 @@ declare class ColorConvertPipe implements PipeTransform {
216
471
  static ɵpipe: i0.ɵɵPipeDeclaration<ColorConvertPipe, "colorConvert", true>;
217
472
  }
218
473
 
219
- declare class CountPipe implements PipeTransform {
220
- transform(value: any): number;
221
- static ɵfac: i0.ɵɵFactoryDeclaration<CountPipe, never>;
222
- static ɵpipe: i0.ɵɵPipeDeclaration<CountPipe, "count", true>;
474
+ /**
475
+ * GravatarPipe: Generates Gravatar URLs from email addresses.
476
+ *
477
+ * @param {string} value - The email address.
478
+ * @param {number} [size=80] - The avatar size in pixels.
479
+ *
480
+ * @returns {string} - The Gravatar URL.
481
+ *
482
+ * @example
483
+ * <img [src]="'user@example.com' | gravatar:100" />
484
+ */
485
+ declare class GravatarPipe implements PipeTransform {
486
+ transform(value: string, size?: number): string;
487
+ static ɵfac: i0.ɵɵFactoryDeclaration<GravatarPipe, never>;
488
+ static ɵpipe: i0.ɵɵPipeDeclaration<GravatarPipe, "gravatar", true>;
223
489
  }
224
490
 
491
+ interface QrCodeOptions {
492
+ version?: number;
493
+ errorCorrectionLevel?: 'low' | 'medium' | 'quartile' | 'high' | 'L' | 'M' | 'Q' | 'H';
494
+ maskPattern?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
495
+ margin?: number;
496
+ scale?: number;
497
+ width?: number;
498
+ color?: {
499
+ dark?: string;
500
+ light?: string;
501
+ };
502
+ type?: 'image/png' | 'image/jpeg' | 'image/webp';
503
+ rendererOpts?: {
504
+ quality?: number;
505
+ };
506
+ }
225
507
  /**
226
- * CreditCardMaskPipe: Masks all but the last four digits of a string, optionally controlled by a boolean flag.
227
- * By default, masking is applied.
508
+ * QrCodePipe: Generates a QR code from a string.
228
509
  *
229
- * @param {string} value - The input string to mask (e.g., credit card number).
230
- * @param {boolean} shouldMask - (Optional) Determines if masking should be applied. Defaults to true.
231
- * @returns {string} - The masked string or the original value if `shouldMask` is false or the value is too short.
510
+ * @param {string} value - The string to encode.
511
+ * @param {QrCodeOptions} [options] - The QR code options.
232
512
  *
233
- * @example
234
- * {{ '1234567890123456' | creditCardMask }} // Outputs: **** **** **** 3456
235
- * {{ '1234-5678-9012-3456' | creditCardMask }} // Outputs: **** **** **** 3456
236
- * {{ '1234567890123456' | creditCardMask: true }} // Outputs: **** **** **** 3456
237
- * {{ '1234567890123456' | creditCardMask: false }} // Outputs: 1234567890123456
513
+ * @returns {Promise<string>} - A promise that resolves with the QR code data URL.
238
514
  *
239
- * @author Mofiro Jean
515
+ * @example
516
+ * <img [src]="'Hello, World!' | qrCode | async" />
240
517
  */
241
- declare class CreditCardMaskPipe implements PipeTransform {
242
- transform(value: string | null | undefined, shouldMask?: boolean): string | null | undefined;
243
- static ɵfac: i0.ɵɵFactoryDeclaration<CreditCardMaskPipe, never>;
244
- static ɵpipe: i0.ɵɵPipeDeclaration<CreditCardMaskPipe, "creditCardMask", true>;
518
+ declare class QrCodePipe implements PipeTransform {
519
+ transform(value: string, options?: QrCodeOptions): Promise<string>;
520
+ static ɵfac: i0.ɵɵFactoryDeclaration<QrCodePipe, never>;
521
+ static ɵpipe: i0.ɵɵPipeDeclaration<QrCodePipe, "qrCode", true>;
522
+ }
523
+
524
+ declare class CountPipe implements PipeTransform {
525
+ transform(value: any): number;
526
+ static ɵfac: i0.ɵɵFactoryDeclaration<CountPipe, never>;
527
+ static ɵpipe: i0.ɵɵPipeDeclaration<CountPipe, "count", true>;
245
528
  }
246
529
 
247
530
  /**
@@ -275,399 +558,497 @@ declare class DeviceTypePipe implements PipeTransform {
275
558
  }
276
559
 
277
560
  /**
278
- * EmailMaskPipe: Masks the local part of an email address, revealing only the first and last characters.
561
+ * JsonPrettyPipe: Formats JSON data with indentation and syntax highlighting.
562
+ *
563
+ * @param {string | object} value - The JSON string or object to format.
564
+ * @param {number} [spaces=2] - Number of spaces for indentation.
565
+ *
566
+ * @returns {SafeHtml} - Formatted HTML with color-coded JSON.
567
+ *
568
+ * @example
569
+ * {{ '{"name": "John", "age": 30}' | jsonPretty }} // Outputs: Colorful, indented JSON
570
+ * <pre [innerHTML]="data | jsonPretty:4"></pre> // 4-space indentation
571
+ */
572
+ declare class JsonPrettyPipe implements PipeTransform {
573
+ private sanitizer;
574
+ transform(value: string | object, spaces?: number, highlightProperty?: string | null): SafeHtml;
575
+ private highlightJson;
576
+ static ɵfac: i0.ɵɵFactoryDeclaration<JsonPrettyPipe, never>;
577
+ static ɵpipe: i0.ɵɵPipeDeclaration<JsonPrettyPipe, "jsonPretty", true>;
578
+ }
579
+
580
+ /**
581
+ * TextToSpeechPipe: Converts text to speech using the Web Speech API.
582
+ *
583
+ * @param {string} value - The text to convert to speech.
584
+ * @param {string} [lang='en-US'] - The language (local) for speech synthesis.
585
+ *
586
+ * @returns {void} - Triggers speech synthesis (no return value).
587
+ *
588
+ * @example
589
+ * <div>{{ Hello World' | textToSpeech }}</div>
590
+ * <div>{{ 'Bonjour' | textToSpeech:'fr-FR' }}h</div>
591
+ */
592
+ declare class TextToSpeechPipe implements PipeTransform {
593
+ transform(value: string, lang?: string): void;
594
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextToSpeechPipe, never>;
595
+ static ɵpipe: i0.ɵɵPipeDeclaration<TextToSpeechPipe, "textToSpeech", true>;
596
+ }
597
+
598
+ /**
599
+ * TimeAgo: Converts a date into a localized time string.
600
+ *
601
+ * Use the in-built Intl.RelativeTimeFormat to convert a date into a localized time string.
602
+ * It was chosen over moment.js because it's more lightweight and supports more locales.
603
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat
604
+ *
605
+ * @param {Date | number | string} value - The date to convert.
606
+ * @param {string} [local='en'] - BCP 47 local code (e.g., 'en', 'fr', 'es').
607
+ *
608
+ * @returns {string} - The localized time string.
609
+ *
610
+ * @example
611
+ * {{ date | timeAgo }} // '5 minutes ago'
612
+ * {{ date | timeAgo:'fr' }} // 'il y a 5 minutes'
613
+ *
614
+ * @note Pure pipe - output won't automatically update as time passes.
615
+ * Use signals or periodic change detection to re-trigger.
616
+ * */
617
+ declare class TimeAgoPipePipe implements PipeTransform {
618
+ private static readonly THRESHOLDS;
619
+ private cacheLocal;
620
+ private rtf;
621
+ transform(value: Date | number | string, local?: string): string;
622
+ static ɵfac: i0.ɵɵFactoryDeclaration<TimeAgoPipePipe, never>;
623
+ static ɵpipe: i0.ɵɵPipeDeclaration<TimeAgoPipePipe, "timeAgo", true>;
624
+ }
625
+
626
+ /**
627
+ * DiffPipe: Returns elements present in the first array but not in the second.
628
+ *
629
+ * Supports primitives and objects by property key with dot notation.
630
+ *
631
+ * @param {unknown[]} value - The source array.
632
+ * @param {unknown[]} compared - The array to compare against.
633
+ * @param {string} [key] - Optional property path for object comparison (supports dot notation).
634
+ *
635
+ * @returns {unknown[]} - Elements in value that are not in compared.
636
+ *
637
+ * @example
638
+ * {{ [1, 2, 3, 4, 5] | diff:[3, 4, 5, 6] }} // [1, 2]
639
+ * {{ allUsers | diff:activeUsers:'id' }} // inactive users
640
+ * {{ orders | diff:shipped:'meta.trackingId' }} // unshipped orders
641
+ */
642
+ declare class DiffPipe implements PipeTransform {
643
+ transform(value: unknown[], compared: unknown[], key?: string): unknown[];
644
+ private getNestedValue;
645
+ static ɵfac: i0.ɵɵFactoryDeclaration<DiffPipe, never>;
646
+ static ɵpipe: i0.ɵɵPipeDeclaration<DiffPipe, "diff", true>;
647
+ }
648
+
649
+ /**
650
+ * EveryPipe: Checks if all elements in an array satisfy a condition.
651
+ *
652
+ * Supports primitives (equality check) and objects by property key with dot notation.
653
+ *
654
+ * @param {unknown[]} value - The array to check.
655
+ * @param {unknown} match - The value to match against.
656
+ * @param {string} [key] - Optional property path to check (supports dot notation).
657
+ *
658
+ * @returns {boolean} - True if all elements match, false otherwise.
659
+ *
660
+ * @example
661
+ * {{ [true, true, true] | every:true }} // true
662
+ * {{ users | every:'active':'status' }} // are all users active?
663
+ * {{ orders | every:'shipped':'meta.state' }} // are all orders shipped?
664
+ */
665
+ declare class EveryPipe implements PipeTransform {
666
+ transform(value: unknown[], match: unknown, key?: string): boolean;
667
+ private getNestedValue;
668
+ static ɵfac: i0.ɵɵFactoryDeclaration<EveryPipe, never>;
669
+ static ɵpipe: i0.ɵɵPipeDeclaration<EveryPipe, "every", true>;
670
+ }
671
+
672
+ /**
673
+ * IntersectionPipe: Returns elements common to both arrays.
279
674
  *
280
- * This Angular pipe transforms an email address string by replacing the characters between the first and last characters of the local part (before the '@') with "***".
281
- * If the local part is 2 characters or less, it masks all characters except the first.
675
+ * Supports primitives and objects by property key with dot notation.
282
676
  *
283
- * @param {string} value - The email address string to be masked.
284
- * @returns {string} - The masked email address, or the original value if it's not a valid email or falsy.
677
+ * @param {unknown[]} value - The first array.
678
+ * @param {unknown[]} compared - The second array.
679
+ * @param {string} [key] - Optional property path for object comparison (supports dot notation).
285
680
  *
286
- * @example
287
- * {{ 'test@example.com' | emailMask }} // Returns 't***t@example.com'
288
- * {{ 'te@example.com' | emailMask }} // Returns 't***@example.com'
289
- * {{ 't@example.com' | emailMask }} // Returns 't***@example.com'
290
- * {{ 'example.com' | emailMask }} // Returns 'example.com'
291
- * {{ null | emailMask }} // Returns ''
292
- * {{ undefined | emailMask }} // Returns ''
681
+ * @returns {unknown[]} - Elements present in both arrays.
293
682
  *
294
- * @author Mofiro Jean
683
+ * @example
684
+ * {{ [1, 2, 3, 4] | intersection:[3, 4, 5, 6] }} // [3, 4]
685
+ * {{ teamA | intersection:teamB:'id' }} // shared members
686
+ * {{ required | intersection:granted:'meta.scope' }} // matched permissions
295
687
  */
296
- declare class EmailMaskPipe implements PipeTransform {
297
- transform(value: string): string;
298
- static ɵfac: i0.ɵɵFactoryDeclaration<EmailMaskPipe, never>;
299
- static ɵpipe: i0.ɵɵPipeDeclaration<EmailMaskPipe, "emailMask", true>;
688
+ declare class IntersectionPipe implements PipeTransform {
689
+ transform(value: unknown[], compared: unknown[], key?: string): unknown[];
690
+ private getNestedValue;
691
+ static ɵfac: i0.ɵɵFactoryDeclaration<IntersectionPipe, never>;
692
+ static ɵpipe: i0.ɵɵPipeDeclaration<IntersectionPipe, "intersection", true>;
300
693
  }
301
694
 
302
695
  /**
303
- * GravatarPipe: Generates Gravatar URLs from email addresses.
696
+ * ChunkPipe: Splits an array into smaller arrays of a specified size.
304
697
  *
305
- * @param {string} value - The email address.
306
- * @param {number} [size=80] - The avatar size in pixels.
698
+ * @param {unknown[]} value - The array to split.
699
+ * @param {number} [size=1] - The size of each chunk.
307
700
  *
308
- * @returns {string} - The Gravatar URL.
701
+ * @returns {unknown[][]} - An array of chunks.
309
702
  *
310
703
  * @example
311
- * <img [src]="'user@example.com' | gravatar:100" />
312
- *
313
- * @author Mofiro Jean
704
+ * {{ [1, 2, 3, 4, 5] | chunk:2 }} // [[1, 2], [3, 4], [5]]
705
+ * {{ [1, 2, 3, 4, 5, 6] | chunk:3 }} // [[1, 2, 3], [4, 5, 6]]
314
706
  */
315
- declare class GravatarPipe implements PipeTransform {
316
- transform(value: string, size?: number): string;
317
- static ɵfac: i0.ɵɵFactoryDeclaration<GravatarPipe, never>;
318
- static ɵpipe: i0.ɵɵPipeDeclaration<GravatarPipe, "gravatar", true>;
707
+ declare class ChunkPipe implements PipeTransform {
708
+ transform(value: unknown[], size?: number): unknown[][];
709
+ static ɵfac: i0.ɵɵFactoryDeclaration<ChunkPipe, never>;
710
+ static ɵpipe: i0.ɵɵPipeDeclaration<ChunkPipe, "chunk", true>;
319
711
  }
320
712
 
321
713
  /**
322
- * HighlightPipe: Highlights occurrences of a search term within a string.
714
+ * FlattenPipe: Flattens nested arrays to a specified depth.
323
715
  *
324
- * This Angular pipe transforms a string input by wrapping all occurrences of a specified
325
- * search term with a `<span>` element that has the class "highlight".
326
- * It uses the Angular `DomSanitizer` to bypass security and render the highlighted HTML.
716
+ * @param {unknown[]} value - The nested array to flatten.
717
+ * @param {number} [depth=Infinity] - How many levels of nesting to flatten.
327
718
  *
328
- * @param {string} value - The input string in which to highlight the search term.
329
- * @param {string} searchTerm - The string to search for and highlight.
330
- * @returns {SafeHtml} - The input string with the search term highlighted, or an empty string if input or searchTerm are falsy.
719
+ * @returns {unknown[]} - A new flattened array.
331
720
  *
332
721
  * @example
333
- * {{ 'This is a test string' | highlight: 'test' }} // Returns 'This is a <span class="highlight">test</span> string'
334
- * {{ 'This is a test TEST string' | highlight: 'test' }} // Returns 'This is a <span class="highlight">test</span> <span class="highlight">TEST</span> string'
335
- * {{ 'This is a test string' | highlight: '' }} // Returns 'This is a test string'
336
- * {{ null | highlight: 'test' }} // Returns ''
337
- * {{ undefined | highlight: 'test' }} // Returns ''
338
- *
339
- * @author Mofiro Jean
722
+ * {{ [[1, 2], [3, 4]] | flatten }} // [1, 2, 3, 4]
723
+ * {{ [[1, [2, [3]]]] | flatten:1 }} // [1, 2, [3]]
724
+ * {{ [['a', 'b'], ['c']] | flatten }} // ['a', 'b', 'c']
340
725
  */
341
- declare class HighlightPipe implements PipeTransform {
342
- private sanitizer;
343
- transform(value: string, searchTerm: string): SafeHtml;
344
- static ɵfac: i0.ɵɵFactoryDeclaration<HighlightPipe, never>;
345
- static ɵpipe: i0.ɵɵPipeDeclaration<HighlightPipe, "highlight", true>;
726
+ declare class Flatten implements PipeTransform {
727
+ transform(value: unknown[], depth?: number): unknown[];
728
+ static ɵfac: i0.ɵɵFactoryDeclaration<Flatten, never>;
729
+ static ɵpipe: i0.ɵɵPipeDeclaration<Flatten, "flatten", true>;
346
730
  }
347
731
 
348
732
  /**
349
- * Converts special HTML characters in a string to their corresponding HTML entities.
350
- * This prevents the browser from interpreting the input as HTML, rendering it as plain text.
733
+ * GroupByPipe: Groups array elements by a property value.
351
734
  *
352
- * @param {string} value - The input string containing HTML to escape.
353
- * @returns {string} The string with special HTML characters escaped, or an empty string if input is invalid.
735
+ * @param {unknown[]} value - The array to group.
736
+ * @param {string} key - Property path to group by (supports dot notation).
737
+ *
738
+ * @returns {Record<string, unknown[]>} - An object where keys are group names and values are arrays.
354
739
  *
355
740
  * @example
356
- * ```html
357
- * {{ '<p>Hello</p>' | htmlEscape }} <!-- Outputs: &lt;p&gt;Hello&lt;/p&gt; -->
358
- * ```
741
+ * {{ users | groupBy:'role' }} // { admin: [...], editor: [...] }
742
+ * {{ orders | groupBy:'customer.city' }} // { 'New York': [...], 'London': [...] }
359
743
  */
360
- declare class HtmlEscapePipe implements PipeTransform {
361
- transform(value: string): string;
362
- static ɵfac: i0.ɵɵFactoryDeclaration<HtmlEscapePipe, never>;
363
- static ɵpipe: i0.ɵɵPipeDeclaration<HtmlEscapePipe, "htmlEscape", true>;
744
+ declare class GroupByPipe implements PipeTransform {
745
+ transform(value: unknown[], key: string): Record<string, unknown[]>;
746
+ private getNestedValue;
747
+ static ɵfac: i0.ɵɵFactoryDeclaration<GroupByPipe, never>;
748
+ static ɵpipe: i0.ɵɵPipeDeclaration<GroupByPipe, "groupBy", true>;
364
749
  }
365
750
 
366
751
  /**
367
- * Sanitizes HTML input to remove unsafe elements while allowing safe HTML to be rendered.
368
- * Uses Angular's DomSanitizer to mark the output as trusted for use in [innerHTML].
752
+ * InitialPipe: Returns all elements except the last n.
369
753
  *
370
- * @param {string} value - The input string containing HTML to sanitize.
371
- * @returns {SafeHtml} The sanitized HTML marked as safe, or an empty string if input is invalid.
754
+ * @param {unknown[]} value - The array to slice.
755
+ * @param {number} [n=1] - Number of elements to exclude from the end.
372
756
  *
373
- * @remarks
374
- * WARNING: Use with caution. Only apply to trusted input to avoid XSS risks.
375
- * Ensure input is pre-validated or sourced from a secure origin (e.g., a controlled rich-text editor).
757
+ * @returns {unknown[]} - A new array without the last n elements.
376
758
  *
377
759
  * @example
378
- * ```html
379
- * <div [innerHTML]="'<p>Hello</p><script>alert(1)</script>' | htmlSanitize"></div>
380
- * <!-- Renders: <p>Hello</p> (script tag removed) -->
381
- * ```
760
+ * {{ [1, 2, 3, 4, 5] | initial }} // [1, 2, 3, 4]
761
+ * {{ [1, 2, 3, 4, 5] | initial:2 }} // [1, 2, 3]
762
+ * {{ ['a', 'b', 'c'] | initial }} // ['a', 'b']
382
763
  */
383
- declare class HtmlSanitizePipe implements PipeTransform {
384
- private sanitizer;
385
- transform(value: string): SafeHtml;
386
- static ɵfac: i0.ɵɵFactoryDeclaration<HtmlSanitizePipe, never>;
387
- static ɵpipe: i0.ɵɵPipeDeclaration<HtmlSanitizePipe, "htmlSanitize", true>;
764
+ declare class InitialPipe implements PipeTransform {
765
+ transform(value: unknown, n?: number): unknown[];
766
+ static ɵfac: i0.ɵɵFactoryDeclaration<InitialPipe, never>;
767
+ static ɵpipe: i0.ɵɵPipeDeclaration<InitialPipe, "initial", true>;
388
768
  }
389
769
 
390
770
  /**
391
- * InitialsPipe: Extracts initials from a name.
771
+ * OrderByPipe: Sorts an array by a property value.
392
772
  *
393
- * @param {string} value - The full name.
773
+ * @param {unknown[]} value - The array to sort.
774
+ * @param {string} key - Property path to sort by (supports dot notation).
775
+ * @param {string} [direction='asc'] - Sort direction: 'asc' or 'desc'.
394
776
  *
395
- * @returns {string} - The initials (e.g., 'John Doe' → 'JD').
777
+ * @returns {unknown[]} - A new sorted array.
396
778
  *
397
779
  * @example
398
- * {{ 'John Doe' | initials }} // Outputs: JD
399
- * {{ 'Mary Jane Watson' | initials }} // Outputs: MJW
400
- *
401
- * @author Mofiro Jean
780
+ * {{ users | orderBy:'name' }} // sorted A-Z
781
+ * {{ users | orderBy:'name':'desc' }} // sorted Z-A
782
+ * {{ users | orderBy:'age':'asc' }} // sorted by age
402
783
  */
403
- declare class InitialsPipe implements PipeTransform {
404
- transform(value: string): string;
405
- static ɵfac: i0.ɵɵFactoryDeclaration<InitialsPipe, never>;
406
- static ɵpipe: i0.ɵɵPipeDeclaration<InitialsPipe, "initials", true>;
784
+ declare class OrderByPipe implements PipeTransform {
785
+ transform(value: unknown[], key: string, direction?: 'asc' | 'desc'): unknown[];
786
+ private getNestedValue;
787
+ static ɵfac: i0.ɵɵFactoryDeclaration<OrderByPipe, never>;
788
+ static ɵpipe: i0.ɵɵPipeDeclaration<OrderByPipe, "orderBy", true>;
407
789
  }
408
790
 
409
791
  /**
410
- * IpAddressMaskPipe: Masks the last two octets of an IPv4 address.
792
+ * PluckPipe: Extracts a property value from every object in an array.
411
793
  *
412
- * @param {string} value - The IPv4 address (e.g., 192.168.1.1).
413
- * @param {boolean} shouldMask - (Optional) Determines if masking should be applied. Defaults to true..
794
+ * @param {unknown[]} value - The array of objects.
795
+ * @param {string} key - Property path to extract (supports dot notation).
414
796
  *
415
- * @returns {string} - The masked IP address (e.g., 192.168.*.*).
797
+ * @returns {unknown[]} - An array of the extracted values.
416
798
  *
417
799
  * @example
418
- * {{ '192.168.1.1' | ipAddressMask }} // Outputs: 192.168.*.*
419
- * {{ '10.0.0.255' | ipAddressMask }} // Outputs: 10.0.*.*
420
- *
421
- * @author Mofiro Jean
800
+ * {{ users | pluck:'name' }} // ['Alice', 'Bob', 'Carol']
801
+ * {{ orders | pluck:'customer.email' }} // ['a@test.com', 'b@test.com']
422
802
  */
423
- declare class IpAddressMaskPipe implements PipeTransform {
424
- transform(value: string, shouldMask?: boolean): string;
425
- static ɵfac: i0.ɵɵFactoryDeclaration<IpAddressMaskPipe, never>;
426
- static ɵpipe: i0.ɵɵPipeDeclaration<IpAddressMaskPipe, "ipAddressMask", true>;
803
+ declare class PluckPipe implements PipeTransform {
804
+ transform(value: unknown[], key: string): unknown[];
805
+ private getNestedValue;
806
+ static ɵfac: i0.ɵɵFactoryDeclaration<PluckPipe, never>;
807
+ static ɵpipe: i0.ɵɵPipeDeclaration<PluckPipe, "pluck", true>;
427
808
  }
428
809
 
429
810
  /**
430
- * JsonPrettyPipe: Formats JSON data with indentation and syntax highlighting.
811
+ * RangePipe: Generates a numeric sequence array.
431
812
  *
432
- * @param {string | object} value - The JSON string or object to format.
433
- * @param {number} [spaces=2] - Number of spaces for indentation.
813
+ * @param {number} value - The number of items to generate (or the end value when start is provided).
814
+ * @param {number} [start=0] - The starting number.
815
+ * @param {number} [step=1] - The increment between each number.
434
816
  *
435
- * @returns {SafeHtml} - Formatted HTML with color-coded JSON.
817
+ * @returns {number[]} - An array of sequential numbers.
436
818
  *
437
819
  * @example
438
- * {{ '{"name": "John", "age": 30}' | jsonPretty }} // Outputs: Colorful, indented JSON
439
- * <pre [innerHTML]="data | jsonPretty:4"></pre> // 4-space indentation
440
- *
441
- * @author Mofiro Jean
820
+ * {{ 5 | range }} // [0, 1, 2, 3, 4]
821
+ * {{ 5 | range:1 }} // [1, 2, 3, 4, 5]
822
+ * {{ 10 | range:0:2 }} // [0, 2, 4, 6, 8]
442
823
  */
443
- declare class JsonPrettyPipe implements PipeTransform {
444
- private sanitizer;
445
- transform(value: string | object, spaces?: number, highlightProperty?: string | null): SafeHtml;
446
- private highlightJson;
447
- static ɵfac: i0.ɵɵFactoryDeclaration<JsonPrettyPipe, never>;
448
- static ɵpipe: i0.ɵɵPipeDeclaration<JsonPrettyPipe, "jsonPretty", true>;
824
+ declare class RangePipe implements PipeTransform {
825
+ transform(value: number, start?: number, step?: number): number[];
826
+ static ɵfac: i0.ɵɵFactoryDeclaration<RangePipe, never>;
827
+ static ɵpipe: i0.ɵɵPipeDeclaration<RangePipe, "range", true>;
449
828
  }
450
829
 
451
830
  /**
452
- * KebabCasePipe: Converts text to kebab-case (e.g., "hello world" → "hello-world").
831
+ * ReversePipe: Reverses the characters in a string.
453
832
  *
454
- * @param {string} value - The input string to transform.
455
- * @returns {string} The string in kebab-case, or an empty string if input is invalid.
833
+ * @param {string} value - The string to reverse.
456
834
  *
457
- * @example
458
- * ```html
459
- * {{ 'hello world' | kebabCase }} <!-- Outputs: hello-world -->
460
- * ```
835
+ * @returns {string} - The reversed string (e.g., 'hello' → 'olleh').
461
836
  *
462
- * @author Mofiro Jean
837
+ * @example
838
+ * {{ 'hello' | reverse }} // Outputs: 'olleh'
839
+ * {{ '12345' | reverse }} // Outputs: '54321'
840
+ * <p>{{ userInput | reverse }}</p>
463
841
  */
464
- declare class KebabCasePipe implements PipeTransform {
465
- transform(value: string): string;
466
- static ɵfac: i0.ɵɵFactoryDeclaration<KebabCasePipe, never>;
467
- static ɵpipe: i0.ɵɵPipeDeclaration<KebabCasePipe, "kebabCase", true>;
842
+ declare class ReversePipe implements PipeTransform {
843
+ transform(value: string | unknown[]): string | unknown[];
844
+ static ɵfac: i0.ɵɵFactoryDeclaration<ReversePipe, never>;
845
+ static ɵpipe: i0.ɵɵPipeDeclaration<ReversePipe, "reverse", true>;
468
846
  }
469
847
 
470
848
  /**
471
- * MorseCodePipe: Converts text to Morse code.
849
+ * SamplePipe: Randomly selects n items from an array.
472
850
  *
473
- * @param {string} value - The text to convert to Morse code.
851
+ * Uses Fisher-Yates partial shuffle for unbiased selection.
852
+ * Returns a single item when n=1 (default), or an array when n>1.
474
853
  *
475
- * @returns {string} - The Morse code representation (e.g., 'SOS' → '... --- ...').
854
+ * @param {unknown[]} value - The array to sample from.
855
+ * @param {number} [n=1] - Number of items to select.
856
+ *
857
+ * @returns {unknown | unknown[]} - A single random item (n=1) or array of random items (n>1).
476
858
  *
477
859
  * @example
478
- * {{ 'SOS' | morseCode }} // Outputs: '... --- ...'
479
- * {{ 'HELP' | morseCode }} // Outputs: '.... . .-.. .--.'
480
- * <p>{{ userInput | morseCode }}</p>
860
+ * {{ [1, 2, 3, 4, 5] | sample }} // 3 (random single)
861
+ * {{ [1, 2, 3, 4, 5] | sample:3 }} // [5, 1, 3] (random 3)
862
+ * {{ users | sample:5 }} // 5 random users
481
863
  *
482
- * @author Mofiro Jean
864
+ * @note Impure pipe — returns different results on each change detection cycle.
865
+ * Bind the result to a signal to control when it re-samples.
483
866
  */
484
- declare class MorseCodePipe implements PipeTransform {
485
- private readonly morseCodeMap;
486
- transform(value: string): string;
487
- static ɵfac: i0.ɵɵFactoryDeclaration<MorseCodePipe, never>;
488
- static ɵpipe: i0.ɵɵPipeDeclaration<MorseCodePipe, "morseCode", true>;
867
+ declare class SamplePipe implements PipeTransform {
868
+ transform(value: unknown[], n?: number): unknown | unknown[];
869
+ static ɵfac: i0.ɵɵFactoryDeclaration<SamplePipe, never>;
870
+ static ɵpipe: i0.ɵɵPipeDeclaration<SamplePipe, "sample", true>;
489
871
  }
490
872
 
491
- interface QrCodeOptions {
492
- version?: number;
493
- errorCorrectionLevel?: 'low' | 'medium' | 'quartile' | 'high' | 'L' | 'M' | 'Q' | 'H';
494
- maskPattern?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7;
495
- margin?: number;
496
- scale?: number;
497
- width?: number;
498
- color?: {
499
- dark?: string;
500
- light?: string;
501
- };
502
- type?: 'image/png' | 'image/jpeg' | 'image/webp';
503
- rendererOpts?: {
504
- quality?: number;
505
- };
506
- }
507
873
  /**
508
- * QrCodePipe: Generates a QR code from a string.
874
+ * ShufflePipe: Randomly reorders elements in an array using the Fisher-Yates
875
+ algorithm.
509
876
  *
510
- * @param {string} value - The string to encode.
511
- * @param {QrCodeOptions} [options] - The QR code options.
877
+ * Uses the Fisher-Yates (Knuth) shuffle for unbiased randomization,
878
+ * guaranteeing every permutation has equal probability.
512
879
  *
513
- * @returns {Promise<string>} - A promise that resolves with the QR code data URL.
880
+ * @param {unknown[]} value - The array to shuffle.
881
+ *
882
+ * @returns {unknown[]} - A new array with elements in random order.
514
883
  *
515
884
  * @example
516
- * <img [src]="'Hello, World!' | qrCode | async" />
885
+ * {{ [1, 2, 3, 4, 5] | shuffle }} // [3, 1, 5, 2, 4]
886
+ * {{ ['a', 'b', 'c'] | shuffle }} // ['c', 'a', 'b']
517
887
  *
518
- * @author Mofiro Jean
888
+ * @note Impure pipe — runs on every change detection cycle.
889
+ * Avoid using in performance-critical templates or bind the result
890
+ * to a signal/variable to control when it re-shuffles.
519
891
  */
520
- declare class QrCodePipe implements PipeTransform {
521
- transform(value: string, options?: QrCodeOptions): Promise<string>;
522
- static ɵfac: i0.ɵɵFactoryDeclaration<QrCodePipe, never>;
523
- static ɵpipe: i0.ɵɵPipeDeclaration<QrCodePipe, "qrCode", true>;
892
+ declare class ShufflePipe implements PipeTransform {
893
+ transform(value: unknown[]): unknown[];
894
+ static ɵfac: i0.ɵɵFactoryDeclaration<ShufflePipe, never>;
895
+ static ɵpipe: i0.ɵɵPipeDeclaration<ShufflePipe, "shuffle", true>;
524
896
  }
525
897
 
526
898
  /**
527
- * ReplacePipe: A custom Angular pipe that either highlights or replaces text based on a pattern.
528
- *
529
- * - If `isReplace` is `false`, it highlights occurrences of the pattern (if `highlightClass` is provided).
530
- * - If `isReplace` is `true`, it replaces occurrences of the pattern with the replacement string, optionally highlighting the replacement.
899
+ * TailPipe: Returns all elements except the first n.
531
900
  *
532
- * @param {string} value - The input string to transform.
533
- * @param {string | RegExp} pattern - The pattern to match (string or RegExp). If an empty string, the value is returned as-is.
534
- * @param {string} replacement - The string to replace matches with.
535
- * @param {string} [highlightClass] - Optional CSS class for highlighting matched or replaced text (e.g., 'highlight').
536
- * @param {boolean} [isReplace=true] - Whether to perform replacement (true) or only highlight matches (false).
901
+ * @param {unknown[]} value - The array to slice.
902
+ * @param {number} [n=1] - Number of elements to exclude from the start.
537
903
  *
538
- * @returns {string | SafeHtml} - Returns the transformed string or SafeHtml with highlights.
904
+ * @returns {unknown[]} - A new array without the first n elements.
539
905
  *
540
906
  * @example
541
- * {{ 'Hello World' | replace:'World':'Universe' }}
542
- * // Output: Hello Universe
543
- *
544
- * {{ 'test123' | replace:/\d+/g:'X':'highlight' }}
545
- * // Output: test<span class="highlight">X</span>
907
+ * {{ [1, 2, 3, 4, 5] | tail }} // [2, 3, 4, 5]
908
+ * {{ [1, 2, 3, 4, 5] | tail:2 }} // [3, 4, 5]
909
+ * {{ ['a', 'b', 'c'] | tail }} // ['b', 'c']
910
+ */
911
+ declare class TailPipe implements PipeTransform {
912
+ transform(value: unknown[], n?: number): unknown[];
913
+ static ɵfac: i0.ɵɵFactoryDeclaration<TailPipe, never>;
914
+ static ɵpipe: i0.ɵɵPipeDeclaration<TailPipe, "tail", true>;
915
+ }
916
+
917
+ /**
918
+ * TruthifyPipe: Removes all falsy values from an array.
546
919
  *
547
- * {{ 'Angular is great' | replace:'great':'awesome':'highlight':true }}
548
- * // Output: Angular is <span class="highlight">awesome</span>
920
+ * Falsy values: false, 0, -0, '', null, undefined, NaN
549
921
  *
550
- * {{ 'Angular is great' | replace:'great':'awesome':'highlight':false }}
551
- * // Output: Angular is <span class="highlight">great</span>
922
+ * @param {unknown[]} value - The array to filter.
552
923
  *
553
- * <div [innerHTML]="'Angular is great' | replace:'great':'awesome':'highlight':false"></div>
554
- * // Renders: Angular is <span class="highlight">great</span>
924
+ * @returns {unknown[]} - A new array with only truthy values.
555
925
  *
556
- * @author Mofiro Jean
926
+ * @example
927
+ * {{ [0, 1, '', 'hello', null, true] | truthify }} // [1, 'hello', true]
928
+ * {{ ['', 'a', '', 'b'] | truthify }} // ['a', 'b']
557
929
  */
558
- declare class ReplacePipe implements PipeTransform {
559
- private sanitizer;
560
- transform(value: string, pattern: string | RegExp, replacement: string, highlightClass?: string, isReplace?: boolean): string | SafeHtml;
561
- static ɵfac: i0.ɵɵFactoryDeclaration<ReplacePipe, never>;
562
- static ɵpipe: i0.ɵɵPipeDeclaration<ReplacePipe, "replace", true>;
930
+ declare class TruthifyPipe implements PipeTransform {
931
+ transform(value: unknown[]): unknown[];
932
+ static ɵfac: i0.ɵɵFactoryDeclaration<TruthifyPipe, never>;
933
+ static ɵpipe: i0.ɵɵPipeDeclaration<TruthifyPipe, "truthify", true>;
563
934
  }
564
935
 
565
936
  /**
566
- * ReversePipe: Reverses the characters in a string.
937
+ * UniquePipe: Removes duplicate values from an array.
567
938
  *
568
- * @param {string} value - The string to reverse.
939
+ * Supports primitives, objects by property key, and deep nested keys via dot notation.
569
940
  *
570
- * @returns {string} - The reversed string (e.g., 'hello' → 'olleh').
941
+ * @param {unknown[]} value - The array to deduplicate.
942
+ * @param {string} [key] - Optional property path to compare objects by (e.g., 'id', 'user.email').
571
943
  *
572
- * @example
573
- * {{ 'hello' | reverse }} // Outputs: 'olleh'
574
- * {{ '12345' | reverse }} // Outputs: '54321'
575
- * <p>{{ userInput | reverse }}</p>
944
+ * @returns {unknown[]} - A new array with duplicates removed, preserving first occurrence.
576
945
  *
577
- * @author Mofiro Jean
946
+ * @example
947
+ * {{ [1, 2, 2, 3] | unique }} // [1, 2, 3]
948
+ * {{ users | unique:'email' }} // unique by email
949
+ * {{ orders | unique:'customer.email' }} // unique by nested property
578
950
  */
579
- declare class ReversePipe implements PipeTransform {
580
- transform(value: string): string;
581
- static ɵfac: i0.ɵɵFactoryDeclaration<ReversePipe, never>;
582
- static ɵpipe: i0.ɵɵPipeDeclaration<ReversePipe, "reverse", true>;
951
+ declare class UniquePipe implements PipeTransform {
952
+ transform(value: unknown[], key?: string): unknown[];
953
+ private getNestedValue;
954
+ static ɵfac: i0.ɵɵFactoryDeclaration<UniquePipe, never>;
955
+ static ɵpipe: i0.ɵɵPipeDeclaration<UniquePipe, "unique", true>;
583
956
  }
584
957
 
585
958
  /**
586
- * SnakeCasePipe: Converts text to snake_case (e.g., "hello world" → "hello_world").
959
+ * WithoutPipe: Excludes specified elements from an array.
587
960
  *
588
- * @param {string} value - The input string to transform.
589
- * @returns {string} The string in snake_case, or an empty string if input is invalid.
961
+ * Supports primitives and objects by property key with dot notation.
590
962
  *
591
- * @example
592
- * ```html
593
- * {{ 'hello world' | snakeCase }} <!-- Outputs: hello_world -->
594
- * ```
963
+ * @param {unknown[]} value - The array to filter.
964
+ * @param {unknown[]} excludes - Values to exclude.
965
+ * @param {string} [key] - Optional property path for object comparison (supports dot notation).
595
966
  *
596
- * @author Mofiro Jean
967
+ * @returns {unknown[]} - A new array without the excluded elements.
968
+ *
969
+ * @example
970
+ * {{ [1, 2, 3, 4, 5] | without:[2, 4] }} // [1, 3, 5]
971
+ * {{ users | without:['banned']:'status' }} // active users
972
+ * {{ orders | without:['cancelled']:'meta.status' }} // non-cancelled orders
597
973
  */
598
- declare class SnakeCasePipe implements PipeTransform {
599
- transform(value: string): string;
600
- static ɵfac: i0.ɵɵFactoryDeclaration<SnakeCasePipe, never>;
601
- static ɵpipe: i0.ɵɵPipeDeclaration<SnakeCasePipe, "snakeCase", true>;
974
+ declare class WithoutPipe implements PipeTransform {
975
+ transform(value: unknown[], excludes: unknown[], key?: string): unknown[];
976
+ private getNestedValue;
977
+ static ɵfac: i0.ɵɵFactoryDeclaration<WithoutPipe, never>;
978
+ static ɵpipe: i0.ɵɵPipeDeclaration<WithoutPipe, "without", true>;
602
979
  }
603
980
 
604
981
  /**
605
- * TextToSpeechPipe: Converts text to speech using the Web Speech API.
982
+ * SomePipe: Checks if at least one element in an array satisfies a condition.
606
983
  *
607
- * @param {string} value - The text to convert to speech.
608
- * @param {string} [lang='en-US'] - The language (local) for speech synthesis.
984
+ * Supports primitives (equality check) and objects by property key with dot notation.
609
985
  *
610
- * @returns {void} - Triggers speech synthesis (no return value).
986
+ * @param {unknown[]} value - The array to check.
987
+ * @param {unknown} match - The value to match against.
988
+ * @param {string} [key] - Optional property path to check (supports dot notation).
611
989
  *
612
- * @example
613
- * <div>{{ Hello World' | textToSpeech }}</div>
614
- * <div>{{ 'Bonjour' | textToSpeech:'fr-FR' }}h</div>
990
+ * @returns {boolean} - True if at least one element matches, false otherwise.
615
991
  *
616
- * @author Mofiro Jean
992
+ * @example
993
+ * {{ [false, false, true] | some:true }} // true
994
+ * {{ users | some:'admin':'role' }} // any admins?
995
+ * {{ orders | some:'failed':'meta.status' }} // any failures?
617
996
  */
618
- declare class TextToSpeechPipe implements PipeTransform {
619
- transform(value: string, lang?: string): void;
620
- static ɵfac: i0.ɵɵFactoryDeclaration<TextToSpeechPipe, never>;
621
- static ɵpipe: i0.ɵɵPipeDeclaration<TextToSpeechPipe, "textToSpeech", true>;
997
+ declare class SomePipe implements PipeTransform {
998
+ transform(value: unknown[], match: unknown, key?: string): boolean;
999
+ private getNestedValue;
1000
+ static ɵfac: i0.ɵɵFactoryDeclaration<SomePipe, never>;
1001
+ static ɵpipe: i0.ɵɵPipeDeclaration<SomePipe, "some", true>;
622
1002
  }
623
1003
 
624
1004
  /**
625
- * TitleCasePipe: Capitalizes the first letter of each word in a string.
1005
+ * UnionPipe: Combines two arrays, keeping only unique elements.
626
1006
  *
627
- * @param {string} value - The input string to transform.
628
- * @returns {string} The string with each word capitalized, or an empty string if input is invalid.
1007
+ * Supports primitives and objects by property key with dot notation.
1008
+ *
1009
+ * @param {unknown[]} value - The first array.
1010
+ * @param {unknown[]} other - The second array.
1011
+ * @param {string} [key] - Optional property path for uniqueness check (supports dot notation).
1012
+ *
1013
+ * @returns {unknown[]} - A merged array with duplicates removed.
629
1014
  *
630
1015
  * @example
631
- * ```html
632
- * {{ 'hello world' | titleCase }} <!-- Outputs: Hello World -->
633
- * ```
1016
+ * {{ [1, 2, 3] | union:[3, 4, 5] }} // [1, 2, 3, 4, 5]
1017
+ * {{ admins | union:editors:'id' }} // all unique users
1018
+ * {{ local | union:remote:'meta.uuid' }} // merged records
634
1019
  */
635
- declare class TitleCasePipe implements PipeTransform {
636
- transform(value: string): string;
637
- static ɵfac: i0.ɵɵFactoryDeclaration<TitleCasePipe, never>;
638
- static ɵpipe: i0.ɵɵPipeDeclaration<TitleCasePipe, "titleCase", true>;
1020
+ declare class UnionPipe implements PipeTransform {
1021
+ transform(value: unknown[], other: unknown[], key?: string): unknown[];
1022
+ private getNestedValue;
1023
+ static ɵfac: i0.ɵɵFactoryDeclaration<UnionPipe, never>;
1024
+ static ɵpipe: i0.ɵɵPipeDeclaration<UnionPipe, "union", true>;
639
1025
  }
640
1026
 
641
1027
  /**
642
- * TruncatePipe: Truncates a string to a specified maximum length, optionally preserving words.
1028
+ * FilterByPipe: Filters an array by matching a search term against object
1029
+ properties.
643
1030
  *
644
- * This Angular pipe transforms a string input by truncating it to the given `maxLength`.
645
- * It provides options to customize the ellipsis and preserve word boundaries.
1031
+ * @param {unknown[]} value - The array to filter.
1032
+ * @param {string} search - The search term.
1033
+ * @param {string} [key] - Property to search in. If omitted, searches all string
1034
+ properties.
646
1035
  *
647
- * @param {string} value - The input string to be truncated.
648
- * @param {number} [maxLength=10] - The maximum length of the truncated string. Defaults to 10.
649
- * @param {string} [ellipsis='...'] - The string to append to the truncated portion. Defaults to '...'.
650
- * @param {boolean} [preserveWords=false] - If true, truncates at the last space before `maxLength` to avoid cutting words. Defaults to false.
651
- * @returns {string} - The truncated string. Returns an empty string if the input is null, undefined, or not a string.
1036
+ * @returns {unknown[]} - Filtered array with matching items.
652
1037
  *
653
1038
  * @example
654
- * {{ 'This is a long sentence' | truncate }} // Returns 'This is a...'
655
- * {{ 'This is a long sentence' | truncate: 20 }} // Returns 'This is a long sente...'
656
- * {{ 'This is a long sentence' | truncate: 15: ' [more]' }} // Returns 'This is a long [more]'
657
- * {{ 'This is a long sentence' | truncate: 15: '...' : true }} // Returns 'This is a...'
658
- * {{ 'This is a long sentence' | truncate: 20: '...' : true }} // Returns 'This is a long...'
659
- * {{ null | truncate }} // Returns ''
660
- * {{ undefined | truncate }} // Returns ''
661
- *
662
- * @author Mofiro Jean
1039
+ * {{ users | filterBy:'alice':'name' }} // users with 'alice' in name
1040
+ * {{ users | filterBy:'admin':'role' }} // users with role 'admin'
1041
+ * {{ users | filterBy:'bob' }} // search all properties for 'bob'
663
1042
  */
664
- declare class TruncatePipe implements PipeTransform {
665
- transform(value: string, maxLength?: number, ellipsis?: string, preserveWords?: boolean): string;
666
- static ɵfac: i0.ɵɵFactoryDeclaration<TruncatePipe, never>;
667
- static ɵpipe: i0.ɵɵPipeDeclaration<TruncatePipe, "truncate", true>;
1043
+ declare class FilterByPipe implements PipeTransform {
1044
+ transform(value: unknown[], search: string, key?: string): unknown[];
1045
+ private searchObject;
1046
+ private getNestedValue;
1047
+ static ɵfac: i0.ɵɵFactoryDeclaration<FilterByPipe, never>;
1048
+ static ɵpipe: i0.ɵɵPipeDeclaration<FilterByPipe, "filterBy", true>;
668
1049
  }
669
1050
 
670
1051
  declare const ALL_PIPES: Provider[];
671
1052
 
672
- export { ALL_PIPES, AsciiArtPipe, BarcodePipe, CamelCasePipe, ColorConvertPipe, CountPipe, CreditCardMaskPipe, DeviceTypePipe, EmailMaskPipe, GravatarPipe, HighlightPipe, HtmlEscapePipe, HtmlSanitizePipe, InitialsPipe, IpAddressMaskPipe, JsonPrettyPipe, KebabCasePipe, MorseCodePipe, QrCodePipe, ReplacePipe, ReversePipe, SnakeCasePipe, TextToSpeechPipe, TitleCasePipe, TruncatePipe };
1053
+ export { ALL_PIPES, AsciiArtPipe, BarcodePipe, CamelCasePipe, ChunkPipe, ColorConvertPipe, CountPipe, CreditCardMaskPipe, DeviceTypePipe, DiffPipe, EmailMaskPipe, EveryPipe, FilterByPipe, Flatten, GravatarPipe, GroupByPipe, HighlightPipe, HtmlEscapePipe, HtmlSanitizePipe, InitialPipe, InitialsPipe, IntersectionPipe, IpAddressMaskPipe, JsonPrettyPipe, KebabCasePipe, MorseCodePipe, OrderByPipe, PluckPipe, QrCodePipe, RangePipe, ReplacePipe, ReversePipe, SamplePipe, ShufflePipe, SnakeCasePipe, SomePipe, TailPipe, TextToSpeechPipe, TimeAgoPipePipe, TitleCasePipe, TruncatePipe, TruthifyPipe, UnionPipe, UniquePipe, WithoutPipe };
673
1054
  export type { AsciiArtOptions, BarcodeElementType, BarcodeFormat, BarcodeOptions, ColorTargetType, DeviceType, QrCodeOptions };