import * as i0 from '@angular/core'; import { InjectionToken, TrackByFunction } from '@angular/core'; import { IsActiveMatchOptions } from '@angular/router'; import { Observable } from 'rxjs'; declare const RTL: InjectionToken; /** * Represents a claim object that can contain multiple claims. */ interface ClaimObject { all?: string[]; any?: string[]; } /** * Represents a claim that can be a string or an object containing claims. * This is useful for defining permissions or roles in a security context. * It allows for both simple string claims and more complex claims that can include multiple values. * For example: * - A simple claim: 'admin' * - A complex claim: { all: ['read', 'write']'] } * */ type ClaimLike = string | ClaimObject; /** * Represents a condition to check against a user. * It can be a ClaimLike or a boolean value. * - If it's a ClaimLike, it checks if the user has the specified claim(s). * - If it's true, it checks if there is a logged-in user. * - If it's false, it checks if there is no logged-in user. */ type UserCondition = ClaimLike | boolean; type Placement = 'start' | 'end' | 'top' | 'bottom'; type Alignment = 'start' | 'center' | 'end'; /** * Flips the placement direction. * @param placement The placement direction to flip. * @returns The flipped placement direction. */ declare function flipPlacement(placement: Placement): "start" | "end" | "top" | "bottom"; /** * Formats a string by replacing placeholders with the provided arguments. * @param str The string to format, containing placeholders in the form of {0}, {1}, etc. * @param args The values to replace the placeholders with. * @returns The formatted string. */ declare function formatString(str: string, ...args: any[]): string; /** Menu item */ interface MenuItemBase { type?: string; id?: any; show?: boolean; /** * @deprecated use 'user' instead */ claim?: ClaimLike; cssClass?: string; data?: any; user?: UserCondition; } interface NodeMenuItem extends MenuItemBase { type?: 'node'; disabled?: boolean; text?: string; icon?: string; expanded?: boolean; children?: MenuItem[]; parent?: MenuItem; routerLink?: string | string[]; routerLinkActiveOptions?: { exact: boolean; } | IsActiveMatchOptions; href?: string; target?: '_blank' | '_parent' | '_self' | '_top'; tag?: string; tagCssClass?: string | string[]; } interface HeaderMenuItem extends MenuItemBase { type: 'header'; disabled?: boolean; text?: string; icon?: string; tag?: string; tagCssClass?: string | string[]; } interface DividerMenuItem extends MenuItemBase { type: 'divider'; } type MenuItem = NodeMenuItem | HeaderMenuItem | DividerMenuItem; /** * Converts a value to an Observable. * If the value is already an Observable, it returns it directly. * If the value is a Promise, it converts it to an Observable. * If the value is neither, it wraps it in an Observable using `of`. * @param value The value to convert. * @returns An Observable that emits the value. */ declare function toObservable(value: T | Observable | Promise): Observable; /** * Creates an array of numbers within a specified range. * @param start The starting number of the range (inclusive). * @param end The ending number of the range (inclusive). * @returns An array of numbers within the specified range. */ declare function numberArray(start: number, end: number): number[]; /** * Deletes multiple entries from an array based on the provided indices. * @param array * @param indices * @private */ declare function deleteEntries(array: any[], indices: number[]): void; declare function getEnumValues(enumClass: Record): Array; /** * Type definition for an ID generator function. * @param item The item for which the ID is to be generated. * @returns A string representing the generated ID. */ type IdGenerator = (item: any) => string; /** * Type definition for an ID generator which can be a function or a string representing the property name to extract the ID from. */ type IdGeneratorLike = IdGenerator | string; /** * Creates a sequential ID generator function with an optional prefix. * This function generates unique IDs by incrementing a counter each time it is called. * @param prefix Optional prefix for the generated IDs. * @returns A function that generates sequential IDs with the given prefix. */ declare function sequentialIdGenerator(prefix?: string): IdGenerator; /** * Converts an IdGeneratorLike to an IdGenerator function. * @param v The ID generator to convert. * @returns An IdGenerator function. */ declare function IdGeneratorAttribute(v: IdGeneratorLike): IdGenerator; /** * CSS class type which can be a string, array of strings, set of strings, or an object with class names as keys. */ type CssClass = string | string[] | Set | { [klass: string]: any; } | null | undefined; /** * A function that takes an item and returns a CssClass. * @param item The item to get the CSS class for. * @returns The CSS class for the item. */ type CssClassGetter = (obj: any) => CssClass; /** * A type that represents a CSS class or a function that returns a CSS class. */ type CssClassLike = CssClass | CssClassGetter; /** * Converts a CssClassLike to a CssClassGetter function. * @param v The CssClassLike to convert. * @returns A function that returns the desired CSS class. */ declare function CssClassAttribute(v: CssClassLike): CssClassGetter; /** * Equality comparer function type. * @param a First value to compare. * @param b Second value to compare. * @returns true if a is considered equal to b else returns false */ type EqualityComparer = (a: any, b: any) => boolean; /** * Equality comparer like type. * can be a function or a string representing the property name to compare. */ type EqualityComparerLike = EqualityComparer | string; /** * Default equality comparer function. * @param a First value to compare. * @param b Second value to compare. * @returns true if a === b else returns false */ declare function defaultEqualityComparer(a: any, b: any): boolean; /** * Converts an EqualityComparerLike to an EqualityComparer function. * @param e The EqualityComparerLike to convert. * @returns The converted EqualityComparer. */ declare function equalityComparerAttribute(e: EqualityComparerLike): EqualityComparer; /** * Value writer function type. * @param a The input value * @returns The written value */ type ValueWriter = (a: any) => any; /** * Value writer can be a function or a string representing the property name to extract the value from. */ type ValueWriterLike = ValueWriter | string; /** * Default value writer function. * @param a The input value * @returns the input value (it does not transform it) */ declare function defaultValueWriter(a: any): any; /** * Converts a ValueWriterLike to a ValueWriterFunction. * @param v The value writer to convert. * @returns A ValueWriter function. */ declare function valueWriterAttribute(v: ValueWriterLike): ValueWriter; /** * A comparison function type that defines an ordering relation between two values. * @param a The first value to compare. * @param b The second value to compare. * @returns * - A negative number if `a` should come before `b` * - A positive number if `a` should come after `b` * - Zero if `a` and `b` are considered equal */ type Comparer = (a: any, b: any) => number; /** * Value comparer can be a function or a string representing the property name to compare. */ type ComparerLike = Comparer | string; /** * A simple comparer function. * @param a The first value to compare. * @param b The second value to compare. * @returns -1 if a < b, 1 if a > b, 0 if a === b */ declare function defaultComparer(a: any, b: any): number; /** * Converts a ComparerLike to a Comparer. * @param v The comparer to convert. * @returns A function that compares two values. */ declare function comparerAttribute(v: ComparerLike): Comparer; /** * Filter predicate function type. * @param item The item to test against the filter. * @param params Additional parameters to pass to the filter. * @returns True if the item matches the filter, false otherwise. */ type FilterPredicate = (item: any, ...params: any[]) => boolean; /** * Filter predicate can be a function or a string representing the property name to filter. */ type FilterPredicateLike = FilterPredicate | string; /** * No-op filter predicate that always returns true. * @param item The item to test against the filter. * @returns true */ declare const noopFilter: FilterPredicate; /** * A simple filter predicate that checks if the item's string representation includes the match string. * @param item The item to test against the filter. * @param match The string to match. * @returns True if the item matches the filter, false otherwise. */ declare const defaultFilter: FilterPredicate; /** * Converts a FilterPredicateLike to a FilterPredicate function. * If the input is a string, it creates a predicate that checks the property with that name. * @param v The FilterPredicateLike to convert. * @returns The corresponding FilterPredicate function. */ declare function filterPredicateAttribute(v: FilterPredicateLike): FilterPredicate; /** * An item tracker that can be either a TrackByFunction or a string property name. */ type TrackByLike = TrackByFunction | string; /** * A trackBy function that tracks items by their index. */ declare const trackByIndex: TrackByFunction; /** * A trackBy function that tracks items by the item itself. */ declare const trackByItem: TrackByFunction; /** * Converts a TrackByLike to a TrackByFunction. * @param v The item tracker to convert. * @returns A TrackByFunction. */ declare function TrackByAttribute(v: TrackByLike): TrackByFunction; /** * IfDirective is a structural directive that conditionally includes or excludes a template * based on the boolean value of the `show` input property. * */ declare class IfDirective { private readonly _templateRef; private _vcr; private _viewRef?; readonly show: i0.InputSignal; constructor(); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵdir: i0.ɵɵDirectiveDeclaration; } export { CssClassAttribute, IdGeneratorAttribute, IfDirective, RTL, TrackByAttribute, comparerAttribute, defaultComparer, defaultEqualityComparer, defaultFilter, defaultValueWriter, deleteEntries, equalityComparerAttribute, filterPredicateAttribute, flipPlacement, formatString, getEnumValues, noopFilter, numberArray, sequentialIdGenerator, toObservable, trackByIndex, trackByItem, valueWriterAttribute }; export type { Alignment, ClaimLike, ClaimObject, Comparer, ComparerLike, CssClass, CssClassGetter, CssClassLike, DividerMenuItem, EqualityComparer, EqualityComparerLike, FilterPredicate, FilterPredicateLike, HeaderMenuItem, IdGenerator, IdGeneratorLike, MenuItem, MenuItemBase, NodeMenuItem, Placement, TrackByLike, UserCondition, ValueWriter, ValueWriterLike };