##// END OF EJS Templates
Added tag v1.0.0-rc8 for changeset 8f4d5e2c719a
Added tag v1.0.0-rc8 for changeset 8f4d5e2c719a

File last commit:

r2:8ec37bf1b4d1 default
r20:10be5c661c79 default
Show More
place.d.ts
55 lines | 1.9 KiB | video/mp2t | TypeScriptLexer
declare namespace place {
interface PlacePosition {
x: number;
y: number;
}
interface PlaceWidthHeight {
w: number;
h: number;
}
interface PlaceRectangle extends PlacePosition, PlaceWidthHeight { }
type PlaceCorner = 'BL' | 'TR' | 'BR' | 'TL';
type PlacePositions = 'before' | 'after' | 'before-centered' | 'after-centered' | 'above-centered' | 'above' | 'above-alt' | 'below-centered' | 'below' | 'below-alt';
interface PlaceChoice {
corner: PlaceCorner;
pos: PlacePosition;
aroundCorner?: PlaceCorner;
}
interface PlaceLocation extends PlaceRectangle {
corner: PlaceCorner;
aroundCorner: PlaceCorner;
overflow: number;
spaceAvailable: PlaceWidthHeight;
}
interface LayoutNodeFunction {
(node: HTMLElement, aroundCorner: string, corner: string, spaceAvailable: PlaceWidthHeight, aroundNodeCoords: PlaceWidthHeight): number;
}
interface Place {
/**
* Positions node kitty-corner to the rectangle centered at (pos.x, pos.y) with width and height of
* padding.x * 2 and padding.y * 2, or zero if padding not specified. Picks first corner in corners[]
* where node is fully visible, or the corner where it's most visible.
*
* Node is assumed to be absolutely or relatively positioned.
*/
at(node: Element, pos?: PlacePosition, corners?: PlaceCorner[], padding?: PlacePosition, layoutNode?: LayoutNodeFunction): PlaceLocation;
/**
* Position node adjacent or kitty-corner to anchor
* such that it's fully visible in viewport.
*/
around(node: Element, anchor: Element | PlaceRectangle, positions: PlacePositions[], leftToRight?: boolean, layoutNode?: LayoutNodeFunction): PlaceLocation;
}
}
declare const place: place.Place;
export = place;