@storybook/react-dom-shim
Advanced tools
Comparing version
@@ -19,3 +19,36 @@ import { FileSystemCache } from 'file-system-cache'; | ||
/** | ||
Matches a JSON object. | ||
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`. | ||
@category JSON | ||
*/ | ||
type JsonObject = {[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined}; | ||
/** | ||
Matches a JSON array. | ||
@category JSON | ||
*/ | ||
type JsonArray = JsonValue[] | readonly JsonValue[]; | ||
/** | ||
Matches any valid JSON primitive value. | ||
@category JSON | ||
*/ | ||
type JsonPrimitive = string | number | boolean | null; | ||
/** | ||
Matches any valid JSON value. | ||
@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`. | ||
@category JSON | ||
*/ | ||
type JsonValue = JsonPrimitive | JsonObject | JsonArray; | ||
declare global { | ||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged. | ||
interface SymbolConstructor { | ||
@@ -86,4 +119,4 @@ readonly observable: symbol; | ||
export interface DirectoryLocations { | ||
[directoryType: string]: unknown; | ||
export type DirectoryLocations = { | ||
[directoryType: string]: JsonValue | undefined; | ||
@@ -119,3 +152,3 @@ /** | ||
test?: string; | ||
} | ||
}; | ||
@@ -270,19 +303,8 @@ export type Scripts = { | ||
/** | ||
Conditions which provide a way to resolve a package entry point based on the environment. | ||
A mapping of conditions and the paths to which they resolve. | ||
*/ | ||
export type ExportCondition = LiteralUnion< | ||
| 'import' | ||
| 'require' | ||
| 'node' | ||
| 'node-addons' | ||
| 'deno' | ||
| 'browser' | ||
| 'electron' | ||
| 'react-native' | ||
| 'default', | ||
string | ||
>; | ||
type ExportConditions = { // eslint-disable-line @typescript-eslint/consistent-indexed-object-style | ||
[condition: string]: Exports; | ||
}; | ||
type ExportConditions = {[condition in ExportCondition]: Exports}; | ||
/** | ||
@@ -295,12 +317,12 @@ Entry points of a module, optionally with conditions and subpath exports. | ||
| Array<string | ExportConditions> | ||
| ExportConditions | ||
| {[path: string]: Exports}; // eslint-disable-line @typescript-eslint/consistent-indexed-object-style | ||
| ExportConditions; | ||
/** | ||
Import map entries of a module, optionally with conditions. | ||
Import map entries of a module, optionally with conditions and subpath imports. | ||
*/ | ||
export type Imports = { // eslint-disable-line @typescript-eslint/consistent-indexed-object-style | ||
[key: string]: string | {[key in ExportCondition]: Exports}; | ||
[key: `#${string}`]: Exports; | ||
}; | ||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions | ||
export interface NonStandardEntryPoints { | ||
@@ -338,3 +360,3 @@ /** | ||
export interface TypeScriptConfiguration { | ||
export type TypeScriptConfiguration = { | ||
/** | ||
@@ -354,8 +376,8 @@ Location of the bundled TypeScript declaration file. | ||
typings?: string; | ||
} | ||
}; | ||
/** | ||
An alternative configuration for Yarn workspaces. | ||
An alternative configuration for workspaces. | ||
*/ | ||
export interface WorkspaceConfig { | ||
export type WorkspaceConfig = { | ||
/** | ||
@@ -369,6 +391,7 @@ An array of workspace pattern strings which contain the workspace packages. | ||
[Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) | ||
[Supported](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) by Yarn. | ||
[Not supported](https://github.com/npm/rfcs/issues/287) by npm. | ||
*/ | ||
nohoist?: WorkspacePattern[]; | ||
} | ||
}; | ||
@@ -386,13 +409,4 @@ /** | ||
export interface YarnConfiguration { | ||
export type YarnConfiguration = { | ||
/** | ||
Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/). | ||
Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass. | ||
Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces. | ||
*/ | ||
workspaces?: WorkspacePattern[] | WorkspaceConfig; | ||
/** | ||
If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`. | ||
@@ -408,5 +422,5 @@ | ||
resolutions?: Dependency; | ||
} | ||
}; | ||
export interface JSPMConfiguration { | ||
export type JSPMConfiguration = { | ||
/** | ||
@@ -416,3 +430,3 @@ JSPM configuration. | ||
jspm?: PackageJson$1; | ||
} | ||
}; | ||
@@ -422,2 +436,3 @@ /** | ||
*/ | ||
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions | ||
export interface PackageJsonStandard { | ||
@@ -552,3 +567,3 @@ /** | ||
*/ | ||
config?: Record<string, unknown>; | ||
config?: JsonObject; | ||
@@ -594,3 +609,3 @@ /** | ||
engines?: { | ||
[EngineName in 'npm' | 'node' | string]?: string; | ||
[EngineName in 'npm' | 'node' | string]?: string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents | ||
}; | ||
@@ -694,9 +709,37 @@ | ||
}; | ||
/** | ||
Used to configure [npm workspaces](https://docs.npmjs.com/cli/using-npm/workspaces) / [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/). | ||
Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run your install command once in order to install all of them in a single pass. | ||
Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces. | ||
*/ | ||
workspaces?: WorkspacePattern[] | WorkspaceConfig; | ||
} | ||
export interface PublishConfig { | ||
/** | ||
Type for [`package.json` file used by the Node.js runtime](https://nodejs.org/api/packages.html#nodejs-packagejson-field-definitions). | ||
*/ | ||
export type NodeJsStandard = { | ||
/** | ||
Defines which package manager is expected to be used when working on the current project. It can set to any of the [supported package managers](https://nodejs.org/api/corepack.html#supported-package-managers), and will ensure that your teams use the exact same package manager versions without having to install anything else than Node.js. | ||
__This field is currently experimental and needs to be opted-in; check the [Corepack](https://nodejs.org/api/corepack.html) page for details about the procedure.__ | ||
@example | ||
```json | ||
{ | ||
"packageManager": "<package manager name>@<version>" | ||
} | ||
``` | ||
*/ | ||
packageManager?: string; | ||
}; | ||
export type PublishConfig = { | ||
/** | ||
Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig). | ||
*/ | ||
[additionalProperties: string]: unknown; | ||
[additionalProperties: string]: JsonValue | undefined; | ||
@@ -721,3 +764,3 @@ /** | ||
tag?: string; | ||
} | ||
}; | ||
} | ||
@@ -731,2 +774,4 @@ | ||
type PackageJson$1 = | ||
JsonObject & | ||
PackageJson$1.NodeJsStandard & | ||
PackageJson$1.PackageJsonStandard & | ||
@@ -944,3 +989,2 @@ PackageJson$1.NonStandardEntryPoints & | ||
disable: boolean; | ||
expanded?: boolean; | ||
}>; | ||
@@ -947,0 +991,0 @@ type DocsOptions = { |
{ | ||
"name": "@storybook/react-dom-shim", | ||
"version": "0.0.0-pr-23435-sha-7496d4ba", | ||
"version": "0.0.0-pr-23479-sha-bcda497a", | ||
"description": "", | ||
@@ -56,3 +56,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@storybook/types": "0.0.0-pr-23435-sha-7496d4ba", | ||
"@storybook/types": "0.0.0-pr-23479-sha-bcda497a", | ||
"typescript": "~4.9.3" | ||
@@ -59,0 +59,0 @@ }, |
38294
5.66%1008
3.49%