PageWidth
Constructors
availablePerLine
Added in v1.0.0
Source
Signature
declare const availablePerLine: (lineWidth: number, ribbonFraction: number) => PageWidthdefaultPageWidth
Added in v1.0.0
Source
Signature
declare const defaultPageWidth: PageWidthSignature
declare const unbounded: PageWidthModel
AvailablePerLine interface
Added in v1.0.0
Source
Represents a PageWidth setting that informs the layout algorithms to avoid
exceeding the specified space per line.
Signature
interface AvailablePerLine extends Proto { readonly _tag: "AvailablePerLine"; readonly lineWidth: number; readonly ribbonFraction: number;}Represents the maximum number of characters that fit onto a single line in a
document. The layout algorithms will try to avoid exceeding the set character
limit by inserting line breaks where appropriate (e.g., via softLine).
Signature
type PageWidth = AvailablePerLine | UnboundedRepresents a PageWidth setting that informs the layout algorithms to avoid
introducing line breaks into a document.
Signature
interface Unbounded extends Proto { readonly _tag: "Unbounded";}Other
Refinements
isAvailablePerLine
Added in v1.0.0
Source
Returns true if the specified PageWidth is an AvailablePerLine, false
otherwise.
Signature
declare const isAvailablePerLine: (self: PageWidth) => self is AvailablePerLineisPageWidth
Added in v1.0.0
Source
Returns true if the specified value is a PageWidth, false otherwise.
Signature
declare const isPageWidth: (u: unknown) => u is PageWidthisUnbounded
Added in v1.0.0
Source
Returns true if the specified PageWidth is an Unbounded, false
otherwise.
Signature
declare const isUnbounded: (self: PageWidth) => self is UnboundedSymbol
PageWidthTypeId
Added in v1.0.0
Source
Signature
declare const PageWidthTypeId: unique symbolPageWidthTypeId type
Added in v1.0.0
Source
Signature
type PageWidthTypeId = typeof PageWidthTypeIdUtilities
remainingWidth
Added in v1.0.0
Source
Calculates the remaining width on the current line.
Signature
declare const remainingWidth: (lineLength: number, ribbonFraction: number, lineIndent: number, currentColumn: number) => number