@nouxwell/tabula-core 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/columns.d.ts CHANGED
@@ -53,6 +53,8 @@ export interface ColumnFormat {
53
53
  /** Digits after the point a number column shows, 0 to `MAX_SHOWN_DECIMALS`. Left out, its field's. */
54
54
  readonly decimals?: number;
55
55
  }
56
+ /** Each column's format, by field key. */
57
+ export type ColumnFormats = Readonly<Record<string, ColumnFormat>>;
56
58
  /**
57
59
  * A user's arrangement of the columns, kept with their view of the sheet. Only how the columns are
58
60
  * shown: hiding a required column relaxes nothing, and its issues are still listed.
@@ -67,7 +69,7 @@ export interface ColumnLayout {
67
69
  /** Columns kept in place on the left while the sheet scrolls sideways. They are shown first. */
68
70
  readonly pinned?: readonly string[];
69
71
  /** How each column's values are drawn, by field key. */
70
- readonly formats?: Readonly<Record<string, ColumnFormat>>;
72
+ readonly formats?: ColumnFormats;
71
73
  }
72
74
  export interface ArrangedColumns<F> {
73
75
  /** The columns shown, in order: the pinned ones first. */
@@ -94,6 +96,18 @@ export declare function withColumnFormat(layout: ColumnLayout, key: string, chan
94
96
  readonly align?: ColumnAlign | undefined;
95
97
  readonly decimals?: number | undefined;
96
98
  } | null): ColumnLayout;
99
+ /**
100
+ * Each column's format with each layer over the one before, property by property: a template's
101
+ * formats, then the user's own. What a layer leaves out, a column or one property of it, is the
102
+ * layer under's.
103
+ */
104
+ export declare function mergeColumnFormats(...layers: readonly (ColumnFormats | undefined)[]): ColumnFormats;
105
+ /**
106
+ * The layout without what `under` already draws: each property of a column's format that `under`
107
+ * gives the same is taken off, and a format left with none goes. What a user keeps of their own once
108
+ * a template says the same, so that a change to the template later reaches them.
109
+ */
110
+ export declare function withoutColumnFormats(layout: ColumnLayout, under: ColumnFormats | undefined): ColumnLayout;
97
111
  /**
98
112
  * A layout read from JSON, each problem reported under `path`: what a view, a draft and a template
99
113
  * keep. Undefined when there is none.
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * It repeats what `package.json` says, and a test holds the two together: a release that bumps
5
5
  * one and forgets the other fails before it is tagged.
6
6
  */
7
- export declare const version = "0.4.0";
7
+ export declare const version = "0.5.0";
8
8
  export { SchemaError, TabulaError } from "./errors.js";
9
9
  export type { SchemaProblem, TabulaErrorCode } from "./errors.js";
10
10
  export type { CellObject, CellValue } from "./value.js";
@@ -49,9 +49,9 @@ export type { CellPosition, CellRange, Direction, IsBlank, MoveOptions } from ".
49
49
  export { parseTsv, toTsv } from "./clipboard.js";
50
50
  export { decodeText, detectDelimiter, parseCsv, toCsv } from "./csv.js";
51
51
  export type { CsvDelimiter, CsvReadOptions, CsvWriteOptions } from "./csv.js";
52
- export { csvDelimiterFor, exportTable, importTable } from "./table.js";
53
- export type { ColumnMatch, ColumnStatus, TableExportOptions, TableImport, TableImportOptions } from "./table.js";
54
- export { checkValue, SheetValidator } from "./validation.js";
52
+ export { applyImport, csvDelimiterFor, exportTable, headerKey, IMPORT_ORIGIN, importTable, matchRows, suggestColumns, suggestMatch } from "./table.js";
53
+ export type { ColumnMatch, ColumnStatus, ColumnSuggestion, ExtraColumn, ImportApplied, ImportApplyOptions, MatchSuggestion, SuggestionReason, SuggestOptions, TableExportOptions, TableImport, TableImportOptions } from "./table.js";
54
+ export { checkValue, isBlankRow, SheetValidator } from "./validation.js";
55
55
  export type { Issue, IssueScope, IssueSet, IssueSeverity, IssueSummary, IssueTarget, LocalIssueCode } from "./validation.js";
56
56
  export { readCheckResponse, readProcessResponse } from "./contract.js";
57
57
  export type { AdapterContext, CheckResponse, IssueInput, PayloadRow, ProcessProgress, ProcessRequest, ProcessResponse, ProcessStatus, RowAction, RowOutcome, RowPlanInput, RowResultInput, SheetAdapters, SheetRequest, StatusQuery } from "./contract.js";
@@ -75,5 +75,5 @@ export { readStyleRules, rowStyles, rowsStyled, styleApplies, styleRuleToJson }
75
75
  export type { CellStyle, StyleRule, StyleRuleInput } from "./styles.js";
76
76
  export { findCells, REPLACE_ORIGIN, replaceCells } from "./find.js";
77
77
  export type { FindOptions, FoundCell, ReplaceOptions, ReplaceResult } from "./find.js";
78
- export { arrangeColumns, autoColumnWidth, clampColumnWidth, DEFAULT_COLUMN_SIZING, COLUMN_ALIGNS, freezeColumnLayout, headerDisplayText, mapColumnLayout, MAX_SHOWN_DECIMALS, readColumnLayout, resolveColumnSizing, sameColumnFormats, withColumn, withColumnFormat } from "./columns.js";
79
- export type { ArrangedColumns, ColumnAlign, ColumnFormat, ColumnLayout, ColumnSizing } from "./columns.js";
78
+ export { arrangeColumns, autoColumnWidth, clampColumnWidth, DEFAULT_COLUMN_SIZING, COLUMN_ALIGNS, freezeColumnLayout, headerDisplayText, mapColumnLayout, MAX_SHOWN_DECIMALS, mergeColumnFormats, readColumnLayout, resolveColumnSizing, sameColumnFormats, withColumn, withColumnFormat, withoutColumnFormats } from "./columns.js";
79
+ export type { ArrangedColumns, ColumnAlign, ColumnFormat, ColumnFormats, ColumnLayout, ColumnSizing } from "./columns.js";