UNPKG

@wordpress/editor

Version:
27 lines 1.24 kB
/** * Maps a device preview type to its corresponding viewport style state. Used * when Responsive editing is enabled so the device preview drives which * viewport block style edits are applied to. * * @type {Object} */ export declare const VIEWPORT_STATE_BY_DEVICE_TYPE: Object; /** * Gets the most appropriate device type based on the canvas width. * * @param {number|string|undefined} canvasWidth The canvas width. * @param {Object} viewportSettings Optional viewport breakpoint settings. * @return {string} The device type. */ export declare function getDeviceTypeByCanvasWidth(canvasWidth: number | string | undefined, viewportSettings: Object): string; /** * Gets the canvas width for a device preview. The preview is inset from its * breakpoint to avoid browser zoom rounding the iframe viewport outside the * intended media query. * * @param {string} deviceType The device type. * @param {Object} viewportSettings Optional viewport breakpoint settings. * @return {number|undefined} The device preview width in pixels. */ export declare function getCanvasWidthByDeviceType(deviceType: string, viewportSettings: Object): number | undefined; //# sourceMappingURL=device-type.d.ts.map