import { StateOptions } from '../core'; /** * Config for the {@link SelectConfig} state decorator * @public * @group Config */ export interface SelectConfigOptions extends StateOptions { name?: string; } /** * Decorator that subscribes to configuration data from the {@link ConfigRepository}. * * This decorator automatically updates the decorated property whenever configuration * data changes in the platform. Returns an object with all configs where the config * key is used as the key. It's the recommended approach over manual subscriptions as * it handles subscription lifecycle automatically. * * @param options - Configuration including key filtering and state transformation via {@link SelectConfigOptions} * @returns A PropertyDecorator that sets up automatic subscription to config data * * @remarks * Subscribes to: {@link ConfigRepository} * * Updates: The decorated property with configuration data (object or specific value) * * Lifecycle: Automatically subscribes in `connectedCallback` and unsubscribes * in `disconnectedCallback` * * @example Get all configuration data * ```ts * import { State } from '@stencil/core'; * import { SelectConfig } from '@limetech/lime-web-components'; * * class MyConfigComponent { * // Every config the platform holds, keyed by config name * @State() * @SelectConfig({}) * private configs: Record; * } * ``` * * @example Get specific config value by name * ```ts * import { State } from '@stencil/core'; * import { SelectConfig } from '@limetech/lime-web-components'; * * class MyApiComponent { * // The name narrows the state to that one config, so map receives the config * // value itself and not the whole config object * @State() * @SelectConfig({ * name: 'apiEndpoint', * map: [(config) => config?.url || 'https://api.example.com'], * }) * private apiUrl: string; * } * ``` * * @public * @group Config */ export declare function SelectConfig(options: SelectConfigOptions): PropertyDecorator;