@atlaskit/editor-plugin-media
Version:
Media plugin for @atlaskit/editor-core
12 lines (11 loc) • 731 B
TypeScript
/**
* Computes the new mediaSingle display width that preserves the original display height
* when a media node is replaced with a file of a different aspect ratio, clamped to valid bounds.
*
* @param targetDisplayHeight - The display height to preserve (from the old image)
* @param newIntrinsicWidth - The new file's intrinsic pixel width
* @param newIntrinsicHeight - The new file's intrinsic pixel height
* @param layout - The mediaSingle layout (affects max width)
* @param lineLength - The editor content column width in pixels
*/
export declare const computeReplacementDisplayWidth: (targetDisplayHeight: number, newIntrinsicWidth: number, newIntrinsicHeight: number, layout: string, lineLength: number) => number;