@takazudo/zdtp 0.7.0 → 0.8.1

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.
@@ -235,6 +235,29 @@ export interface DeserializeOptions {
235
235
  * exports are missing most fields by design). Typically the current
236
236
  * scheme's initial state. */
237
237
  colorDefaults?: ColorTweakState;
238
+ /** Tab ids to load. Omitted selects every configured token tab; [] loads nothing.
239
+ * Supports color, spacing, font, size, and generic tabs. Notes and
240
+ * color-secondary have no external serde slice. */
241
+ tabs?: string[];
242
+ /** Map only explicit per-mode values; ordinary token values are unchanged. */
243
+ modeSides?: 'as-is' | 'swap' | 'light-only' | 'dark-only' | 'light-to-both';
244
+ /** Replace selected tabs by default, or retain their unmentioned current values. */
245
+ strategy?: 'merge' | 'replace';
246
+ /** Live instance state. Without it, merge and one-side imports fall back to defaults. */
247
+ current?: TweakState;
248
+ }
249
+ /** A state-free description of the token entries in an import document. */
250
+ export interface ImportAnalysis {
251
+ schema: string;
252
+ tabs: {
253
+ id: string;
254
+ known: boolean;
255
+ entries: number;
256
+ perModeEntries: number;
257
+ }[];
258
+ sides: ('light' | 'dark')[];
259
+ /** Unknown token keys within known tabs; foreign tabs are identified by `known`. */
260
+ unknownTokens: string[];
238
261
  }
239
262
  /**
240
263
  * Thrown when the payload is not a v1 or v2 schema object. The error `.reason`
@@ -289,8 +312,9 @@ export declare function serialize(state: TweakState, opts?: SerializeOptions, cf
289
312
  * CSS var name that doesn't match a known manifest entry is collected into
290
313
  * `unknownTokens` (the caller can surface these as a warning).
291
314
  *
292
- * Missing fields fall back to `opts.colorDefaults` (or, absent that, a
293
- * minimal neutral default) so the result is always a valid `TweakState`.
315
+ * Missing fields in selected tabs fall back to defaults, or to `opts.current`
316
+ * under `strategy: 'merge'`. Unselected tabs always retain their current state.
317
+ * `modeSides` transforms only explicit per-mode leaves in the document.
294
318
  *
295
319
  * `cfg` defaults to the active (most-recently-configured) instance so the
296
320
  * single-default path stays byte-identical. The Import modal threads its OWN
@@ -299,4 +323,10 @@ export declare function serialize(state: TweakState, opts?: SerializeOptions, cf
299
323
  * the default instance's.
300
324
  */
301
325
  export declare function deserialize(input: unknown, opts?: DeserializeOptions, cfg?: PanelConfig): DeserializeResult;
326
+ /**
327
+ * Inspect a document without constructing state, resolving CSS colors, or
328
+ * touching storage. Counts token leaves (including unknown/malformed values),
329
+ * not tier containers or the properties inside a semantic literal/ref leaf.
330
+ */
331
+ export declare function analyzeDesignTokenJson(input: unknown, cfg?: PanelConfig): ImportAnalysis;
302
332
  export {};