import { PropertyValues } from 'lit'; import { AppListType, AppType, AppTypeGuid, LinkType, UnknownAppType } from '../types/app.types'; import { WeavyTypeComponent } from './weavy-type-component'; import { WeavyAppComponentContextProps, WeavyAppComponentProps, WeavyComponentContextProps, WeavyComponentSettingProps, WeavyTypeComponentContextProps } from '../types/component.types'; export declare const UnknownApp: UnknownAppType; /** * Base class for exposed/public weavy components. This class provides common external properties and internal data provided as contexts for sub components. */ export declare class WeavyAppComponent extends WeavyTypeComponent implements WeavyAppComponentProps, WeavyComponentContextProps, WeavyTypeComponentContextProps, WeavyComponentSettingProps, WeavyAppComponentContextProps { #private; /** * The current app data. * * @type {AppType | undefined} */ app: AppType | undefined; /** * A list of data for all the apps specified by the `uid` property. * * @type {AppListType | undefined} */ apps: AppListType | undefined; /** * Sets the component to it's initial state and resets the app state. */ reset(): void; /** * Checks if an entity matches the component configuration. * * @internal * @param link - Entity to check for a match. * @returns True if the entity targets this component. */ matchesLink(link?: LinkType): boolean; /** * Any provided link that should be loaded, shown and highlighted. */ set link(link: LinkType | undefined); get link(): LinkType | undefined; /** * Any app type for the weavy component. * * @type {AppTypeGuid | UnknownAppType} */ protected appType?: AppTypeGuid | UnknownAppType; /** * Sets the uid property to a single uid with automatically appended user and agent name (where applicable). */ generateUid?: string | null; /** * One or multiple unique app identifiers or app id:s. When a single uid is provided, the app gets automatically created on the server upon first request. */ set uid(uid: string | number | null | undefined); get uid(): string | number | null | undefined; /** * An array of parsed uids from the `uid` property. * @readonly */ get uids(): (string | number)[]; /** * The currently selected app uid when multiple `uid` is provided. Defaults to the first uid from the `uid` property. */ currentUid: string | number | null | undefined; private _initialAppName?; private _appName?; /** * Optional display name for the app (used in notifications etc.) */ set name(name: string | undefined); get name(): string | undefined; /** * Optional directory identifier (`id` or `name`) for the app. */ directory?: string | number; private appSubscribeMutation; /** * Subscribes or unsubscribes to notification updates from the app. Check `.app.is_subscribed` to see current state. * * @param subscribe - Set to `false` to unsubscribe from updates. Defaults to `true`. * @returns {Promise} * * @example Toggle app subscription * ```js * // Wait for app data * await myWeavyComponent.whenApp(); * * // Get current app subscription state * const isSubscribed = myWeavyComponent.app.is_subscribed; * * // Toggle the app subscription state * myWeavyComponent.subscribe(!isSubscribed); * ``` */ subscribe(subscribe?: boolean): Promise; /** * Resolves when app data is available. * * @returns {Promise} */ whenApp(): Promise; /** * Resolves when multiple apps is available. * * @returns {Promise} */ whenApps(): Promise; /** * DEPRECATED: Use `.generateUid`property instead. * @internal * @deprecated */ autoUid?: string | null; connectedCallback(): void; protected willUpdate(changedProperties: PropertyValues): Promise; } //# sourceMappingURL=weavy-app-component.d.ts.map