Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/types-drift-check.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Compile-time check: the hand-written types/index.d.ts must stay in sync
* with the source StoryAPI interface. If this file fails to compile,
* the published types have drifted from the implementation.
*
* Run: npx tsc --noEmit
*/
import type { StoryAPI as SourceAPI } from './story-api';
import type { StoryAPI as PublishedAPI } from '../types/index';

// Both directions — if either fails, the types have drifted.
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _sourceToPublished: PublishedAPI = {} as SourceAPI;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const _publishedToSource: SourceAPI = {} as PublishedAPI;
Loading
Loading