import { FeaturesService } from '../Features/FeaturesService'; import { Uuid } from '@standardnotes/domain-core'; import { ActionObserver, PermissionDialog, Environment, Platform, UIFeature, ComponentInterface, ComponentPreferencesEntry, SNNote, SNTag } from '@standardnotes/models'; import { ComponentArea, EditorFeatureDescription, IframeComponentFeatureDescription, ComponentFeatureDescription, ThemeFeatureDescription, NativeFeatureIdentifier } from '@standardnotes/features'; import { LoggerInterface } from '@standardnotes/utils'; import { AbstractService, ComponentManagerInterface, ComponentViewerInterface, DesktopManagerInterface, InternalEventBusInterface, AlertService, DeviceInterface, MutatorClientInterface, PreferenceServiceInterface, ComponentViewerItem, ItemManagerInterface, SyncServiceInterface } from '@standardnotes/services'; import { ComponentManagerEventData } from './ComponentManagerEventData'; import { ComponentManagerEvent } from './ComponentManagerEvent'; declare global { interface Window { /** IE Handlers */ attachEvent(event: string, listener: EventListener): boolean; detachEvent(event: string, listener: EventListener): void; } } /** * Responsible for orchestrating component functionality, including editors, themes, * and other components. The component manager primarily deals with iframes, and orchestrates * sending and receiving messages to and from frames via the postMessage API. */ export declare class ComponentManager extends AbstractService implements ComponentManagerInterface { private items; private mutator; private sync; private features; private preferences; protected alerts: AlertService; private environment; private platform; private device; private logger; protected internalEventBus: InternalEventBusInterface; private desktopManager?; private viewers; private permissionDialogUIHandler; private readonly runWithPermissionsUseCase; private nativeThemesAsBase64; constructor(items: ItemManagerInterface, mutator: MutatorClientInterface, sync: SyncServiceInterface, features: FeaturesService, preferences: PreferenceServiceInterface, alerts: AlertService, environment: Environment, platform: Platform, device: DeviceInterface, logger: LoggerInterface, internalEventBus: InternalEventBusInterface); deinit(): void; setPermissionDialogUIHandler(handler: (dialog: PermissionDialog) => void): void; thirdPartyComponentsForArea(area: ComponentArea): ComponentInterface[]; createComponentViewer(component: UIFeature, item: ComponentViewerItem, actionObserver?: ActionObserver): ComponentViewerInterface; destroyComponentViewer(viewer: ComponentViewerInterface): void; setDesktopManager(desktopManager: DesktopManagerInterface): void; private handleChangedComponents; private addSyncedComponentItemObserver; private updateMobileRegisteredComponentUrls; private registerMobileNativeComponentUrls; /** * Gets all the native themes' CSS and stores them as `data:text/css;base64,...` URLs. */ private fetchNativeThemesOnMobile; private registerDeprecatedEditorUrlsForAndroid; detectFocusChange: () => void; onWindowMessage: (event: MessageEvent) => void; private configureForDesktop; private postActiveThemesToAllViewers; urlForFeature(uiFeature: UIFeature): string | undefined; urlsForActiveThemes(): string[]; private findComponentViewer; findComponentWithPackageIdentifier(identifier: string): ComponentInterface | undefined; private componentViewerForSessionKey; toggleOtherNonLayerableThemes(uiFeature: UIFeature): void; toggleTheme(uiFeature: UIFeature, skipEntitlementCheck?: boolean): Promise; getActiveThemes(): UIFeature[]; getActiveThemesIdentifiers(): { features: NativeFeatureIdentifier[]; uuids: Uuid[]; }; toggleComponent(component: ComponentInterface): Promise; editorForNote(note: SNNote): UIFeature; getDefaultEditorIdentifier(currentTag?: SNTag): string; doesEditorChangeRequireAlert(from: UIFeature | undefined, to: UIFeature | undefined): boolean; showEditorChangeAlert(): Promise; setComponentPreferences(uiFeature: UIFeature, preferences: ComponentPreferencesEntry): Promise; getComponentPreferences(component: UIFeature): ComponentPreferencesEntry | undefined; addActiveTheme(theme: UIFeature): void; replaceActiveTheme(theme: UIFeature): void; removeActiveTheme(theme: UIFeature): void; isThemeActive(theme: UIFeature): boolean; addActiveComponent(component: ComponentInterface): Promise; removeActiveComponent(component: ComponentInterface): Promise; getActiveComponents(): ComponentInterface[]; isComponentActive(component: ComponentInterface): boolean; }