Improve typings for Source enhancement

This commit is contained in:
Michael Shilman 2020-04-13 08:37:17 +08:00
parent 1c6262a4a0
commit 374aa99d32

View File

@ -1,4 +1,5 @@
import { ArgsEnhancer, combineParameters } from '@storybook/client-api';
import { combineParameters } from '@storybook/client-api';
import { StoryContext, Parameters } from '@storybook/addons';
interface Location {
line: number;
@ -36,7 +37,7 @@ const extract = (targetId: string, { source, locationsMap }: StorySource) => {
].join('\n');
};
export const enhanceSource: ArgsEnhancer = (context) => {
export const enhanceSource = (context: StoryContext): Parameters => {
const { id, parameters } = context;
const { storySource, docs = {} } = parameters;
const { formatSource } = docs;