DocsUtils

Utils

37
Items
28
Functions
0
Types
9
Other

areColorsEnabled

function

Check if colors are currently enabled

areColorsEnabled(): boolean

buildDailyTrendData

function

Builds daily trend data with normalized token values for UI display.

buildDailyTrendData(daily: DailyData[]): object[]

buildModelUsageData

function

Builds model usage data from daily records.

buildModelUsageData(daily: DailyData[]): ModelUsage[]

buildModelUsageDataByTokens

function

Builds model usage data organized by token consumption.

buildModelUsageDataByTokens(daily: DailyData[]): object[]

buildTokenCompositionData

function

Builds token composition data from daily records.

buildTokenCompositionData(daily: DailyData[]): object[]

buildTokenTypeData

function

Builds token type usage data from totals.

buildTokenTypeData(totals: Totals): TokenTypeUsage[]

cn

function

Combines and merges Tailwind CSS class names with conflict resolution.

cn(inputs: ClassValue[]): string

computeFilledDailyRange

function
computeFilledDailyRange(daily: DailyData[]): DailyData[]

computeStreak

function
computeStreak(daily: DailyData[]): number

computeTotalsFromDaily

function

Computes totals from daily usage data.

computeTotalsFromDaily(daily: DailyData[]): Totals

externalLinkProps

variable

Props to apply to external links for security and UX best practices.

object

filterDailyByRange

function

Filters daily data by time range.

filterDailyByRange(daily: DailyData[], range: TimeRangeKey, options?: object): DailyData[]

formatAxisLabel

function
formatAxisLabel(isoDate: string, range: TimeRangeKey): string

formatCurrency

function

Formats a number as USD currency.

formatCurrency(value: number): string

formatStreakCompact

function

Formats streak count in compact notation.

formatStreakCompact(days: number): string

Formatter

class

Formatter utility class providing consistent formatting functions for various data types.

formatTokens

function

Formats token count for human-readable display.

formatTokens(value: number): string

formatTooltipDate

function
formatTooltipDate(isoDate: string): string

getDeviceOSInfo

function

Extracts OS/ROM information from device data. Searches for rows with label "Android Version" or "ROM" and extracts the display value, version number, and documentation link.

getDeviceOSInfo(device: DeviceSpec | null): OSInfo | null

getDeviceRootInfo

function

Extracts root method information from device data. Searches for rows with label "Root" and extracts the method name and GitHub/official link.

getDeviceRootInfo(device: DeviceSpec | null): RootInfo | null

getHealthColor

function

Get themed color for health status.

getHealthColor(health: SystemHealth): string

getHealthMessage

function

Get human-readable health message.

getHealthMessage(health: SystemHealth): string

getHeatmapColor

function

Determines heatmap color based on value intensity.

getHeatmapColor(maxCost: number, value: number, palette: HeatmapPalette): string

getModelLabel

function
getModelLabel(modelName: string): string

getOSText

function

Generates human-readable OS text with optional link. Used for inline text generation in paragraphs.

getOSText(device: DeviceSpec | null): string | null

getRootText

function

Generates human-readable root method text. Used for inline text generation in paragraphs.

getRootText(device: DeviceSpec | null): string | null

getStatusIcon

function

Get themed status icon component.

getStatusIcon(status: ServiceStatus, size: number = 18): Element

isExternalHref

function

Type guard to check if a URL string is an external link (starts with http/https).

isExternalHref(href?: string): any

logger

variable

Standardized logger with environment-based filtering

object

LogLevel

variable

Log severity levels in order of severity (least to most severe)

LogLevelType

property

Export types for external use

OSInfo

property

OS/ROM information extracted from device data.

prepareHeatmapData

function
prepareHeatmapData(daily: DailyData[]): HeatmapDay | null[][]

RootInfo

property

Root method information extracted from device data.

terminalColors

variable

Semantic color functions for terminal output

object

throttle

function

Throttles a function to only execute at most once per specified delay

throttle(func: T, delay: number): object

Validator

class

Validator utility class providing type-safe validation functions with TypeScript type guards.