Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@storybook/preview-api

Package Overview
Dependencies
Maintainers
26
Versions
794
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/preview-api - npm Package Compare versions

Comparing version 8.0.0-alpha.9 to 8.0.0-alpha.10

89

dist/index.d.ts

@@ -8,24 +8,8 @@ import { Channel } from '@storybook/channels';

private channel;
/**
* @deprecated will be removed in 8.0, please use channel instead
*/
private serverChannel;
private promise;
private resolve;
getChannel: () => Channel;
/**
* @deprecated will be removed in 8.0, please use getChannel instead
*/
getServerChannel: () => Channel;
ready: () => Promise<Channel>;
hasChannel: () => boolean;
/**
* @deprecated will be removed in 8.0, please use the normal channel instead
*/
hasServerChannel: () => boolean;
setChannel: (channel: Channel) => void;
/**
* @deprecated will be removed in 8.0, please use the normal channel instead
*/
setServerChannel: (channel: Channel) => void;
}

@@ -356,6 +340,6 @@ declare const addons: AddonStore;

declare class StoryStore<TRenderer extends Renderer> {
storyIndex?: StoryIndexStore;
importFn?: ModuleImportFn;
projectAnnotations?: NormalizedProjectAnnotations<TRenderer>;
globals?: GlobalsStore;
importFn: ModuleImportFn;
storyIndex: StoryIndexStore;
projectAnnotations: NormalizedProjectAnnotations<TRenderer>;
globals: GlobalsStore;
args: ArgsStore;

@@ -367,10 +351,4 @@ hooks: Record<StoryId, HooksContext<TRenderer>>;

prepareStoryWithCache: typeof prepareStory;
initializationPromise: Promise<void>;
resolveInitializationPromise: () => void;
constructor();
constructor(storyIndex: StoryIndex, importFn: ModuleImportFn, projectAnnotations: ProjectAnnotations<TRenderer>);
setProjectAnnotations(projectAnnotations: ProjectAnnotations<TRenderer>): void;
initialize({ storyIndex, importFn, }: {
storyIndex?: StoryIndex;
importFn: ModuleImportFn;
}): void;
onStoriesChanged({ importFn, storyIndex, }: {

@@ -533,2 +511,3 @@ importFn?: ModuleImportFn;

componentStories: () => PreparedStory<TRenderer>[];
componentStoriesFromCSFFile: (csfFile: CSFFile<TRenderer>) => PreparedStory<TRenderer>[];
storyById: (storyId?: StoryId) => PreparedStory<TRenderer>;

@@ -618,2 +597,4 @@ getStoryContext: (story: PreparedStory<TRenderer>) => StoryContextForLoaders<TRenderer, _storybook_types.Args>;

declare class Preview<TRenderer extends Renderer> {
importFn: ModuleImportFn;
getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>;
protected channel: Channel;

@@ -624,21 +605,21 @@ /**

serverChannel?: Channel;
storyStore: StoryStore<TRenderer>;
getStoryIndex?: () => StoryIndex;
importFn?: ModuleImportFn;
protected storyStoreValue?: StoryStore<TRenderer>;
renderToCanvas?: RenderToCanvas<TRenderer>;
storyRenders: StoryRender<TRenderer>[];
previewEntryError?: Error;
constructor(channel?: Channel);
initialize({ getStoryIndex, importFn, getProjectAnnotations, }: {
getStoryIndex?: () => StoryIndex;
importFn: ModuleImportFn;
getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>;
}): Promise<void>;
private projectAnnotationsBeforeInitialization?;
protected storeInitializationPromise: Promise<void>;
protected resolveStoreInitializationPromise: () => void;
protected rejectStoreInitializationPromise: (err: Error) => void;
constructor(importFn: ModuleImportFn, getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>, channel?: Channel, shouldInitialize?: boolean);
get storyStore(): {};
protected initialize(): Promise<void>;
ready(): Promise<void>;
setupListeners(): void;
getProjectAnnotationsOrRenderError(getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>): Promise<ProjectAnnotations<TRenderer>>;
getProjectAnnotationsOrRenderError(): Promise<ProjectAnnotations<TRenderer>>;
initializeWithProjectAnnotations(projectAnnotations: ProjectAnnotations<TRenderer>): Promise<void>;
getStoryIndexFromServer(): Promise<StoryIndex>;
protected initializeWithStoryIndex(storyIndex: StoryIndex): void;
setInitialGlobals(): Promise<void>;
emitGlobals(): void;
getStoryIndexFromServer(): Promise<StoryIndex>;
initializeWithStoryIndex(storyIndex: StoryIndex): void;
onGetProjectAnnotationsChanged({ getProjectAnnotations, }: {

@@ -671,2 +652,5 @@ getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>;

}): Promise<void>;
loadStory({ storyId }: {
storyId: StoryId;
}): Promise<PreparedStory<TRenderer>>;
extract(options?: {

@@ -715,9 +699,11 @@ includeDocsOnly: boolean;

type PossibleRender<TFramework extends Renderer> = StoryRender<TFramework> | CsfDocsRender<TFramework> | MdxDocsRender<TFramework>;
declare class PreviewWithSelection<TFramework extends Renderer> extends Preview<TFramework> {
type PossibleRender<TRenderer extends Renderer> = StoryRender<TRenderer> | CsfDocsRender<TRenderer> | MdxDocsRender<TRenderer>;
declare class PreviewWithSelection<TRenderer extends Renderer> extends Preview<TRenderer> {
importFn: ModuleImportFn;
getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>;
selectionStore: SelectionStore;
view: View<TFramework['canvasElement']>;
view: View<TRenderer['canvasElement']>;
currentSelection?: Selection;
currentRender?: PossibleRender<TFramework>;
constructor(selectionStore: SelectionStore, view: View<TFramework['canvasElement']>);
currentRender?: PossibleRender<TRenderer>;
constructor(importFn: ModuleImportFn, getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>, selectionStore: SelectionStore, view: View<TRenderer['canvasElement']>);
setupListeners(): void;

@@ -728,3 +714,3 @@ setInitialGlobals(): Promise<void>;

onGetProjectAnnotationsChanged({ getProjectAnnotations, }: {
getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TFramework>>;
getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>;
}): Promise<void>;

@@ -751,11 +737,8 @@ onStoriesChanged({ importFn, storyIndex, }: {

}): Promise<void>;
renderSelection({ persistedArgs }?: {
protected renderSelection({ persistedArgs }?: {
persistedArgs?: Args;
}): Promise<void>;
teardownRender(render: PossibleRender<TFramework>, { viewModeChanged }?: {
teardownRender(render: PossibleRender<TRenderer>, { viewModeChanged }?: {
viewModeChanged?: boolean;
}): Promise<void>;
extract(options?: {
includeDocsOnly: boolean;
}): Promise<Record<string, _storybook_types.StoryContextForEnhancers<TFramework, Args>>>;
mainStoryCallbacks(storyId: StoryId): {

@@ -779,4 +762,6 @@ showMain: () => void;

declare class PreviewWeb<TFramework extends Renderer> extends PreviewWithSelection<TFramework> {
constructor();
declare class PreviewWeb<TRenderer extends Renderer> extends PreviewWithSelection<TRenderer> {
importFn: ModuleImportFn;
getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>;
constructor(importFn: ModuleImportFn, getProjectAnnotations: () => MaybePromise<ProjectAnnotations<TRenderer>>);
}

@@ -783,0 +768,0 @@

{
"name": "@storybook/preview-api",
"version": "8.0.0-alpha.9",
"version": "8.0.0-alpha.10",
"description": "",

@@ -46,8 +46,8 @@ "keywords": [

"dependencies": {
"@storybook/channels": "8.0.0-alpha.9",
"@storybook/client-logger": "8.0.0-alpha.9",
"@storybook/core-events": "8.0.0-alpha.9",
"@storybook/channels": "8.0.0-alpha.10",
"@storybook/client-logger": "8.0.0-alpha.10",
"@storybook/core-events": "8.0.0-alpha.10",
"@storybook/csf": "^0.1.2",
"@storybook/global": "^5.0.0",
"@storybook/types": "8.0.0-alpha.9",
"@storybook/types": "8.0.0-alpha.10",
"@types/qs": "^6.9.5",

@@ -58,2 +58,3 @@ "dequal": "^2.0.2",

"qs": "^6.10.0",
"tiny-invariant": "^1.3.1",
"ts-dedent": "^2.0.0",

@@ -64,3 +65,3 @@ "util-deprecate": "^1.0.2"

"@jest/globals": "^29.5.0",
"@storybook/core-common": "8.0.0-alpha.9",
"@storybook/core-common": "8.0.0-alpha.10",
"ansi-to-html": "^0.6.11",

@@ -67,0 +68,0 @@ "slash": "^5.0.0"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc