This commit is contained in:
Norbert de Langen 2022-10-22 01:08:39 +02:00
parent 67581a33d9
commit c52e17c81a
No known key found for this signature in database
GPG Key ID: FD0E78AF9A837762
5 changed files with 14 additions and 55 deletions

View File

@ -18,7 +18,6 @@ import type {
StoryFn,
Globals,
GlobalTypes,
LegacyStoryFn,
Addon_ClientApiAddons,
Addon_StoryApi,
Store_NormalizedComponentAnnotations,
@ -34,17 +33,6 @@ import {
import { StoryStoreFacade } from './StoryStoreFacade';
export interface GetStorybookStory<TFramework extends AnyFramework> {
name: string;
render: LegacyStoryFn<TFramework>;
}
export interface GetStorybookKind<TFramework extends AnyFramework> {
kind: string;
fileName: string;
stories: GetStorybookStory<TFramework>[];
}
// ClientApi (and StoreStore) are really singletons. However they are not created until the
// relevant framework instanciates them via `start.js`. The good news is this happens right away.
let singleton: ClientApi<AnyFramework>;

View File

@ -10,7 +10,6 @@ import type {
StoryId,
AnyFramework,
Parameters,
StoryFn,
Addon_IndexEntry,
Store_NormalizedProjectAnnotations,
Store_NormalizedStoriesSpecifier,
@ -23,17 +22,6 @@ import type {
import { StoryStore, userOrAutoTitle, sortStoriesV6 } from '@storybook/store';
import { logger } from '@storybook/client-logger';
export interface GetStorybookStory<TFramework extends AnyFramework> {
name: string;
render: StoryFn<TFramework>;
}
export interface GetStorybookKind<TFramework extends AnyFramework> {
kind: string;
fileName: string;
stories: GetStorybookStory<TFramework>[];
}
export class StoryStoreFacade<TFramework extends AnyFramework> {
projectAnnotations: Store_NormalizedProjectAnnotations<TFramework>;

View File

@ -1,31 +1,14 @@
import {
ClientApi,
export {
addArgs,
addArgsEnhancer,
addArgTypes,
addArgTypesEnhancer,
addDecorator,
addLoader,
addParameters,
addArgs,
addArgTypes,
addArgsEnhancer,
addArgTypesEnhancer,
addStepRunner,
ClientApi,
setGlobalRender,
} from './ClientApi';
export type { GetStorybookKind, GetStorybookStory } from './ClientApi';
export * from './queryparams';
export * from '@storybook/store';
export {
addDecorator,
addLoader,
addParameters,
addArgsEnhancer,
addArgTypesEnhancer,
addArgs,
addArgTypes,
addStepRunner,
setGlobalRender,
ClientApi,
};

View File

@ -1,9 +1,8 @@
import global from 'global';
import { parse } from 'qs';
const { document } = global;
export const getQueryParams = () => {
const { document } = global;
// document.location is not defined in react-native
if (document && document.location && document.location.search) {
return parse(document.location.search, { ignoreQueryPrefix: true });

View File

@ -12,6 +12,7 @@ import type {
LoaderFunction,
Parameters,
ProjectAnnotations,
LegacyStoryFn,
StoryContext,
StoryFn,
StoryId,
@ -97,15 +98,15 @@ export interface ClientAPI_ClientApiAddons<StoryFnReturnType> {
[key: string]: ClientAPI_ClientApiAddon<StoryFnReturnType>;
}
export interface ClientAPI_GetStorybookStory {
export type ClientAPI_RenderContextWithoutStoryContext = Omit<Store_RenderContext, 'storyContext'>;
export interface ClientAPI_GetStorybookStory<TFramework extends AnyFramework> {
name: string;
render: StoryFn;
render: LegacyStoryFn<TFramework>;
}
export interface ClientAPI_GetStorybookKind {
export interface ClientAPI_GetStorybookKind<TFramework extends AnyFramework> {
kind: string;
fileName: string;
stories: ClientAPI_GetStorybookStory[];
stories: ClientAPI_GetStorybookStory<TFramework>[];
}
export type ClientAPI_RenderContextWithoutStoryContext = Omit<Store_RenderContext, 'storyContext'>;