From f11368e32d275e62f93140db33b6adfa737d0cc9 Mon Sep 17 00:00:00 2001 From: t Date: Mon, 31 Aug 2026 19:13:17 +0000 Subject: [PATCH] fix(types): export the generated `Data` union instead of a deleted module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `lib/index.d.ts` re-exported `Data` from `src/types/core/data`, which was removed in 1f1898e9 ("refactor: Generate data type union instead of hand writing"). That commit repointed the five importers under `src/types/`, but `lib/index.d.ts` and `src/types/core/data.internal.d.ts` were missed. The entry point already re-exports the generated schema with `export type *`, and the generator now emits `Data` there. An explicit named re-export takes precedence over a star re-export, so the dangling line shadowed the working union and `Data` resolved to `any` for every consumer. `skipLibCheck: true` — the default in most app tsconfigs — hides the unresolved module, so the failure is silent: traces annotated `Data` are simply unchecked. Reproduced against plotly.js 4.0.0 from npm: import type { Data } from 'plotly.js'; declare const d: Data; const n: number = d; // no error const s = d.nonexistentProperty; // no error Both now error as expected, and `FullData` resolves with `skipLibCheck: false`. Co-Authored-By: Claude Opus 5 --- lib/index.d.ts | 6 ------ src/types/core/data.internal.d.ts | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/index.d.ts b/lib/index.d.ts index ceaae5d7930..e17f8128ec8 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -61,12 +61,6 @@ export type { YAxisName } from '../src/types/core/layout'; -// --------------------------------------------------------------------------- -// Trace data -// --------------------------------------------------------------------------- - -export type { Data } from '../src/types/core/data'; - // --------------------------------------------------------------------------- // Configuration // --------------------------------------------------------------------------- diff --git a/src/types/core/data.internal.d.ts b/src/types/core/data.internal.d.ts index 10e9036c72f..e583d3ad131 100644 --- a/src/types/core/data.internal.d.ts +++ b/src/types/core/data.internal.d.ts @@ -2,11 +2,11 @@ * Internal data/trace types (not in public API) * * These are runtime-resolved versions of trace data with internal state - * properties. For public trace types, see data.d.ts. + * properties. For public trace types, see generated/schema.d.ts. */ import type { Datum } from '../lib/common'; -import type { Data } from './data'; +import type { Data } from '../generated/schema'; /** * Calculated trace data (internal).