import { StateOptions } from '../../core'; /** * Decorator that subscribes to the currently logged in user from the {@link ApplicationRepository}. * * This decorator automatically updates the decorated property whenever the current user * changes in the platform. It's the recommended approach over manual subscriptions as it * handles subscription lifecycle automatically. * * @param options - Configuration for state transformation and filtering via {@link StateOptions} * @returns A PropertyDecorator that sets up automatic subscription to the current user * * @remarks * Subscribes to: {@link ApplicationRepository} * * Updates: The decorated property with the {@link User} object * * Lifecycle: Automatically subscribes in `connectedCallback` and * unsubscribes in `disconnectedCallback` of the component. * * @example Subscribe to the current user * ```ts * import { State } from '@stencil/core'; * import { SelectCurrentUser, User } from '@limetech/lime-web-components'; * * class MyComponent { * @State() * @SelectCurrentUser() * private user: User; * } * ``` * * @example Extract the user's full name * ```ts * import { State } from '@stencil/core'; * import { SelectCurrentUser } from '@limetech/lime-web-components'; * * class MyComponent { * @State() * @SelectCurrentUser({ * map: [(user) => user?.fullname], * }) * private userName: string; * } * ``` * * @example Build initials with several map steps * ```ts * import { State } from '@stencil/core'; * import { SelectCurrentUser } from '@limetech/lime-web-components'; * * class MyComponent { * @State() * @SelectCurrentUser({ * map: [ * (user) => user?.fullname, * (name: string | undefined) => * name * ?.split(' ') * .map((part) => part[0]) * .join('') * .toUpperCase(), * ], * filter: [(initials) => initials !== undefined], * }) * private userInitials: string; * } * ``` * * @public * @group Application */ export declare function SelectCurrentUser(options?: StateOptions): PropertyDecorator;