← All packages

API reference

@searsuite/sear-domain-format

Portable cell-format values and formatting contracts.

15 exportsderived from source

interfaceExcelDatePartssource ↗
interface ExcelDateParts
propertyday
readonly day: number
propertymonth
readonly month: number
propertyphantomLeapDay
readonly phantomLeapDay?: boolean
propertyyear
readonly year: number
interfaceSpreadsheetErrorValuesource ↗
interface SpreadsheetErrorValue
propertycode
readonly code: string
propertykind
readonly kind: "error"
interfaceSpreadsheetFormatDisplaysource ↗
interface SpreadsheetFormatDisplay

Display metadata selected from one Excel number-format section.

propertycolor
readonly color?: string
propertyfillCharacter
readonly fillCharacter?: string
propertytext
readonly text: string
interfaceSpreadsheetFormatLocalesource ↗
interface SpreadsheetFormatLocale
propertydatePattern
readonly datePattern: string
propertydateTimePattern
readonly dateTimePattern: string
propertydecimalSeparator
readonly decimalSeparator?: string
propertygroupSeparator
readonly groupSeparator?: string
propertylocale
readonly locale: string
propertytimePattern
readonly timePattern: string
interfaceSpreadsheetTextValuesource ↗
interface SpreadsheetTextValue
propertykind
readonly kind: "text"
propertyvalue
readonly value: string
typeSpreadsheetFormatValuesource ↗
type SpreadsheetFormatValue = string | number | boolean | null | undefined | SpreadsheetTextValue | SpreadsheetErrorValue | readonly SpreadsheetFormatValue[] | readonly readonly SpreadsheetFormatValue[][]
variableDefaultSpreadsheetFormatLocalesource ↗
DefaultSpreadsheetFormatLocale: SpreadsheetFormatLocale
functionexcelDatePartsFromSerialsource ↗
excelDatePartsFromSerial(serial: number): ExcelDateParts | null
serial: number
functionformatDollarsource ↗
formatDollar(number: number, decimals: number, currencySymbol?: string): string
number: number
decimals: number
currencySymbol: string
functionformatExcelDateTimesource ↗
formatExcelDateTime(serial: number, pattern?: string, locale?: SpreadsheetFormatLocale): string

Formats an Excel date/time serial with date, clock, and elapsed-time tokens.

serial: number
pattern: string
locale: SpreadsheetFormatLocale
functionformatExcelDisplaysource ↗
formatExcelDisplay(value: SpreadsheetFormatValue, formatText: string, locale?: SpreadsheetFormatLocale): SpreadsheetFormatDisplay | SpreadsheetErrorValue | null

Formats a scalar value and preserves section-level visual metadata.

value: SpreadsheetFormatValue
formatText: string
locale: SpreadsheetFormatLocale
functionformatExcelTextsource ↗
formatExcelText(value: SpreadsheetFormatValue, formatText: string, locale?: SpreadsheetFormatLocale): string | SpreadsheetErrorValue | null
value: SpreadsheetFormatValue
formatText: string
locale: SpreadsheetFormatLocale
functionformatFixedsource ↗
formatFixed(number: number, decimals: number, noCommas: boolean): string
number: number
decimals: number
noCommas: boolean
functionformatSpreadsheetNumbersource ↗
formatSpreadsheetNumber(value: number, code: string, locale?: SpreadsheetFormatLocale): string | null
value: number
code: string
locale: SpreadsheetFormatLocale
functionparseNumberValuesource ↗
parseNumberValue(source: string, decimalSeparator?: string, groupSeparator?: string): number | null
source: string
decimalSeparator: string
groupSeparator: string