/** * 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 { IDocDrawingPosition, IDocumentData, LocaleService } from '@univerjs/core'; import type { IDocumentSkeletonCached, IDocumentSkeletonDrawing, IDocumentSkeletonHeaderFooter, IDocumentSkeletonPage } from '@univerjs/engine-render'; import { ObjectRelativeFromH, ObjectRelativeFromV, PositionedObjectLayoutType } from '@univerjs/core'; import { DocumentEditArea } from '@univerjs/engine-render'; export interface IDrawingAnchorInPage { skeDrawing: IDocumentSkeletonDrawing; page: IDocumentSkeletonPage | IDocumentSkeletonHeaderFooter; hostPage?: IDocumentSkeletonPage; pageMarginTop: number; pageMarginLeft: number; } export declare function findDrawingAnchor(unitId: string, drawingId: string, skeleton: IDocumentSkeletonCached, editArea: DocumentEditArea, currentDrawing?: IDocumentSkeletonDrawing['drawingOrigin']): IDrawingAnchorInPage | null; /** Resolve a text-relative origin before committing a wrapping reference change. */ export declare function resolveDrawingWrappingPosition(anchor: IDrawingAnchorInPage, position: IDocDrawingPosition, snapshot: IDocumentData, localeService: LocaleService, editArea: DocumentEditArea): IDocDrawingPosition | null; /** Preserve the rendered position when text wrapping or a positioning reference changes. */ export declare function getDrawingWrappingPosition(anchor: IDrawingAnchorInPage, layoutType: PositionedObjectLayoutType, relativeFromH?: ObjectRelativeFromH, relativeFromV?: ObjectRelativeFromV, offset?: { left: number; top: number; }): IDocDrawingPosition;