import { PropType } from "vue"; import { BackgroundOptions, Grid, GridType, Size, TilingStrategy } from "@visuallyjs/browser-ui"; /** * Props for the background component. * @group Props */ export type BackgroundComponentProps = { options: BackgroundOptions; }; /** * Props for the grid background component. * @group Props */ export interface GridBackgroundComponentProps { /** * The grid to use. This is optional; if you do not supply one the background will attempt to read the grid definition from the Surface. If that is also not set then a default grid of 50x50 pixels will be used. */ grid?: Grid; /** * Whether or not to show a thick border around the entire background. Defaults to false. */ showBorder?: boolean; /** * The minimum width for the grid. The value you provided is divided by 2 and then the grid is guaranteed to always at least span the range of (-minWidth / 2) - (minWidth / 2). Defaults to 20 000. */ minWidth?: number; /** * The minimum height for the grid. The value you provided is divided by 2 and then the grid is guaranteed to always at least span the range of (-minHeight / 2) - (minHeight / 2). Defaults to 20 000. */ minHeight?: number; /** * Defaults to false. If true, the grid will also draw tick marks between the grid lines. */ showTickMarks?: boolean; /** * Number of tick marks to draw per cell. Defaults to 2. */ tickMarksPerCell?: number; /** * The maximum width for the grid. The value you provided is divided by 2 and then the grid is guaranteed to never exceed the range of (-maxWidth / 2) - (maxWidth / 2). maxWidth takes precedence over minWidth. */ maxWidth?: number; /** * The maximum height for the grid. The value you provided is divided by 2 and then the grid is guaranteed to never exceed the range of (-maxHeight / 2) - (maxHeight / 2). maxHeight takes precedence over minHeight. */ maxHeight?: number; /** * Defaults to true, and instructs the grid that if the grid has grown beyond any minimum value set in either axis, if the content bounds subsequently shrink in that axis below the minimum, the grid should shrink back to the minimum. If you set this to false the grid will never shrink back to its minimum values once they have been exceeded. */ autoShrink?: boolean; /** * Type of grid - lines or dots. Defaults to lines. */ gridType?: GridType; /** * The radius for dots representing grid positions (when gridType id GridTypes.dotted). Defaults to 2. */ dotRadius?: number; /** * The radius for dots representing grid tick marks (when gridType id GridTypes.dotted). Defaults to 1. */ tickDotRadius?: number; /** * Whether or not the background is initially visible. Defaults to true. */ visible?: boolean; } /** * Props for the image background component. * @group Props */ export interface ImageBackgroundComponentProps { /** * URL of the image to load */ url: string; } /** * Props for the tiled image background component * @group Props */ export interface TiledImageBackgroundComponentProps { /** * URL for the background. You can supply this, or you can supply a `urlGenerator` function instead. If you supply `url` and no `urlGenerator`, the url you supply is treated as a template for the url for any given tile, and is expected to contain `{z}`, `{x}` and `{y}` placeholders. The form of the URL can be anything you like as long as it has the placeholders for z, x and y. For instance: * * http://foo.com/{z}/{x}/{y} * https://bar.com?zoom={z}&x={x}&y={y} * * etc */ url?: string; /** * For tiled backgrounds, an optional function you can supply to generate the URL for a given tile. See `url` for * an explanation of the default syntax for urls when using a tiled background. * @param z zoom level * @param x x coordinate of tile * @param y y coordinate of tile */ urlGenerator?: (z: number, x: number, y: number) => string; /** * For tiled backgrounds, provides the width and height of tiles. Every tile is assumed to have these dimensions, * even if the tile has whitespace in it. Required. */ tileSize: Size; /** * Required. Indicates the width of the full image. */ width: number; /** * Required. Indicates the height of the full image. */ height: number; /** * Required. Indicates the maximum zoom level. Zoom starts at 0 - fully zoomed out - and * increases in integer values from there. Each successive zoom level is twice the zoom of the previous level, * meaning two times as many tiles in each direction. */ maxZoom: number; /** * Default is TilingStrategies.logarithmic. See notes for `TilingStrategies` enum. */ tiling?: TilingStrategy; /** * How long to wait after a pan before reloading tiles. */ panDebounceTimeout?: number; /** * How long to wait after a zoom before reloading tiles. */ zoomDebounceTimeout?: number; } /** * This is a headless component that adds a background to the surface/paper it resides in. */ export declare const BackgroundComponent: { setup(): { service: unknown; }; name: string; props: { options: { type: PropType; }; }; mounted: () => void; render: (_ctx: any) => any; }; /** * This is a headless component that adds a grid background to the surface/paper it resides in. */ export declare const GridBackgroundComponent: { setup(): { service: unknown; }; name: string; props: { grid: { type: PropType; }; showBorder: { type: BooleanConstructor; }; minWidth: { type: NumberConstructor; }; minHeight: { type: NumberConstructor; }; showTickMarks: { type: BooleanConstructor; }; tickMarksPerCell: { type: NumberConstructor; }; maxWidth: { type: NumberConstructor; }; maxHeight: { type: NumberConstructor; }; autoShrink: { type: BooleanConstructor; }; gridType: { type: PropType; }; dotRadius: { type: NumberConstructor; }; tickDotRadius: { type: NumberConstructor; }; visible: { type: BooleanConstructor; }; }; mounted: () => void; render: (_ctx: any) => any; }; /** * This is a headless component that adds an Image background to the surface/paper it resides in. */ export declare const ImageBackgroundComponent: { setup(): { service: unknown; }; name: string; props: { url: { type: StringConstructor; }; }; mounted: () => void; render: (_ctx: any) => any; }; /** * This is a headless component that adds a tiled background to the surface/paper it resides in. */ export declare const TiledImageBackgroundComponent: { setup(): { service: unknown; }; name: string; props: { url: { type: StringConstructor; }; urlGenerator: { type: FunctionConstructor; }; tileSize: { type: PropType; }; width: { type: NumberConstructor; }; height: { type: NumberConstructor; }; maxZoom: { type: NumberConstructor; }; tiling: { type: StringConstructor; }; panDebounceTimeout: { type: NumberConstructor; }; zoomDebounceTimeout: { type: NumberConstructor; }; }; mounted: () => void; render: (_ctx: any) => any; };