Information about the current viewport
The useViewport hook is the recommend way to watch for viewport changes button, but you can also use it directly.
Press shift + S to search API reference.
Information about the current viewport
The useViewport hook is the recommend way to watch for viewport changes button, but you can also use it directly.
import {viewport} from '@airtable/blocks';
class Viewport extends Watchable<WatchableViewportKey>
readonly isFullscreen | boolean
| ||||||
readonly isSmallerThanMinSize | boolean
| ||||||
readonly maxFullscreenSize | ViewportSizeConstraint The maximum dimensions of the extension when it is in fullscreen mode. Returns the smallest set of dimensions added with addMaxFullscreenSize. If | ||||||
readonly minSize | ViewportSizeConstraint The minimum dimensions of the extension - if the viewport gets smaller than this size, an overlay will be shown asking the user to resize the extension to be bigger. The largest set of dimensions added with addMinSize. If | ||||||
readonly size | { The current size of the extension frame. Can be watched. | ||||||
addMaxFullscreenSize | function (sizeConstraint: Partial<ViewportSizeConstraint>) => UnsetFn
Add a maximum fullscreen size constraint. Use Returns a function that can be called to remove the fullscreen size constraint that was added. | ||||||
addMinSize | function (sizeConstraint: Partial<ViewportSizeConstraint>) => UnsetFn
Add a minimum frame size constraint. Use `.minSize`` to get the aggregate of all added constraints. Upon adding a constraint, if the extension is focused and the frame is smaller than the minimum size, the extension will enter fullscreen mode. Returns a function that can be called to remove the size constraint that was added. | ||||||
enterFullscreenIfPossible | function () => void Request to enter fullscreen mode. May fail if another extension is fullscreen or this extension doesn't have
permission to fullscreen itself. Watch | ||||||
exitFullscreen | function () => void Request to exit fullscreen mode | ||||||
unwatch | function (keys: WatchableViewportKey | ReadonlyArray<WatchableViewportKey>, callback: FlowAnyFunction, context?: FlowAnyObject | null) => Array<WatchableViewportKey>
Unwatch keys watched with Should be called with the same arguments given to Returns the array of keys that were unwatched | ||||||
watch | function (keys: WatchableViewportKey | ReadonlyArray<WatchableViewportKey>, callback: FlowAnyFunction, context?: FlowAnyObject | null) => Array<WatchableViewportKey>
Get notified of changes to the viewport. Watchable keys are:
Every call to Returns the array of keys that were watched. |