/** * Copyright 2023-present DreamNum Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import type { IDisposable, IDocumentData, IPosition, Nullable } from '@univerjs/core'; import type { Engine, IDocumentLayoutObject, RichText, Scene } from '@univerjs/engine-render'; import type { KeyCode } from '@univerjs/ui'; import type { Observable } from 'rxjs'; import { Disposable, IContextService } from '@univerjs/core'; import { IEditorService } from '@univerjs/docs-ui'; import { DeviceInputEventType, IRenderManagerService } from '@univerjs/engine-render'; import { Subject } from 'rxjs'; export declare enum SLIDE_VIEW_KEY { MAIN = "__SLIDERender__", SCENE_VIEWER = "__SLIDEViewer__", SCENE = "__SLIDEScene__", VIEWPORT = "__SLIDEViewPort_" } export declare const ISlideEditorBridgeService: import("@wendellhu/redi").IdentifierDecorator; export interface IEditorBridgeServiceParam { unitId: string; /** * pos and size of editing area */ position: IPosition; slideCardOffset: { left: number; top: number; }; documentLayoutObject: IDocumentLayoutObject; scaleX: number; scaleY: number; editorUnitId: string; } export interface IEditorBridgeServiceVisibleParam { visible: boolean; eventType: DeviceInputEventType; unitId: string; keycode?: KeyCode; } export interface ISetEditorInfo { scene: Scene; engine: Engine; unitId: string; pageId: string; richTextObj: RichText; } export interface ISlideEditorBridgeService { currentEditRectState$: Observable>; visible$: Observable; /** * @deprecated This is a temp solution only for demo purposes. We should have mutations to directly write * content to slides. */ endEditing$: Subject; dispose(): void; setEditorRect(param: ISetEditorInfo): void; getEditorRect(): ISetEditorInfo; getEditRectState(): Readonly>; changeVisible(param: IEditorBridgeServiceVisibleParam): void; changeEditorDirty(dirtyStatus: boolean): void; getEditorDirty(): boolean; isVisible(): boolean; getCurrentEditorId(): Nullable; } export declare class SlideEditorBridgeService extends Disposable implements ISlideEditorBridgeService, IDisposable { private readonly _editorService; private readonly _contextService; private readonly _renderManagerService; private _editorUnitId; private _isForceKeepVisible; private _editorIsDirty; private _currentEditRectState; private readonly _currentEditRectState$; readonly currentEditRectState$: Observable>; private _visibleParam; private readonly _visible$; readonly visible$: Observable; private readonly _afterVisible$; readonly afterVisible$: Observable; readonly endEditing$: Subject; private _currentEditRectInfo; constructor(_editorService: IEditorService, _contextService: IContextService, _renderManagerService: IRenderManagerService); dispose(): void; getEditorRect(): ISetEditorInfo; /** * 1st part of startEditing. * @editorInfo editorInfo */ setEditorRect(editorInfo: ISetEditorInfo): void; changeVisible(param: IEditorBridgeServiceVisibleParam): void; /** * get info from _currentEditRectInfo * * invoked by slide-editing.render-controller.ts@_handleEditorVisible * && this@setEditorRect */ getEditRectState(): Readonly>; changeEditorDirty(dirtyStatus: boolean): void; isVisible(): boolean; getEditorDirty(): boolean; getCurrentEditorId(): string; /** * @deprecated */ genDocData(target: RichText): IDocumentData; }