UNPKG

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