/** * 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 { DocumentDataModel } from '@univerjs/core'; import type { IRenderContext, IRenderModule } from '@univerjs/engine-render'; import type { IDocFitToWidthOptions, IUniverDocsUIConfig } from '../config/config'; import { Disposable, DocumentFlavor, IConfigService } from '@univerjs/core'; export interface ICalcDocFitToWidthScaleParams { availableWidth: number; baseWidth: number; options?: IDocFitToWidthOptions; } export interface IResolveDocFitBaseWidthParams { documentFlavor?: DocumentFlavor; documentStylePageWidth?: number; skeletonPageWidth?: number; } export declare function normalizeDocFitToWidthOptions(options?: IDocFitToWidthOptions): { mode: import("..").DocFitMode; target: import("..").DocFitTarget; paddingX: import("../config/config").DocFitPaddingX; minScale: number; maxScale?: number; align: import("..").DocFitAlign; }; export declare function resolveDocFitPaddingX(availableWidth: number, paddingX: IDocFitToWidthOptions['paddingX']): number; export declare function calcDocFitToWidthScale(params: ICalcDocFitToWidthScaleParams): number; export declare function resolveDocFitBaseWidth(params: IResolveDocFitBaseWidthParams): number; export declare function resolveDocViewScale(userZoomRatio: number, fitToWidthScale: number): number; export declare class DocViewScaleService extends Disposable implements IRenderModule { protected readonly _context: IRenderContext; private readonly _configService; constructor(_context: IRenderContext, _configService: IConfigService); getPluginConfig(): Partial; getOptions(): IDocFitToWidthOptions; getBaseWidth(): number; getAvailableWidth(): number; getUserZoomRatio(): number; getFitToWidthScale(): number; getViewScale(userZoomRatio?: number): number; private _resolveContainer; }