Skip to content

@jimka/typescript-ui / primitive / BorderLine

Class: BorderLine

Defined in: src/typescript/lib/primitive/BorderLine.ts:11

Represents a single side of a CSS border, holding its placement prefix, style, width, and color.

Extends

  • Object

Constructors

new BorderLine()

ts
new BorderLine(
   placement: string, 
   borderStyle?: BorderStyle, 
   width?: number, 
   color?: string): BorderLine

Defined in: src/typescript/lib/primitive/BorderLine.ts:24

Parameters

placement

string

The CSS property prefix for this side (e.g. "border-top").

borderStyle?

BorderStyle

Optional. The border style enum value. Defaults to BorderStyle.NONE.

width?

number

Optional. The border width in pixels. Defaults to 0.

color?

string

Optional. The border color string. Defaults to "black".

Returns

BorderLine

Overrides

ts
Object.constructor

Properties

constructor

ts
constructor: Function;

Defined in: node_modules/typescript/lib/lib.es5.d.ts:123

The initial value of Object.prototype.constructor is the standard built-in Object constructor.

Inherited from

ts
Object.constructor

Methods

applyOnCSSRule()

ts
applyOnCSSRule(rule: CSSStyleRule): void

Defined in: src/typescript/lib/primitive/BorderLine.ts:112

Writes this border side's width, style, and color properties onto the given CSS rule.

Parameters

rule

CSSStyleRule

The CSSStyleRule to apply the border properties to.

Returns

void

Remarks

