Skip to content

Commit f11368e

Browse files
jcampbellclaude
andcommitted
fix(types): export the generated Data union instead of a deleted module
`lib/index.d.ts` re-exported `Data` from `src/types/core/data`, which was removed in 1f1898e ("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 <noreply@anthropic.com>
1 parent cc143a1 commit f11368e

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

lib/index.d.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@ export type {
6161
YAxisName
6262
} from '../src/types/core/layout';
6363

64-
// ---------------------------------------------------------------------------
65-
// Trace data
66-
// ---------------------------------------------------------------------------
67-
68-
export type { Data } from '../src/types/core/data';
69-
7064
// ---------------------------------------------------------------------------
7165
// Configuration
7266
// ---------------------------------------------------------------------------

src/types/core/data.internal.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
* Internal data/trace types (not in public API)
33
*
44
* These are runtime-resolved versions of trace data with internal state
5-
* properties. For public trace types, see data.d.ts.
5+
* properties. For public trace types, see generated/schema.d.ts.
66
*/
77

88
import type { Datum } from '../lib/common';
9-
import type { Data } from './data';
9+
import type { Data } from '../generated/schema';
1010

1111
/**
1212
* Calculated trace data (internal).

0 commit comments

Comments
 (0)