@storybook/react-dom-shim
Advanced tools
Comparing version 0.0.0-pr-23697-sha-615db423 to 0.0.0-pr-23724-sha-117cb2b3
@@ -720,2 +720,6 @@ import { FileSystemCache } from 'file-system-cache'; | ||
PackageJson$1.JSPMConfiguration; | ||
type StoryId = string; | ||
type ComponentTitle = string; | ||
type StoryName = string; | ||
type Tag = string; | ||
@@ -726,2 +730,4 @@ interface Parameters { | ||
type ExportName = string; | ||
type MetaId = string; | ||
interface StoriesSpecifier { | ||
@@ -761,6 +767,79 @@ /** | ||
} | ||
interface StoryIndexer { | ||
/** | ||
* FIXME: This is a temporary type to allow us to deprecate the old indexer API. | ||
* We should remove this type and the deprecated indexer API in 8.0. | ||
*/ | ||
type BaseIndexer = { | ||
/** | ||
* A regular expression that should match all files to be handled by this indexer | ||
*/ | ||
test: RegExp; | ||
}; | ||
/** | ||
* An indexer describes which filenames it handles, and how to index each individual file - turning it into an entry in the index. | ||
*/ | ||
type Indexer = BaseIndexer & { | ||
/** | ||
* Indexes a file containing stories or docs. | ||
* @param fileName The name of the file to index. | ||
* @param options {@link IndexerOptions} for indexing the file. | ||
* @returns A promise that resolves to an array of {@link IndexInput} objects. | ||
*/ | ||
index: (fileName: string, options: IndexerOptions) => Promise<IndexInput[]>; | ||
/** | ||
* @soonDeprecated Use {@link index} instead | ||
*/ | ||
indexer?: never; | ||
}; | ||
type DeprecatedIndexer = BaseIndexer & { | ||
indexer: (fileName: string, options: IndexerOptions) => Promise<IndexedCSFFile>; | ||
} | ||
index?: never; | ||
}; | ||
/** | ||
* @soonDeprecated Use {@link Indexer} instead | ||
*/ | ||
type StoryIndexer = Indexer | DeprecatedIndexer; | ||
/** | ||
* The base input for indexing a story or docs entry. | ||
*/ | ||
type BaseIndexInput = { | ||
/** The file to import from e.g. the story file. */ | ||
importPath: Path; | ||
/** The name of the export to import. */ | ||
exportName: ExportName; | ||
/** The name of the entry, auto-generated from {@link exportName} if unspecified. */ | ||
name?: StoryName; | ||
/** The location in the sidebar, auto-generated from {@link importPath} if unspecified. */ | ||
title?: ComponentTitle; | ||
/** | ||
* The custom id optionally set at `meta.id` if it needs to differ from the id generated via {@link title}. | ||
* If unspecified, the meta id will be auto-generated from {@link title}. | ||
* If specified, the meta in the CSF file _must_ have a matching id set at `meta.id`, to be correctly matched. | ||
*/ | ||
metaId?: MetaId; | ||
/** Tags for filtering entries in Storybook and its tools. */ | ||
tags?: Tag[]; | ||
/** | ||
* The id of the entry, auto-generated from {@link title}/{@link metaId} and {@link exportName} if unspecified. | ||
* If specified, the story in the CSF file _must_ have a matching id set at `parameters.__id`, to be correctly matched. | ||
* Only use this if you need to override the auto-generated id. | ||
*/ | ||
__id?: StoryId; | ||
}; | ||
/** | ||
* The input for indexing a story entry. | ||
*/ | ||
type StoryIndexInput = BaseIndexInput & { | ||
type: 'story'; | ||
}; | ||
/** | ||
* The input for indexing a docs entry. | ||
*/ | ||
type DocsIndexInput = BaseIndexInput & { | ||
type: 'docs'; | ||
/** Paths to story files that must be pre-loaded for this docs entry. */ | ||
storiesImports?: Path[]; | ||
}; | ||
type IndexInput = StoryIndexInput | DocsIndexInput; | ||
type Path = string; | ||
@@ -1041,5 +1120,10 @@ interface Options$1 { | ||
* Process CSF files for the story index. | ||
* @soonDeprecated use {@link experimental_indexers} instead | ||
*/ | ||
storyIndexers?: PresetValue<StoryIndexer[]>; | ||
/** | ||
* Process CSF files for the story index. | ||
*/ | ||
experimental_indexers?: PresetValue<Indexer[]>; | ||
/** | ||
* Docs related features in index generation | ||
@@ -1046,0 +1130,0 @@ */ |
{ | ||
"name": "@storybook/react-dom-shim", | ||
"version": "0.0.0-pr-23697-sha-615db423", | ||
"version": "0.0.0-pr-23724-sha-117cb2b3", | ||
"description": "", | ||
@@ -56,3 +56,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@storybook/types": "0.0.0-pr-23697-sha-615db423", | ||
"@storybook/types": "0.0.0-pr-23724-sha-117cb2b3", | ||
"typescript": "~4.9.3" | ||
@@ -59,0 +59,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39251
1058