Merge pull request #19123 from SimenB/patch-1

fix: type `storyIdToEntry` explicitly
This commit is contained in:
Norbert de Langen 2022-09-13 13:18:11 +02:00 committed by GitHub
commit 11ec40bfcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,6 +28,7 @@ import type {
PromiseLike,
StoryIndex,
V2CompatIndexEntry,
IndexEntry,
StoryIndexV3,
ModuleExports,
} from './types';
@ -126,7 +127,7 @@ export class StoryStore<TFramework extends AnyFramework> {
}
// Get an entry from the index, waiting on initialization if necessary
async storyIdToEntry(storyId: StoryId) {
async storyIdToEntry(storyId: StoryId): Promise<IndexEntry> {
await this.initializationPromise;
// The index will always be set before the initialization promise returns
return this.storyIndex!.storyIdToEntry(storyId);