import type { LayoutParams } from '../../common/layout' ; import { LayoutTypes } from '../../common' ; import type { Layout } from '.' ; import { CanvasLayout } from './canvas_layout' ; import { PreserveLayout } from './preserve_layout' ; import { PrintLayout } from './print_layout' ; export function createLayout ( { id , dimensions , selectors , ... config } ) { if ( dimensions && id === LayoutTypes . PRESERVE_LAYOUT ) { return new PreserveLayout ( dimensions , selectors ) ; } if ( dimensions && id === LayoutTypes . CANVAS ) { return new CanvasLayout ( dimensions ) ; } return new PrintLayout ( config ) ; }