UNPKG

795 BJavaScriptView Raw
1// NOTE: The types exported from this file are simplified versions of the types exported
2// by @storybook/csf, with the simpler form retained for backwards compatibility.
3// We will likely start exporting the more complex <StoryFnReturnType> based types in 7.0
4// The `any` here is the story store's `StoreItem` record. Ideally we should probably only
5// pass a defined subset of that full data, but we pass it all so far :shrug:
6export let types;
7
8(function (types) {
9 types["TAB"] = "tab";
10 types["PANEL"] = "panel";
11 types["TOOL"] = "tool";
12 types["TOOLEXTRA"] = "toolextra";
13 types["PREVIEW"] = "preview";
14 types["NOTES_ELEMENT"] = "notes-element";
15})(types || (types = {}));
16
17export function isSupportedType(type) {
18 return !!Object.values(types).find(typeVal => typeVal === type);
19}
\No newline at end of file