import { ValuesType } from 'utility-types'; import { KeyValue } from '@antv/x6-common'; import { Registry } from '../registry'; export declare namespace Background { interface Options { color?: string; image?: string; position?: Background.BackgroundPosition<{ x: number; y: number; }>; size?: Background.BackgroundSize<{ width: number; height: number; }>; repeat?: Background.BackgroundRepeat; opacity?: number; } interface CommonOptions extends Omit { quality?: number; } type Definition = (img: HTMLImageElement, options: T) => HTMLCanvasElement; } export declare namespace Background { type Presets = (typeof Background)['presets']; type OptionsMap = { readonly [K in keyof Presets]-?: Parameters[1] & { repeat: K; }; }; type NativeNames = keyof Presets; type NativeItem = ValuesType; type ManaualItem = CommonOptions & KeyValue & { repeat: string; }; } export declare namespace Background { const presets: { [name: string]: Definition; }; const registry: Registry, { [name: string]: Definition; }, never>; } export declare namespace Background { type Globals = '-moz-initial' | 'inherit' | 'initial' | 'revert' | 'unset'; type BgPosition = TLength | 'bottom' | 'center' | 'left' | 'right' | 'top' | (string & {}); type BgSize = TLength | 'auto' | 'contain' | 'cover' | (string & {}); type RepeatStyle = 'no-repeat' | 'repeat' | 'repeat-x' | 'repeat-y' | 'round' | 'space' | (string & {}); export type BackgroundPosition = Globals | BgPosition | (string & {}); export type BackgroundSize = Globals | BgSize | (string & {}); export type BackgroundRepeat = Globals | RepeatStyle | (string & {}); export interface Padding { left: number; top: number; right: number; bottom: number; } export {}; }