feat: decode method (#10)

This commit is contained in:
Johann Schopplich
2025-10-29 07:42:15 +01:00
parent 7db91398fe
commit 45604b06e8
11 changed files with 1501 additions and 21 deletions

View File

@@ -36,4 +36,42 @@ export type ResolvedEncodeOptions = Readonly<Required<EncodeOptions>>
// #endregion
// #region Decoder options
export interface DecodeOptions {
/**
* Number of spaces per indentation level.
* @default 2
*/
indent?: number
/**
* When true, enforce strict validation of array lengths and tabular row counts.
* @default true
*/
strict?: boolean
}
export type ResolvedDecodeOptions = Readonly<Required<DecodeOptions>>
// #endregion
// #region Decoder parsing types
export interface ArrayHeaderInfo {
key?: string
length: number
delimiter: Delimiter
fields?: string[]
hasLengthMarker: boolean
}
export interface ParsedLine {
raw: string
depth: Depth
indent: number
content: string
}
// #endregion
export type Depth = number