import { StateOptions } from '../../core'; /** * Decorator that subscribes to the application session from the {@link ApplicationRepository}. * * This decorator automatically updates the decorated property whenever the session * changes in the platform. The session contains authentication and authorization * information. 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 session * * @remarks * Subscribes to: {@link ApplicationRepository} * * Updates: The decorated property with the {@link Session} object * * Lifecycle: Automatically subscribes in `connectedCallback` and * unsubscribes in `disconnectedCallback` of the component. * * @example Subscribe to the session * ```ts * import { State } from '@stencil/core'; * import { SelectSession, Session } from '@limetech/lime-web-components'; * * class MyComponent { * @State() * @SelectSession() * private session: Session; * } * ``` * * @example Extract a single session property * ```ts * import { State } from '@stencil/core'; * import { SelectSession } from '@limetech/lime-web-components'; * * class MyComponent { * @State() * @SelectSession({ * map: [(session) => session?.admin], * }) * private isAdmin: boolean; * } * ``` * * @example Only update for active sessions * ```ts * import { State } from '@stencil/core'; * import { SelectSession, Session } from '@limetech/lime-web-components'; * * class MyComponent { * @State() * @SelectSession({ * filter: [(session) => session !== null && session?.active === true], * }) * private activeSession: Session; * } * ``` * * @public * @group Application */ export declare function SelectSession(options?: StateOptions): PropertyDecorator;