import PDFDict from 'src/core/objects/PDFDict' ; import PDFName from 'src/core/objects/PDFName' ; import PDFNumber from 'src/core/objects/PDFNumber' ; class BorderStyle { readonly dict : PDFDict ; static fromDict = ( dict ) : BorderStyle => new BorderStyle ( dict ) ; protected constructor ( dict ) { this . dict = dict ; } W ( ) { const W = this . dict . lookup ( PDFName . of ( 'W' ) ) ; if ( W instanceof PDFNumber ) return W ; return undefined ; } getWidth ( ) { return this . W ( ) ?. asNumber ( ) ?? 1 ; } setWidth ( width ) { const W = this . dict . context . obj ( width ) ; this . dict . set ( PDFName . of ( 'W' ) , W ) ; } } export default BorderStyle ;