import { VNode } from 'snabbdom/vnode'; import { Token, Type } from './di'; import { Renderable, ConfiguredRenderable, RenderableArea } from './dom'; export declare enum XYDirection { X = 0, Y = 1 } export declare enum ContextType { NONE = 0, LOAD = 1, RESET = 2 } /** * Symbol that signifies that an XYItemContainer's ratio is unallocated. * @type {Symbol} */ export declare const UNALLOCATED: unique symbol; export declare type RenderableConstructorArg = Type | ConfiguredRenderable; export declare type RenderableArg = Type | ConfiguredRenderable | T; export declare type Patch = (oldVNode: VNode | Node, newVNode: VNode) => VNode; export interface ConfigureableType extends Type { configure?: (config: object) => ConfiguredRenderable; } export interface DropArea { item: RenderableDropTarget; area: RenderableArea; dragArea: RenderableArea; } export declare enum DragStatus { START = 0, STOP = 1, DRAGGING = 2 } export interface DragOptions { host: T; startX: number; startY: number; threshold?: number; } /** * An event interface that is emitted from a {@link Draggable}. * @export * @interface DragEvent * @template T The host object. */ export interface DragEvent { /** * The object being dragged. * @type {T} */ host: T; /** * The current delta x coordinates. * @type {number} */ x: number; /** * The current delta y coordinates. * @type {number} */ y: number; /** * The current page x offset. * @type {number} */ pageX: number; /** * The current page y offset. * @type {number} */ pageY: number; /** * The drag status. * @type {DragStatus} */ status: DragStatus; } export interface HighlightCoordinateArgs { pageX: number; pageY: number; dropArea: DropArea; dragArea: RenderableArea; } /** * An interface that signifies the renderable can handle drops. * @export * @interface DropTarget */ export interface DropTarget { /** * Handles an item being dropped on this Renderable. * @param {Renderable} item * @param {DropArea} dropArea * @param {DragEvent} event */ handleDrop(item: Renderable, dropArea: DropArea, event: DragEvent): void; /** * Calculates the highlight coordinates for the drop target. * @param {HighlightCoordinateArgs} args * @returns {RenderableArea} */ getHighlightCoordinates(args: HighlightCoordinateArgs): RenderableArea; /** * Invoked when the item is no longer a drop target. */ onDropHighlightExit(): void; } export interface RenderableDropTarget extends Renderable, DropTarget { } /** * Injection token for the Document API. * @type {Token} */ export declare const DocumentRef: Token; /** * Injection token for the root configuration used to create a {@link RootLayout} * @type {Token} */ export declare const RootConfigRef: Token; /** * Injection token for injecting the container renderable. * @type {Token} */ export declare const ContainerRef: Token>; /** * Injection token for injecting the renderables configuration. * @see {@link ConfiguredRenderable} * @type {Token} */ export declare const ConfigurationRef: Token; /** * Injection token for injecting an HTML element associated with the renderable. * @type {Token} */ export declare const ElementRef: Token; /** * Injection token for injecting the patch method generated by snabbdom. * This allows for custom modules to be added to snabbdom that are not enabled * by default. * @type {Token} */ export declare const PatchRef: Token; /** * Injection token for injecting the global window. */ export declare const WindowRef: Token<{ new (): Window; prototype: Window; }>;