Skip to content

Latest commit

 

History

History
184 lines (117 loc) · 6.23 KB

DockPoint.md

File metadata and controls

184 lines (117 loc) · 6.23 KB

Type Enforcer Ui

An extension of type-enforcer with UI related data types and enforcer functions

npm build coverage deps size vulnerabilities license


DockPoint

Allows the designation of a specific point relative to an object.


new DockPoint([value])

Param Type Default Description
[value] string "DockPoint.POINTS.TOP_CENTER" Anything from DockPoint.POINTS

Example

import { DockPoint } from 'type-enforcer-ui';


dockPoint.opposite ⇒ DockPoint     🔒 Read only

Get a new DockPoint with the opposite value.


dockPoint.oppositePrimary ⇒ string     🔒 Read only

Get the opposite of the current primary.

Returns: string - DockPoint.BASIC_POINTS.


dockPoint.oppositeSecondary ⇒ string     🔒 Read only

Get the opposite of the current secondary.

Returns: string - DockPoint.BASIC_POINTS.


dockPoint.has(value) ⇒ boolean

Determine either the primary or secondary is equivalent to a value.

Param Type Description
value string DockPoint.BASIC_POINTS.


dockPoint.swapHorizontal()

Set the left or right value to the opposite, whether it's the primary or secondary.


dockPoint.swapVertical()

Set the top or bottom value to the opposite, whether it's the primary or secondary.


dockPoint.isSame(dockPoint) ⇒ boolean

Determine if another DockPoint is equivalent to this one.

Param Type Description
dockPoint DockPoint, string A value to compare to this one.


dockPoint.toString() ⇒ string

Get the current value as a string.


dockPoint.primary([value]) ⇒ this | string

The primary value

Returns: this | string - DockPoint.BASIC_POINTS

Param Type Description
[value] string DockPoint.BASIC_POINTS


dockPoint.secondary([value]) ⇒ this | string

The secondary value

Returns: this | string - DockPoint.BASIC_POINTS

Param Type Description
[value] string DockPoint.BASIC_POINTS


dockPoint.value([value]) ⇒ this | string

The full value

Returns: this | string - DockPoint.POINTS

Param Type Description
[value] string DockPoint.POINTS


DockPoint.BASIC_POINTS : Enum


DockPoint.POINTS : Enum


DockPoint.isValid(value) ⇒ boolean

Determine if something is a valid dock point.

Param Type Description
value unknown S value to check.