export { BrandColor, Color, ColorHelper, DesignTokenHelper, KirbyColor, NotificationColor, ThemeColor, ThemeColorDefinition, ThemeColorExtended, ThemeColorVariant, camelToKebabCase, capitalizeFirstLetter, kebabToCamelCase, kebabToTitleCase } from '@kirbydesign/core'; import { UnobserveFn, WindowRef } from '@kirbydesign/designsystem/types'; import * as i0 from '@angular/core'; import { Renderer2, ElementRef } from '@angular/core'; import { ChartConfiguration, ChartConfigurationCustomTypesPerDataset } from 'chart.js'; import { ControlValueAccessor } from '@angular/forms'; declare const elementHasAncestor: (element: HTMLElement, ancestorNodeName: string, stopNodeName?: string) => any; declare function getIonModalDialogAncestor(currentElement: HTMLElement): HTMLElement | undefined; /** * Creates a MutationObserver and observes content changes in a given element. * The provided callback is called when changes are detected. * * @returns function - an unobserve function that can be called to disconnect the created observer. */ declare function observeContent(observedElement: HTMLElement, contentChangedCallback: () => void): UnobserveFn; declare class PlatformService { private windowRef; constructor(windowRef: WindowRef); isTouch(): any; isPhabletOrBigger(): any; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare const chartConfigHasType: (config: ChartConfiguration | ChartConfigurationCustomTypesPerDataset) => config is ChartConfiguration; declare function deepCopy(tgt: Tp): Tp; /** * Performs a deep merge of objects and returns new object. Does not modify * objects (immutable). * It merges from into object to the left * eg. mergeDeep({a: 'will be overridden', b: 'some val'}, {a: 'new val'}) => {a: 'new val', b: 'some val'} * * @param originalObject object - Object to override, * @param overrideObject object - Object to override "toOverride" values with * @param config object - Configuration for how to merge. * mergeArrays determines if it should merge or override arrays * @returns object - New object with merged key/values */ declare function mergeDeep(originalObject: any, overrideObject: any, config?: { mergeArrays: boolean; }): any; declare function mergeDeepAll(...objects: object[]): object; declare class UniqueIdGenerator { private scope; private static registry; private id; private constructor(); static scopedTo(scope: string): UniqueIdGenerator; next(): string; } declare class StringSearchHelper { static getIndexByFirstMatchingStartString(searchString: string, words: string[], startIndex: number): number; static isPrintableCharacter(key: string): boolean; } declare class LineClampHelper { private renderer; constructor(renderer: Renderer2); setMaxLines(element: Element, maxLines: number): void; setLineHeight(element: Element, lineHeight: string): void; removeLineClamp(element: Element): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare namespace KirbyAnimation { enum Duration { QUICK, SHORT, LONG, EXTRA_LONG } const Easing: any; } declare class IonicElementPartHelper { private renderer; constructor(renderer: Renderer2); setPart(partName: string, ionicElementRef: ElementRef, selector: string): Promise; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } /** * Configuration for extending a ControlValueAccessor's `writeValue` method. * @typeParam T - The type of value being written */ interface WriteValueExtension { /** * Callback invoked after `writeValue` is called on each accessor. * @param value - The value being written */ afterWriteValue: (value: T) => void; } /** * Configuration for extending a ControlValueAccessor's `registerOnChange` method. * @typeParam TInput - The type of value received from the input * @typeParam TOutput - The type of value passed to the form control */ interface RegisterOnChangeExtension { /** * Transform the value before it's passed to the original onChange function. * @param value - The original value from the input event * @returns The transformed value to pass to the form control */ transformValue: (value: TInput) => TOutput; } /** * Configuration options for extending ControlValueAccessor methods. * @typeParam TWrite - The type of value for writeValue * @typeParam TChangeInput - The type of value received in registerOnChange * @typeParam TChangeOutput - The type of value output from registerOnChange */ interface ValueAccessorExtensionConfig { /** * Configuration for extending `writeValue`. * When provided, the `afterWriteValue` callback will be invoked after each accessor's * `writeValue` method is called. */ writeValue?: WriteValueExtension; /** * Configuration for extending `registerOnChange`. * When provided, the `transformValue` function will be used to transform values * before they're passed to the form control's onChange handler. */ registerOnChange?: RegisterOnChangeExtension; } /** * Extends the methods of provided ControlValueAccessors. * * This utility wraps the control value accessor methods to add custom behavior while preserving * the original functionality. Its used to: * - Emit kirbyChange when values are written programmatically * - Transform or normalize values before they're passed to form controls to work with inputmasking * * @param accessors - Array of ControlValueAccessors to extend, typically injected via `NG_VALUE_ACCESSOR` * @param config - Configuration specifying which methods to extend and how * * @example * // Simple usage - emit changes when writeValue is called * extendValueAccessors(this.valueAccessors, { * writeValue: { * afterWriteValue: (value) => this.kirbyChange.emit(value) * } * }); * * @example * // Advanced usage - transform values in registerOnChange * extendValueAccessors(this.valueAccessors, { * writeValue: { * afterWriteValue: (value) => this.updateDisplay(value) * }, * registerOnChange: { * transformValue: (value) => this.normalizeValue(value) * } * }); */ declare function extendValueAccessors(accessors: ControlValueAccessor[] | null | undefined, config: ValueAccessorExtensionConfig): void; export { IonicElementPartHelper, KirbyAnimation, LineClampHelper, PlatformService, StringSearchHelper, UniqueIdGenerator, chartConfigHasType, deepCopy, elementHasAncestor, extendValueAccessors, getIonModalDialogAncestor, mergeDeep, mergeDeepAll, observeContent }; export type { RegisterOnChangeExtension, ValueAccessorExtensionConfig, WriteValueExtension }; //# sourceMappingURL=kirbydesign-designsystem-helpers.d.ts.map