PageWidth
Constructors
availablePerLine
Added in v1.0.0
Source
Signature
declare const availablePerLine: (lineWidth: number, ribbonFraction: number) => PageWidth;defaultPageWidth
Added in v1.0.0
Source
Signature
declare const defaultPageWidth: PageWidth;Signature
declare const unbounded: PageWidth;Model
AvailablePerLine interface
Added in v1.0.0
Source
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 | Unbounded;Represents 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 AvailablePerLine;isPageWidth
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 PageWidth;isUnbounded
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 Unbounded;Symbol
PageWidthTypeId
Added in v1.0.0
Source
Signature
declare const PageWidthTypeId: unique symbol;PageWidthTypeId type
Added in v1.0.0
Source
Signature
type PageWidthTypeId = typeof PageWidthTypeId;Utilities
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;
Represents a
PageWidthsetting that informs the layout algorithms to avoid exceeding the specified space per line.