Sets three separate CSS properties using the placement prefix: <placement>-width, <placement>-style, and <placement>-color. Thin wrapper over BorderLine.toStyle retained for callers that hold a pseudo-class rule (e.g. Button's :active rule).


getColor()

ts
getColor(): string

Defined in: src/typescript/lib/primitive/BorderLine.ts:74

Returns the border color string.

Returns

string

The color value as a CSS color string.


getPlacement()

ts
getPlacement(): string

Defined in: src/typescript/lib/primitive/BorderLine.ts:38

Returns the CSS property prefix for this side (e.g. "border-top").

Returns

string

The placement string passed at construction time.


getStyle()

ts
getStyle(): BorderStyle

Defined in: src/typescript/lib/primitive/BorderLine.ts:47

Returns the border style enum value.

Returns

BorderStyle

The BorderStyle enum member for this border side.


getStyleString()

ts
getStyleString(): string

Defined in: src/typescript/lib/primitive/BorderLine.ts:56

Returns the border style as a lowercase CSS string (e.g. "solid").

Returns

string

The lowercased name of the BorderStyle enum member.


getWidth()

ts
getWidth(): number

Defined in: src/typescript/lib/primitive/BorderLine.ts:65

Returns the border width in pixels.

Returns

number

The width value in pixels.


hasOwnProperty()

ts
hasOwnProperty(v: PropertyKey): boolean

Defined in: node_modules/typescript/lib/lib.es5.d.ts:138

Determines whether an object has a property with the specified name.

Parameters

v

PropertyKey

A property name.

Returns

boolean

Inherited from

ts
Object.hasOwnProperty

isPrototypeOf()

ts
isPrototypeOf(v: Object): boolean

Defined in: node_modules/typescript/lib/lib.es5.d.ts:144

Determines whether an object exists in another object's prototype chain.

Parameters

v

Object

Another object whose prototype chain is to be checked.

Returns

boolean

Inherited from

ts
Object.isPrototypeOf

propertyIsEnumerable()

ts
propertyIsEnumerable(v: PropertyKey): boolean

Defined in: node_modules/typescript/lib/lib.es5.d.ts:150

Determines whether a specified property is enumerable.

Parameters

v

PropertyKey

A property name.

Returns

boolean

Inherited from

ts
Object.propertyIsEnumerable

render()

ts
render(): string

Defined in: src/typescript/lib/primitive/BorderLine.ts:98

Returns the border as a CSS shorthand string (e.g. "1px solid black").

Returns

string

A CSS border shorthand value in "<width>px <style> <color>" format.


set()

ts
set(
   borderStyle: BorderStyle, 
   width: number, 
   color: string): this

Defined in: src/typescript/lib/primitive/BorderLine.ts:85

Sets the border style, width, and color.

Parameters

borderStyle

BorderStyle

The new BorderStyle enum value.

width

number

The new border width in pixels.

color

string

The new border color string.

Returns

this


toLocaleString()

ts
toLocaleString(): string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:129

Returns a date converted to a string using the current locale.

Returns

string

Inherited from

ts
Object.toLocaleString

toString()

ts
toString(): string

Defined in: node_modules/typescript/lib/lib.es5.d.ts:126

Returns a string representation of an object.

Returns

string

Inherited from

ts
Object.toString

toStyle()

ts
toStyle(): {}

Defined in: src/typescript/lib/primitive/BorderLine.ts:133

Returns this side's width / style / color as a Style map so callers can batch the writes through Component.setElementCSSRules rather than mutating a live CSSStyleRule.

Returns

ts
{}

A map of CSS property names to string values.


valueOf()

ts
valueOf(): Object

Defined in: node_modules/typescript/lib/lib.es5.d.ts:132

Returns the primitive value of the specified object.

Returns

Object

Inherited from

ts
Object.valueOf

assign()

Call Signature

ts
static assign<T, U>(target: T, source: U): T & U

Defined in: node_modules/typescript/lib/lib.es2015.core.d.ts:284

Copy the values of all of the enumerable own properties from one or more source objects to a target object. Returns the target object.

Type Parameters

T extends {}

U

Parameters
target

T

The target object to copy to.

source

U

The source object from which to copy properties.

Returns

T & U

Inherited from
ts
Object.assign

Call Signature

ts
static assign<T, U, V>(
   target: T, 
   source1: U, 
   source2: V): T & U & V

Defined in: node_modules/typescript/lib/lib.es2015.core.d.ts:293

Copy the values of all of the enumerable own properties from one or more source objects to a target object. Returns the target object.

Type Parameters

T extends {}

U

V

Parameters
target

T

The target object to copy to.

source1

U

The first source object from which to copy properties.

source2

V

The second source object from which to copy properties.

Returns

T & U & V

Inherited from
ts
Object.assign

Call Signature

ts
static assign<T, U, V, W>(
   target: T, 
   source1: U, 
   source2: V, 
   source3: W): T & U & V & W

Defined in: node_modules/typescript/lib/lib.es2015.core.d.ts:303

Copy the values of all of the enumerable own properties from one or more source objects to a target object. Returns the target object.

Type Parameters

T extends {}

U

V

W

Parameters
target

T

The target object to copy to.

source1

U

The first source object from which to copy properties.

source2

V

The second source object from which to copy properties.

source3

W

The third source object from which to copy properties.

Returns

T & U & V & W

Inherited from
ts
Object.assign

Call Signature

ts
static assign(target: object, ...sources: any[]): any

Defined in: node_modules/typescript/lib/lib.es2015.core.d.ts:311

Copy the values of all of the enumerable own properties from one or more source objects to a target object. Returns the target object.

Parameters
target

object

The target object to copy to.

sources

...any[]

One or more source objects from which to copy properties

Returns

any

Inherited from
ts
Object.assign

create()

Call Signature

ts
static create(o: null | object): any

Defined in: node_modules/typescript/lib/lib.es5.d.ts:186

Creates an object that has the specified prototype or that has null prototype.

Parameters
o

Object to use as a prototype. May be null.

null | object

Returns

any

Inherited from
ts
Object.create

Call Signature

ts
static create(o: null | object, properties: PropertyDescriptorMap & ThisType<any>): any

Defined in: node_modules/typescript/lib/lib.es5.d.ts:193

Creates an object that has the specified prototype, and that optionally contains specified properties.

Parameters
o

Object to use as a prototype. May be null

null | object

properties

PropertyDescriptorMap & ThisType<any>

JavaScript object that contains one or more property descriptors.

Returns

any

Inherited from
ts
Object.create

defineProperties()

ts
static defineProperties<T>(o: T, properties: PropertyDescriptorMap & ThisType<any>): T

Defined in: node_modules/typescript/lib/lib.es5.d.ts:208

Adds one or more properties to an object, and/or modifies attributes of existing properties.

Type Parameters

T

Parameters

o

T

Object on which to add or modify the properties. This can be a native JavaScript object or a DOM object.

properties

PropertyDescriptorMap & ThisType<any>

JavaScript object that contains one or more descriptor objects. Each descriptor object describes a data property or an accessor property.

Returns

T

Inherited from

ts
Object.defineProperties

defineProperty()

ts
static defineProperty<T>(
   o: T, 
   p: PropertyKey, 
   attributes: PropertyDescriptor & ThisType<any>): T

Defined in: node_modules/typescript/lib/lib.es5.d.ts:201

Adds a property to an object, or modifies attributes of an existing property.

Type Parameters

T

Parameters

o

T

Object on which to add or modify the property. This can be a native JavaScript object (that is, a user-defined object or a built in object) or a DOM object.

p

PropertyKey

The property name.

attributes

PropertyDescriptor & ThisType<any>

Descriptor for the property. It can be for a data property or an accessor property.

Returns

T

Inherited from

ts
Object.defineProperty

entries()

Call Signature

ts
static entries<T>(o: {} | ArrayLike<T>): [string, T][]

Defined in: node_modules/typescript/lib/lib.es2017.object.d.ts:34

Returns an array of key/values of the enumerable own properties of an object

Type Parameters

T

Parameters
o

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

{} | ArrayLike<T>

Returns

[string, T][]

Inherited from
ts
Object.entries

Call Signature

ts
static entries(o: {}): [string, any][]

Defined in: node_modules/typescript/lib/lib.es2017.object.d.ts:40

Returns an array of key/values of the enumerable own properties of an object

Parameters
o

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns

[string, any][]

Inherited from
ts
Object.entries

freeze()

Call Signature

ts
static freeze<T>(f: T): T

Defined in: node_modules/typescript/lib/lib.es5.d.ts:220

Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

Type Parameters

T extends Function

Parameters
f

T

Object on which to lock the attributes.

Returns

T

Inherited from
ts
Object.freeze

Call Signature

ts
static freeze<T, U>(o: T): Readonly<T>

Defined in: node_modules/typescript/lib/lib.es5.d.ts:226

Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

Type Parameters

T extends {}

U extends string | number | bigint | boolean | symbol

Parameters
o

T

Object on which to lock the attributes.

Returns

Readonly<T>

Inherited from
ts
Object.freeze

Call Signature

ts
static freeze<T>(o: T): Readonly<T>

Defined in: node_modules/typescript/lib/lib.es5.d.ts:232

Prevents the modification of existing property attributes and values, and prevents the addition of new properties.

Type Parameters

T

Parameters
o

T

Object on which to lock the attributes.

Returns

Readonly<T>

Inherited from
ts
Object.freeze

fromEntries()

Call Signature

ts
static fromEntries<T>(entries: Iterable<readonly [PropertyKey, T]>): {}

Defined in: node_modules/typescript/lib/lib.es2019.object.d.ts:24

Returns an object created by key-value entries for properties and methods

Type Parameters

T = any

Parameters
entries

Iterable<readonly [PropertyKey, T]>

An iterable object that contains key-value entries for properties and methods.

Returns
ts
{}
Inherited from
ts
Object.fromEntries

Call Signature

ts
static fromEntries(entries: Iterable<readonly any[]>): any

Defined in: node_modules/typescript/lib/lib.es2019.object.d.ts:30

Returns an object created by key-value entries for properties and methods

Parameters
entries

Iterable<readonly any[]>

An iterable object that contains key-value entries for properties and methods.

Returns

any

Inherited from
ts
Object.fromEntries

getOwnPropertyDescriptor()

ts
static getOwnPropertyDescriptor(o: any, p: PropertyKey): undefined | PropertyDescriptor

Defined in: node_modules/typescript/lib/lib.es5.d.ts:173

Gets the own property descriptor of the specified object. An own property descriptor is one that is defined directly on the object and is not inherited from the object's prototype.

Parameters

o

any

Object that contains the property.

p

PropertyKey

Name of the property.

Returns

undefined | PropertyDescriptor

Inherited from

ts
Object.getOwnPropertyDescriptor

getOwnPropertyDescriptors()

ts
static getOwnPropertyDescriptors<T>(o: T): { [P in string | number | symbol]: TypedPropertyDescriptor<T[P]> } & {}

Defined in: node_modules/typescript/lib/lib.es2017.object.d.ts:46

Returns an object containing all own property descriptors of an object

Type Parameters

T

Parameters

o

T

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns

{ [P in string | number | symbol]: TypedPropertyDescriptor<T[P]> } & {}

Inherited from

ts
Object.getOwnPropertyDescriptors

getOwnPropertyNames()

ts
static getOwnPropertyNames(o: any): string[]

Defined in: node_modules/typescript/lib/lib.es5.d.ts:180

Returns the names of the own properties of an object. The own properties of an object are those that are defined directly on that object, and are not inherited from the object's prototype. The properties of an object include both fields (objects) and functions.

Parameters

o

any

Object that contains the own properties.

Returns

string[]

Inherited from

ts
Object.getOwnPropertyNames

getOwnPropertySymbols()

ts
static getOwnPropertySymbols(o: any): symbol[]

Defined in: node_modules/typescript/lib/lib.es2015.core.d.ts:317

Returns an array of all symbol properties found directly on object o.

Parameters

o

any

Object to retrieve the symbols from.

Returns

symbol[]

Inherited from

ts
Object.getOwnPropertySymbols

getPrototypeOf()

ts
static getPrototypeOf(o: any): any

Defined in: node_modules/typescript/lib/lib.es5.d.ts:165

Returns the prototype of an object.

Parameters

o

any

The object that references the prototype.

Returns

any

Inherited from

ts
Object.getPrototypeOf

groupBy()

ts
static groupBy<K, T>(items: Iterable<T>, keySelector: (item: T, index: number) => K): Partial<Record<K, T[]>>

Defined in: node_modules/typescript/lib/lib.es2024.object.d.ts:23

Groups members of an iterable according to the return value of the passed callback.

Type Parameters

K extends PropertyKey

T

Parameters

items

Iterable<T>

An iterable.

keySelector

(item: T, index: number) => K

A callback which will be invoked for each item in items.

Returns

Partial<Record<K, T[]>>

Inherited from

ts
Object.groupBy

hasOwn()

ts
static hasOwn(o: object, v: PropertyKey): boolean

Defined in: node_modules/typescript/lib/lib.es2022.object.d.ts:23

Determines whether an object has a property with the specified name.

Parameters

o

object

An object.

v

PropertyKey

A property name.

Returns

boolean

Inherited from

ts
Object.hasOwn

is()

ts
static is(value1: any, value2: any): boolean

Defined in: node_modules/typescript/lib/lib.es2015.core.d.ts:330

Returns true if the values are the same value, false otherwise.

Parameters

value1

any

The first value.

value2

any

The second value.

Returns

boolean

Inherited from

ts
Object.is

isExtensible()

ts
static isExtensible(o: any): boolean

Defined in: node_modules/typescript/lib/lib.es5.d.ts:256

Returns a value that indicates whether new properties can be added to an object.

Parameters

o

any

Object to test.

Returns

boolean

Inherited from

ts
Object.isExtensible

isFrozen()

ts
static isFrozen(o: any): boolean

Defined in: node_modules/typescript/lib/lib.es5.d.ts:250

Returns true if existing property attributes and values cannot be modified in an object, and new properties cannot be added to the object.

Parameters

o

any

Object to test.

Returns

boolean

Inherited from

ts
Object.isFrozen

isSealed()

ts
static isSealed(o: any): boolean

Defined in: node_modules/typescript/lib/lib.es5.d.ts:244

Returns true if existing property attributes cannot be modified in an object and new properties cannot be added to the object.

Parameters

o

any

Object to test.

Returns

boolean

Inherited from

ts
Object.isSealed

keys()

Call Signature

ts
static keys(o: object): string[]

Defined in: node_modules/typescript/lib/lib.es5.d.ts:262

Returns the names of the enumerable string properties and methods of an object.

Parameters
o

object

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns

string[]

Inherited from
ts
Object.keys

Call Signature

ts
static keys(o: {}): string[]

Defined in: node_modules/typescript/lib/lib.es2015.core.d.ts:323

Returns the names of the enumerable string properties and methods of an object.

Parameters
o

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns

string[]

Inherited from
ts
Object.keys

preventExtensions()

ts
static preventExtensions<T>(o: T): T

Defined in: node_modules/typescript/lib/lib.es5.d.ts:238

Prevents the addition of new properties to an object.

Type Parameters

T

Parameters

o

T

Object to make non-extensible.

Returns

T

Inherited from

ts
Object.preventExtensions

seal()

ts
static seal<T>(o: T): T

Defined in: node_modules/typescript/lib/lib.es5.d.ts:214

Prevents the modification of attributes of existing properties, and prevents the addition of new properties.

Type Parameters

T

Parameters

o

T

Object on which to lock the attributes.

Returns

T

Inherited from

ts
Object.seal

setPrototypeOf()

ts
static setPrototypeOf(o: any, proto: null | object): any

Defined in: node_modules/typescript/lib/lib.es2015.core.d.ts:337

Sets the prototype of a specified object o to object proto or null. Returns the object o.

Parameters

o

any

The object to change its prototype.

proto

The value of the new prototype or null.

null | object

Returns

any

Inherited from

ts
Object.setPrototypeOf

values()

Call Signature

ts
static values<T>(o: {} | ArrayLike<T>): T[]

Defined in: node_modules/typescript/lib/lib.es2017.object.d.ts:22

Returns an array of values of the enumerable own properties of an object

Type Parameters

T

Parameters
o

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

{} | ArrayLike<T>

Returns

T[]

Inherited from
ts
Object.values

Call Signature

ts
static values(o: {}): any[]

Defined in: node_modules/typescript/lib/lib.es2017.object.d.ts:28

Returns an array of values of the enumerable own properties of an object

Parameters
o

Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.

Returns

any[]

Inherited from
ts
Object.values