import { StateOptions } from '../../core'; /** * Decorator that subscribes to the application name from the {@link ApplicationRepository}. * * This decorator automatically updates the decorated property whenever the application * name 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 application name * * @remarks * Subscribes to: {@link ApplicationRepository} * * Updates: The decorated property with the application name (`string`) * * Lifecycle: Automatically subscribes in `connectedCallback` and * unsubscribes in `disconnectedCallback` of the component. * * @example Subscribe to the application name * ```ts * import { State } from '@stencil/core'; * import { SelectApplicationName } from '@limetech/lime-web-components'; * * class MyComponent { * @State() * @SelectApplicationName() * private appName: string; * } * ``` * * @example Transform the application name * ```ts * import { State } from '@stencil/core'; * import { SelectApplicationName } from '@limetech/lime-web-components'; * * class MyComponent { * @State() * @SelectApplicationName({ * map: [(name) => name?.toUpperCase()], * }) * private appNameUppercase: string; * } * ``` * * @example Only update when the name is defined * ```ts * import { State } from '@stencil/core'; * import { SelectApplicationName } from '@limetech/lime-web-components'; * * class MyComponent { * @State() * @SelectApplicationName({ * filter: [(name) => name !== null && name !== undefined], * }) * private validAppName: string; * } * ``` * * @example Combine map and filter * ```ts * import { State } from '@stencil/core'; * import { SelectApplicationName } from '@limetech/lime-web-components'; * * class MyComponent { * @State() * @SelectApplicationName({ * map: [(name) => name?.toLowerCase(), (name) => `${name} CRM`], * filter: [(brandedName) => brandedName.length > 4], * }) * private brandedName: string; * } * ``` * * @public * @group Application */ export declare function SelectApplicationName(options?: StateOptions): PropertyDecorator;