@freegridjs/core 1.6.0 → 1.7.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/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { default as en } from './locales/en.js';
5
5
  declare function createGrid(host: HTMLElement, options: GridOptions): GridApi;
6
6
 
7
7
  /** FreeGrid version (kept in sync with releases.json by scripts/release.mjs). */
8
- declare const version = "1.6.0";
8
+ declare const version = "1.7.0";
9
9
 
10
10
  interface LicenseInfo {
11
11
  /** Licensed domains (plus their www. host); `*.example.com` also covers every subdomain. */
@@ -14,19 +14,22 @@ interface LicenseInfo {
14
14
  /** Last valid day, YYYY-MM-DD. */
15
15
  expires: string;
16
16
  issued: string;
17
+ /** Perpetual keys: the major version they cover (bought on 1.x → every 1.x release). Absent: every version while valid. */
18
+ major?: number;
17
19
  }
18
20
  type LicenseResult = {
19
21
  ok: true;
20
22
  info: LicenseInfo;
21
23
  } | {
22
24
  ok: false;
23
- reason: 'format' | 'signature' | 'expired' | 'domain' | 'unsupported';
25
+ reason: 'format' | 'signature' | 'expired' | 'domain' | 'version' | 'unsupported';
24
26
  info?: LicenseInfo;
25
27
  };
26
- /** Check a key's signature, expiry and domain. */
28
+ /** Check a key's signature, expiry, domain and (perpetual keys) the major version. */
27
29
  declare function verifyLicense(key: string, host: string, opts?: {
28
30
  publicKey?: JsonWebKey;
29
31
  now?: Date;
32
+ version?: string;
30
33
  }): Promise<LicenseResult>;
31
34
  /** Set the license key once for every grid on the page. */
32
35
  declare function setLicenseKey(key: string): void;
@@ -132,6 +135,12 @@ declare function messageToTransaction(message: unknown): RowTransaction | {
132
135
  */
133
136
  declare function connectLive(api: GridApi, options: LiveOptions): LiveConnection;
134
137
 
138
+ /**
139
+ * Remembers the last value given for an option. Framework wrappers use it so that a parent writing
140
+ * `groupBy={['country']}` inline (a new array on every render) applies it only when its content changes.
141
+ */
142
+ declare function changeTracker(initial: unknown): (next: unknown) => boolean;
143
+
135
144
  /** Add a function formulas can call, e.g. registerFormulaFunction('VAT', ([n]) => Number(n) * 0.1). */
136
145
  declare function registerFormulaFunction(name: string, fn: (args: unknown[]) => unknown): void;
137
146
  /** Names of every function formulas can call. */
@@ -170,4 +179,4 @@ declare function renderChart(el: HTMLElement, spec: ChartSpec): void;
170
179
  declare function registerLocale(pack: LocalePack): void;
171
180
  declare function resolveLocale(input?: string | Partial<LocalePack>, navLangs?: readonly string[]): LocalePack;
172
181
 
173
- export { type ChartSpec, type ChartType, Datasource, ExportOptions, GridApi, GridOptions, type LicenseInfo, type LiveConnection, type LiveOptions, type LiveStatus, LocalePack, type RestOptions, Row, RowTransaction, type WorkbookSheet, buildWorkbook, connectLive, createGrid, csrfHeaders, evaluateFormula, exportWorkbook, formulaFunctions, loadData, messageToTransaction, parseCsv, registerFormulaFunction, registerLocale, renderChart, resolveLocale, restDatasource, saveChanges, setLicenseKey, verifyLicense, version };
182
+ export { type ChartSpec, type ChartType, Datasource, ExportOptions, GridApi, GridOptions, type LicenseInfo, type LiveConnection, type LiveOptions, type LiveStatus, LocalePack, type RestOptions, Row, RowTransaction, type WorkbookSheet, buildWorkbook, changeTracker, connectLive, createGrid, csrfHeaders, evaluateFormula, exportWorkbook, formulaFunctions, loadData, messageToTransaction, parseCsv, registerFormulaFunction, registerLocale, renderChart, resolveLocale, restDatasource, saveChanges, setLicenseKey, verifyLicense, version };