import { a as RenderData } from "./chunk-BxCdsGId.js"; import { c as ThemeVars$1 } from "./chunk-By2eGsW5.js"; import { f as Channel$1 } from "./chunk-DgWlWC_3.js"; import { t as Options$3 } from "./chunk-CB2MeY3U.js"; import { Y as StrictArgTypes$3 } from "./chunk-DEJsEo3q.js"; import { a as StoryStore, i as RenderType, n as StoryRender, r as Render, s as ReporterAPI, u as StorySpecifier } from "./chunk-D4lKaBz7.js"; import { AfterEach, AnnotatedStoryFn, ArgTypes as ArgTypes$2, ArgTypesEnhancer, Args, Args as Args$2, ArgsEnhancer, ArgsFromMeta, ArgsStoryFn, BaseAnnotations, BeforeAll, BeforeEach, Canvas, CleanupCallback, CleanupCallback as CleanupCallback$1, ComponentAnnotations as ComponentAnnotations$1, ComponentId, ComponentTitle as ComponentTitle$1, Conditional, DecoratorApplicator as DecoratorApplicator$1, DecoratorFunction as DecoratorFunction$2, GlobalTypes as GlobalTypes$1, Globals, Globals as Globals$2, IncludeExcludeOptions, InputType, LegacyAnnotatedStoryFn, LegacyStoryAnnotationsOrFn as LegacyStoryAnnotationsOrFn$1, LegacyStoryFn as LegacyStoryFn$1, LoaderFunction, Meta, Parameters as Parameters$2, PartialStoryFn as PartialStoryFn$1, PlayFunction, PlayFunctionContext, ProjectAnnotations, ProjectAnnotations as BaseProjectAnnotations, Renderer, Renderer as Renderer$2, SBArrayType, SBEnumType, SBIntersectionType, SBObjectType, SBOtherType, SBScalarType, SBType as SBType$1, SBUnionType, SeparatorOptions, StepFunction, StepLabel, StepRunner as StepRunner$1, Story, StoryAnnotations as StoryAnnotations$1, StoryAnnotationsOrFn as StoryAnnotationsOrFn$1, StoryContext, StoryContext as StoryContext$2, StoryContextForEnhancers as StoryContextForEnhancers$1, StoryContextForLoaders, StoryContextUpdate as StoryContextUpdate$1, StoryFn, StoryId, StoryId as StoryId$2, StoryIdentifier, StoryKind, StoryName as StoryName$1, StrictArgTypes, StrictArgTypes as StrictArgTypes$2, StrictArgs, StrictInputType, Tag, Tag as Tag$2, TestFunction as TestFunction$1, ViewMode, toId } from "storybook/internal/csf"; import React$1, { Component, FC, PropsWithChildren, ReactElement, ReactNode } from "react"; import { Channel, ChannelLike, Listener, Listener as Listener$2 } from "storybook/internal/channels"; import { NavigateOptions, RouterData } from "storybook/internal/router"; import { API_ComponentEntry as API_ComponentEntry$1, API_ComposedRef, API_ComposedRef as API_ComposedRef$2, API_ComposedRefUpdate, API_DocsEntry, API_DocsEntry as API_DocsEntry$2, API_FilterFunction, API_GroupEntry as API_GroupEntry$1, API_HashEntry, API_HashEntry as API_HashEntry$2, API_IframeRenderer, API_IndexHash, API_IndexHash as API_IndexHash$2, API_Layout, API_LayoutCustomisations, API_LeafEntry, API_LeafEntry as API_LeafEntry$2, API_LoadedRefData, API_Notification, API_OptionsData, API_PanelPositions, API_PreparedStoryIndex, API_Provider, API_ProviderData, API_Refs, API_Refs as API_Refs$2, API_RootEntry as API_RootEntry$1, API_SetRefData, API_Settings, API_StateMerger, API_StoryEntry, API_StoryEntry as API_StoryEntry$2, API_TestEntry, API_UI, API_UnknownEntries, API_Version, API_Versions, API_ViewMode, Addon_BaseType, Addon_Collection, Addon_Config, Addon_PageType, Addon_StorySortParameterV7, Addon_StoryWrapper, Addon_TestProviderType, Addon_Type as Addon_Type$1, Addon_Types, Addon_TypesEnum, Addon_TypesEnum as Addon_TypesEnum$2, Addon_TypesMapping, Addon_WrapperType, ArgTypes as ArgTypes$1, Args as Args$1, CSFFile, ComponentAnnotations, ComposeStoryFn, ComposedStoryFn, DecoratorFunction as DecoratorFunction$1, DocsContextProps, GlobalTypes, Globals as Globals$1, IndexEntry, LegacyStoryAnnotationsOrFn, LegacyStoryFn, ModuleExport, ModuleExports, ModuleImportFn, ModuleResolveConfig as ModuleResolveConfig$1, NamedOrDefaultProjectAnnotations, NormalizedComponentAnnotations, NormalizedProjectAnnotations, NormalizedStoriesSpecifier, NormalizedStoryAnnotations, Parameters as Parameters$1, PartialStoryFn, Path, PreparedStory, ProjectAnnotations as ProjectAnnotations$1, RenderContextCallbacks, RenderToCanvas, Renderer as Renderer$1, ResolvedModuleExportFromType, ResolvedModuleExportType, StatusValue, StepRunner, Store_CSFExports, StoryAnnotationsOrFn, StoryContext as StoryContext$1, StoryContextForEnhancers, StoryContextUpdate, StoryId as StoryId$1, StoryIndex, StoryName, StoryRenderOptions, StrictArgTypes as StrictArgTypes$1, Tag as Tag$1, TagsOptions, ViewMode as ViewMode$1 } from "storybook/internal/types"; import { ThemeVars } from "storybook/theming"; import { ArgTypesRequestPayload, OpenInEditorResponsePayload, RequestData, WhatsNewData } from "storybook/internal/core-events"; import { ImportEdge } from "storybook/internal/oxc-parser"; import { FileSystemCache } from "storybook/internal/common"; import { StoryIndexGenerator } from "storybook/internal/core-server"; import { CsfFile } from "storybook/internal/csf-tools"; import { LogLevel } from "storybook/internal/node-logger"; import { IncomingMessage, Server, ServerResponse } from "http"; import { Server as Server$1 } from "net"; //#region code/core/.dts-emit/code/core/src/channels/mock-channel.d.ts /** In-process channel with no transport — the default for unit tests and manager story mocks. */ declare function mockChannel(): Channel$1; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/lib/addons.d.ts declare class AddonStore$1 { constructor(); private loaders; private elements; private config; private channel; private promise; private resolve; getChannel: () => Channel; ready: () => Promise; hasChannel: () => boolean; setChannel: (channel: Channel) => void; getElements(type: T): Addon_Collection | any; /** * Adds an addon to the addon store. * * @param {string} id - The id of the addon. * @param {Addon_Type} addon - The addon to add. * @returns {void} */ add(id: string, addon: Addon_BaseType | Omit | Omit | Omit): void; setConfig: (value: Addon_Config) => void; getConfig: () => Addon_Config; /** * Registers an addon loader function. * * @param {string} id - The id of the addon loader. * @param {(api: API) => void} callback - The function that will be called to register the addon. * @returns {void} */ register: (id: string, callback: (api: API) => void) => void; loadAddons: (api: any) => void; experimental_getRegisteredAddons(type?: T): string[]; } declare const addons$1: AddonStore$1; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/store.d.ts type GetState = () => State; type SetState = (a: any, b: any) => any; interface Upstream { /** * Whether to allow persistence of state to local/sessionStorage. This is used to disable * persistence in Storybook's own tests. True by default. */ allowPersistence?: boolean; getState: GetState; setState: SetState; } type Patch = Partial; type InputFnPatch = (s: State) => Patch; type InputPatch = Patch | InputFnPatch; type PersistenceHandler = (patch: Partial, serialize: ((s: State) => Partial>) | undefined) => void | Promise; interface Options$2 { persistence: 'none' | 'session' | 'url' | string; serialize?: (s: State) => Partial>; } type CallBack = (s: State) => void; declare class Store { upstreamPersistence: boolean; upstreamGetState: GetState; upstreamSetState: SetState; private persistenceHandlers; constructor({ allowPersistence, setState, getState }: Upstream); registerPersistenceHandler(key: string, handler: PersistenceHandler): void; getInitialState(base: State): any; getState(): State; setState(inputPatch: InputPatch, options?: Options$2): Promise; setState(inputPatch: InputPatch, callback?: CallBack, options?: Options$2): Promise; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/lib/types.d.ts type ModuleFn = (m: ModuleArgs, options?: any) => { init?: () => void | Promise; api: APIType; state: StateType; }; type ModuleArgs = RouterData & API_ProviderData & { mode?: 'production' | 'development'; state: State; fullAPI: API; store: Store; }; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/addons.d.ts interface SubAPI$13 { /** * Returns a collection of elements of a specific type. * * @template T - The type of the elements in the collection. * @param {Addon_Types | Addon_TypesEnum.experimental_PAGE} type - The type of the elements to * retrieve. * @returns {Addon_Collection} - A collection of elements of the specified type. * @protected This is used internally in storybook's manager. */ getElements: (type: T) => Addon_Collection; /** * Clears statuses for all registered test providers by calling each provider's `clear` function. */ clearStatuses: () => void; /** * Returns the id of the currently selected panel. * * @returns {string} - The ID of the currently selected panel. */ getSelectedPanel: () => string; /** * Sets the currently selected panel via it's ID. * * @param {string} panelName - The ID of the panel to select. * @returns {void} */ setSelectedPanel: (panelName: string) => void; /** * Sets the state of an addon with the given ID. * * @deprecated This API might get dropped, if you are using this, please file an issue. * @template S - The type of the addon state. * @param {string} addonId - The ID of the addon to set the state for. * @param {S | API_StateMerger} newStateOrMerger - The new state to set, or a function which * receives the current state and returns the new state. * @param {Options} [options] - Optional options for the state update. * @returns {Promise} - A promise that resolves with the new state after it has been set. */ setAddonState(addonId: string, newStateOrMerger: S | API_StateMerger, options?: Options$2): Promise; /** * Returns the state of an addon with the given ID. * * @deprecated This API might get dropped, if you are using this, please file an issue. * @template S - The type of the addon state. * @param {string} addonId - The ID of the addon to get the state for. * @returns {S} - The state of the addon with the given ID. */ getAddonState(addonId: string): S; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/channel.d.ts interface SubAPI$12 { /** * Returns the channel object. * * @protected Please do not use, it's for internal use only. */ getChannel: () => API_Provider['channel']; /** * Adds a listener to the channel for the given event type. Returns a function that can be called * to remove the listener. * * @param type - The event type to listen for. If using a core event, import it from * `storybook/internal/core-events`. * @param handler - The callback function to be called when the event is emitted. * @returns A function that can be called to remove the listener. */ on: (type: string, handler: Listener) => () => void; /** * Removes a listener from the channel for the given event type. * * @param type - The event type to remove the listener from. If using a core event, import it from * `storybook/internal/core-events`. * @param handler - The callback function to be removed. */ off: (type: string, handler: Listener) => void; /** * Emits an event on the channel for the given event type. * * @param type - The event type to emit. If using a core event, import it from * `storybook/internal/core-events`. * @param args - The arguments to pass to the event listener. */ emit: (type: string, ...args: any[]) => void; /** * Adds a one-time listener to the channel for the given event type. * * @param type - The event type to listen for. If using a core event, import it from * `storybook/internal/core-events`. * @param handler - The callback function to be called when the event is emitted. */ once: (type: string, handler: Listener) => void; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/globals.d.ts interface SubState$9 { globals?: Globals$1; userGlobals?: Globals$1; storyGlobals?: Globals$1; globalTypes?: GlobalTypes; } interface SubAPI$11 { /** * Returns the current globals, which is the user globals overlaid with the story globals * * @returns {Globals} The current globals. */ getGlobals: () => Globals$1; /** * Returns the current globals, as set by the user (a story may have override values) * * @returns {Globals} The current user globals. */ getUserGlobals: () => Globals$1 /** * /** Returns the current globals, as set by the story * * @returns {Globals} The current story globals. */ ; getStoryGlobals: () => Globals$1 /** * Returns the globalTypes, as defined at the project level. * * @returns {GlobalTypes} The globalTypes. */ ; getGlobalTypes: () => GlobalTypes; /** * Updates the current globals with the provided new globals. * * @param {Globals} newGlobals - The new globals to update with. * @returns {void} */ updateGlobals: (newGlobals: Globals$1) => void; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/layout.d.ts interface SubState$8 { layout: API_Layout; layoutCustomisations: API_LayoutCustomisations; ui: API_UI; selectedPanel: string | undefined; theme: ThemeVars; } /** * Availability of the sidebar/nav: 'unavailable' means the current route suppresses the nav * entirely (review routes), otherwise it is 'shown' or 'hidden' based on the layout state. */ type NavAvailability = 'shown' | 'hidden' | 'unavailable'; interface SubAPI$10 { /** * Toggles the fullscreen mode of the Storybook UI. * * @param toggled - Optional boolean value to set the fullscreen mode to. If not provided, it will * toggle the current state. */ toggleFullscreen: (toggled?: boolean) => void; /** * Toggles the visibility of the panel in the Storybook UI. * * @param toggled - Optional boolean value to set the panel visibility to. If not provided, it * will toggle the current state. */ togglePanel: (toggled?: boolean) => void; /** * Toggles the position of the panel in the Storybook UI. * * @param position - Optional string value to set the panel position to. If not provided, it will * toggle between 'bottom' and 'right'. */ togglePanelPosition: (position?: API_PanelPositions) => void; /** * Toggles the visibility of the navigation bar in the Storybook UI. * * @param toggled - Optional boolean value to set the navigation bar visibility to. If not * provided, it will toggle the current state. */ toggleNav: (toggled?: boolean) => void; /** * Toggles the visibility of the toolbar in the Storybook UI. * * @param toggled - Optional boolean value to set the toolbar visibility to. If not provided, it * will toggle the current state. */ toggleToolbar: (toggled?: boolean) => void; /** * Sets the options for the Storybook UI. * * @param options - An object containing the options to set. */ setOptions: (options: any) => void; /** Sets the sizes of the resizable elements in the layout. */ setSizes: (options: Partial>) => void; /** GetIsFullscreen - Returns the current fullscreen mode of the Storybook UI. */ getIsFullscreen: () => boolean; /** GetIsPanelShown - Returns the current visibility of the panel in the Storybook UI. */ getIsPanelShown: () => boolean; /** GetIsNavShown - Returns the current visibility of the navigation bar in the Storybook UI. */ getIsNavShown: () => boolean; /** * GetNavAvailability - Returns whether the sidebar/nav is shown, hidden (but can be shown by the * user), or unavailable because the current route suppresses it entirely (review routes). */ getNavAvailability: () => NavAvailability; /** * GetShowToolbarWithCustomisations - Returns the current visibility of the toolbar, taking into * account customisations requested by the end user via a layoutCustomisations function. */ getShowToolbarWithCustomisations: (showToolbar: boolean) => boolean; /** * GetShowPanelWithCustomisations - Returns the current visibility of the addon panel, taking into * account customisations requested by the end user via a layoutCustomisations function. */ getShowPanelWithCustomisations: (showPanel: boolean) => boolean; /** * GetNavSizeWithCustomisations - Returns the size to apply to the sidebar/nav, taking into * account customisations requested by the end user via a layoutCustomisations function. */ getNavSizeWithCustomisations: (navSize: number) => number; /** * Attempts to focus an element identified by its ID. * * @param elementId - The id of the element to focus. * @param options - Options for focusing the element. * @param options.forceFocus - Whether to make the element focusable even though it wasn't. * @param options.select - Whether to call select() on the element after focusing it. * @param options.poll - Whether to poll for the element if it is not immediately available. * Defaults to true. When true, polls every 50ms for up to 500ms. * @returns Whether the element was successfully focused. Returns a Promise when polling. */ focusOnUIElement: (elementId?: string, options?: boolean | { forceFocus?: boolean; select?: boolean; poll?: boolean; }) => boolean | Promise; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/notifications.d.ts interface SubState$7 { notifications: API_Notification[]; } /** The API for managing notifications. */ interface SubAPI$9 { /** * Adds a new notification to the list of notifications. If a notification with the same ID * already exists, it will be replaced. * * @param notification - The notification to add. */ addNotification: (notification: API_Notification) => void; /** * Removes a notification from the list of notifications and calls the onClear callback. * * @param id - The ID of the notification to remove. */ clearNotification: (id: string) => void; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/open-in-editor.d.ts /** The API for opening files in the editor. */ interface SubAPI$8 { /** * Opens the file in the editor. You can optionally provide a line and column number to open at a * more specific location. */ openInEditor: (payload: { file: string; line?: number; column?: number; }) => Promise; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/provider.d.ts interface SubAPI$7 { renderPreview?: API_IframeRenderer; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/refs.d.ts interface SubState$6 { refs: API_Refs; } interface SubAPI$6 { /** * Finds a composed ref by its source. * * @param {string} source - The source/URL of the composed ref. * @returns {API_ComposedRef} - The composed ref object. */ findRef: (source: string) => API_ComposedRef; /** * Sets a composed ref by its ID and data. * * @param {string} id - The ID of the composed ref. * @param {API_SetRefData} data - The data to set for the composed ref. * @param {boolean} [ready] - Whether the composed ref is ready. */ setRef: (id: string, data: API_SetRefData, ready?: boolean) => void; /** * Updates a composed ref by its ID and update object. * * @param {string} id - The ID of the composed ref. * @param {API_ComposedRefUpdate} ref - The update object for the composed ref. */ updateRef: (id: string, ref: API_ComposedRefUpdate) => Promise; /** * Gets all composed refs. * * @returns {API_Refs} - The composed refs object. */ getRefs: () => API_Refs; /** * Checks if a composed ref is valid. * * @param {API_SetRefData} ref - The composed ref to check. * @returns {Promise} - A promise that resolves when the check is complete. */ checkRef: (ref: API_SetRefData) => Promise; /** * Changes the version of a composed ref by its ID and URL. * * @param {string} id - The ID of the composed ref. * @param {string} url - The new URL for the composed ref. */ changeRefVersion: (id: string, url: string) => Promise; /** * Changes the state of a composed ref by its ID and previewInitialized flag. * * @param {string} id - The ID of the composed ref. * @param {boolean} previewInitialized - The new previewInitialized flag for the composed ref. */ changeRefState: (id: string, previewInitialized: boolean) => void; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/settings.d.ts interface SubAPI$5 { storeSelection: () => void; retrieveSelection: () => StoryId$1; /** * Changes the active settings tab. * * @example * * ```ts * changeSettingsTab(`about`); * ``` * * @param path - The path of the settings page to navigate to. The path NOT should include the * `/settings` prefix. */ changeSettingsTab: (path: string) => void; /** Closes the settings screen and returns to the last tracked story or the first story. */ closeSettings: () => void; /** * Checks if the settings screen is currently active. * * @returns A boolean indicating whether the settings screen is active. */ isSettingsScreenActive: () => boolean; } interface SubState$5 { settings: API_Settings; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/lib/shortcut.d.ts declare const controlOrMetaSymbol: () => "ctrl" | "⌘"; declare const controlOrMetaKey: () => "control" | "meta"; declare const optionOrAltSymbol: () => "alt" | "⌥"; declare const isShortcutTaken: (arr1: string[], arr2: string[]) => boolean; type KeyboardEventLike = Pick; declare const eventToShortcut: (e: KeyboardEventLike) => (string | string[])[] | null; declare const shortcutMatchesShortcut: (inputShortcut: (string | string[])[], shortcut: API_KeyCollection) => boolean; declare const eventMatchesShortcut: (e: KeyboardEventLike, shortcut: API_KeyCollection) => boolean; /** * Returns a human-readable symbol for a keyboard key. * * @param key The key to convert to a symbol. * @returns A string that a human could understand as that keyboard key. */ declare const keyToSymbol: (key: string) => string; declare const shortcutToHumanString: (shortcut: API_KeyCollection) => string; declare const shortcutToAriaKeyshortcuts: (shortcut: API_KeyCollection) => string; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/shortcuts.d.ts interface SubState$4 { shortcuts: API_Shortcuts; } interface SubAPI$4 { /** Returns the current shortcuts. */ getShortcutKeys(): API_Shortcuts; /** Returns the default shortcuts. */ getDefaultShortcuts(): API_Shortcuts | API_AddonShortcutDefaults; /** Returns the shortcuts for addons. */ getAddonsShortcuts(): API_AddonShortcuts; /** Returns the labels for addon shortcuts. */ getAddonsShortcutLabels(): API_AddonShortcutLabels; /** Returns the default shortcuts for addons. */ getAddonsShortcutDefaults(): API_AddonShortcutDefaults; /** * Sets the shortcuts to the given value. * * @param shortcuts The new shortcuts to set. * @returns A promise that resolves to the new shortcuts. */ setShortcuts(update: API_Shortcuts | ((shortcuts: API_Shortcuts) => API_Shortcuts)): Promise; /** * Sets the shortcut for the given action to the given value. * * @param action The action to set the shortcut for. * @param value The new shortcut to set. * @returns A promise that resolves to the new shortcut. */ setShortcut(action: API_Action, value: API_KeyCollection): Promise; /** * Sets the shortcut for the given addon to the given value. * * @param addon The addon to set the shortcut for. * @param shortcut The new shortcut to set. * @returns A promise that resolves to the new addon shortcut. */ setAddonShortcut(addon: string, shortcut: API_AddonShortcut): Promise; /** * Restores all default shortcuts. * * @returns A promise that resolves to the new shortcuts. */ restoreAllDefaultShortcuts(): Promise; /** * Restores the default shortcut for the given action. * * @param action The action to restore the default shortcut for. * @returns A promise that resolves to the new shortcut. */ restoreDefaultShortcut(action: API_Action): Promise; /** * Handles a keydown event. * * @param event The event to handle. */ handleKeydownEvent(event: KeyboardEventLike): void; /** * Handles a shortcut feature. * * @param feature The feature to handle. * @param event The event to handle. */ handleShortcutFeature(feature: API_Action, event: KeyboardEventLike): void; } type API_KeyCollection = string[]; interface API_Shortcuts { fullScreen: API_KeyCollection; togglePanel: API_KeyCollection; panelPosition: API_KeyCollection; toggleNav: API_KeyCollection; toolbar: API_KeyCollection; search: API_KeyCollection; focusNav: API_KeyCollection; focusIframe: API_KeyCollection; focusPanel: API_KeyCollection; prevComponent: API_KeyCollection; nextComponent: API_KeyCollection; prevStory: API_KeyCollection; nextStory: API_KeyCollection; shortcutsPage: API_KeyCollection; aboutPage: API_KeyCollection; escape: API_KeyCollection; collapseAll: API_KeyCollection; expandAll: API_KeyCollection; remount: API_KeyCollection; openInEditor: API_KeyCollection; openInIsolation: API_KeyCollection; copyStoryLink: API_KeyCollection; goToPreviousLandmark: API_KeyCollection; goToNextLandmark: API_KeyCollection; } type API_Action = keyof API_Shortcuts; interface API_AddonShortcut { label: string; defaultShortcut: API_KeyCollection; actionName: string; showInMenu?: boolean; action: (...args: any[]) => any; } type API_AddonShortcuts = Record; type API_AddonShortcutLabels = Record; type API_AddonShortcutDefaults = Record; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/stories.d.ts type Direction = -1 | 1; type ParameterName = string; type StoryUpdate = Partial>; type DocsUpdate = Partial>; interface SubState$3 extends API_LoadedRefData { storyId: StoryId$1; internal_index?: API_PreparedStoryIndex; viewMode: API_ViewMode; filters: Record; tagPresets: TagsOptions; defaultIncludedTagFilters: Tag$1[]; defaultExcludedTagFilters: Tag$1[]; includedTagFilters: Tag$1[]; excludedTagFilters: Tag$1[]; includedStatusFilters: StatusValue[]; excludedStatusFilters: StatusValue[]; } interface SubAPI$3 { /** * The `storyId` method is a reference to the `toId` function from `@storybook/csf`, which is used * to generate a unique ID for a story. This ID is used to identify a specific story in the * Storybook index. * * @type {typeof toId} */ storyId: typeof toId; /** * Resolves a story, docs, component or group ID to its corresponding hash entry in the index. * * @param {StoryId} storyId - The ID of the story to resolve. * @param {string} [refsId] - The ID of the refs to use for resolving the story. * @returns {API_HashEntry} - The hash entry corresponding to the given story ID. */ resolveStory: (storyId: StoryId$1, refsId?: string) => API_HashEntry | undefined; /** * Selects the first story to display in the Storybook UI. * * @returns {void} */ selectFirstStory: () => void; /** * Selects a story to display in the Storybook UI. * * @param {string} [kindOrId] - The kind or ID of the story to select. * @param {StoryId} [story] - The ID of the story to select. * @param {Object} [obj] - An optional object containing additional options. * @param {string} [obj.ref] - The ref ID of the story to select. * @param {API_ViewMode} [obj.viewMode] - The view mode to display the story in. * @returns {void} */ selectStory: (kindOrId?: string, story?: StoryId$1, obj?: { ref?: string; viewMode?: API_ViewMode; }) => void; /** * Returns the current story's data, including its ID, kind, name, and parameters. * * @returns {API_LeafEntry} The current story's data. */ getCurrentStoryData: () => API_LeafEntry; /** * Returns the current story index. * * @returns {API_PreparedStoryIndex | undefined} The current story index, or undefined if not yet * loaded. */ getIndex: () => API_PreparedStoryIndex | undefined; /** * Sets the prepared story index to the given value. * * @param {API_PreparedStoryIndex} index - The prepared story index to set. * @returns {Promise} A promise that resolves when the prepared story index has been set. */ setIndex: (index: API_PreparedStoryIndex) => Promise; /** * Jumps to the next or previous component in the index. * * @param {Direction} direction - The direction to jump. Use -1 to jump to the previous component, * and 1 to jump to the next component. * @returns {void} */ jumpToComponent: (direction: Direction) => void; /** * Jumps to the next or previous story in the story index. * * @param {Direction} direction - The direction to jump. Use -1 to jump to the previous story, and * 1 to jump to the next story. * @returns {void} */ jumpToStory: (direction: Direction) => void; /** * Returns the data for the given story ID and optional ref ID. * * @param {StoryId} storyId - The ID of the story to retrieve data for. * @param {string} [refId] - The ID of the ref to retrieve data for. If not provided, retrieves * data for the default ref. * @returns {API_LeafEntry} The data for the given story ID and optional ref ID. */ getData: (storyId: StoryId$1, refId?: string) => API_LeafEntry; /** * Returns a boolean indicating whether the given story ID and optional ref ID have been prepared. * * @param {StoryId} storyId - The ID of the story to check. * @param {string} [refId] - The ID of the ref to check. If not provided, checks all refs for the * given story ID. * @returns {boolean} A boolean indicating whether the given story ID and optional ref ID have * been prepared. */ isPrepared: (storyId: StoryId$1, refId?: string) => boolean; /** * Returns the parameters for the given story ID and optional ref ID. * * @param {StoryId | { storyId: StoryId; refId: string }} storyId - The ID of the story to * retrieve parameters for, or an object containing the story ID and ref ID. * @param {ParameterName} [parameterName] - The name of the parameter to retrieve. If not * provided, returns all parameters. * @returns {API_StoryEntry['parameters'] | any} The parameters for the given story ID and * optional ref ID. */ getParameters: (storyId: StoryId$1 | { storyId: StoryId$1; refId: string; }, parameterName?: ParameterName) => API_StoryEntry['parameters'] | any; /** * Returns the current value of the specified parameter for the currently selected story. * * @template S - The type of the parameter value. * @param {ParameterName} [parameterName] - The name of the parameter to retrieve. If not * provided, returns all parameters. * @returns {S} The value of the specified parameter for the currently selected story. */ getCurrentParameter(parameterName?: ParameterName): S; /** * Updates the arguments for the given story with the provided new arguments. * * @param {API_StoryEntry | API_TestEntry} story - The story to update the arguments for. * @param {Args} newArgs - The new arguments to set for the story. * @returns {void} */ updateStoryArgs(story: API_StoryEntry | API_TestEntry, newArgs: Args$1): void; /** * Resets the arguments for the given story to their initial values. * * @param {API_StoryEntry | API_TestEntry} story - The story to reset the arguments for. * @param {string[]} [argNames] - An optional array of argument names to reset. If not provided, * all arguments will be reset. * @returns {void} */ resetStoryArgs: (story: API_StoryEntry | API_TestEntry, argNames?: string[]) => void; /** * Finds the leaf entry for the given story ID in the given story index. * * @param {API_IndexHash} index - The story index to search for the leaf entry in. * @param {StoryId} storyId - The ID of the story to find the leaf entry for. * @returns {API_LeafEntry | undefined} The leaf entry for the given story ID, or undefined if no * leaf entry was found. */ findLeafEntry(index: API_IndexHash, storyId: StoryId$1): API_LeafEntry | undefined; /** * Finds the leaf story ID for the given component or group ID in the given index. * * @param {API_IndexHash} index - The story index to search for the leaf story ID in. * @param {StoryId} storyId - The ID of the story to find the leaf story ID for. * @returns {StoryId | undefined} The ID of the leaf story, or undefined if no leaf story was * found. */ findLeafStoryId(index: API_IndexHash, storyId: StoryId$1): StoryId$1 | undefined; /** * Finds all the leaf story IDs for the given entry ID in the given index. * * @param {StoryId} entryId - The ID of the entry to find the leaf story IDs for. * @returns {StoryId[]} The IDs of all the leaf stories, or an empty array if no leaf stories were * found. */ findAllLeafStoryIds(entryId: string): StoryId$1[]; /** * Finds the ID of the sibling story in the given direction for the given story ID in the given * story index. * * @param {StoryId} storyId - The ID of the story to find the sibling of. * @param {API_IndexHash} index - The story index to search for the sibling in. * @param {Direction} direction - The direction to search for the sibling in. * @param {boolean} toSiblingGroup - When true, skips over leafs within the same group. * @returns {StoryId} The ID of the sibling story, or null if no sibling was found. */ findSiblingStoryId(storyId: StoryId$1, index: API_IndexHash, direction: Direction, toSiblingGroup: boolean): StoryId$1; /** * Fetches the story index from the server. * * @returns {Promise} A promise that resolves when the index has been fetched. */ fetchIndex: () => Promise; /** * Updates the story with the given ID with the provided update object. * * @param {StoryId} storyId - The ID of the story to update. * @param {StoryUpdate} update - An object containing the updated story information. * @param {API_ComposedRef} [ref] - The composed ref of the story to update. * @returns {Promise} A promise that resolves when the story has been updated. */ updateStory: (storyId: StoryId$1, update: StoryUpdate, ref?: API_ComposedRef) => Promise; /** * Updates the documentation for the given story ID with the given update object. * * @param {StoryId} storyId - The ID of the story to update. * @param {DocsUpdate} update - An object containing the updated documentation information. * @param {API_ComposedRef} [ref] - The composed ref of the story to update. * @returns {Promise} A promise that resolves when the documentation has been updated. */ updateDocs: (storyId: StoryId$1, update: DocsUpdate, ref?: API_ComposedRef) => Promise; /** * Sets the preview as initialized. * * @param {ComposedRef} [ref] - The composed ref of the story to set as initialized. * @returns {Promise} A promise that resolves when the preview has been set as initialized. */ setPreviewInitialized: (ref?: API_ComposedRef$2) => Promise; /** * Updates the filtering of the index. * * @param {string} addonId - The ID of the addon to update. * @param {API_FilterFunction} filterFunction - A function that returns a boolean based on the * story, index and status. * @returns {Promise} A promise that resolves when the state has been updated. */ experimental_setFilter: (addonId: string, filterFunction: API_FilterFunction) => Promise; /** Resets tag filters in the sidebar to the default filters. */ resetTagFilters(): Promise; /** * Replaces all tag filters in the sidebar with the provided included and excluded lists. * * @param included The tags to include in the filtered stories list * @param excluded The tags to filter out (exclude) from the stories list */ setAllTagFilters(included: Tag$1[], excluded: Tag$1[]): Promise; /** * Adds tag filters to the included or excluded filter lists. Included filters are included in the * stories list, whereas excluded filters are filtered out. * * @param tags The tags to add as filters. * @param excluded Whether to add the tags to the include or exclude filter list. */ addTagFilters(tags: Tag$1[], excluded: boolean): Promise; /** * Removes tag filters from both the included and excluded filter lists. * * @param tags The tags to remove from filters. */ removeTagFilters(tags: Tag$1[]): Promise; /** Resets status filters in the sidebar (clears both included and excluded). */ resetStatusFilters(): Promise; /** * Replaces all status filters in the sidebar with the provided included and excluded lists. * * @param included The status values to include in the filtered stories list * @param excluded The status values to filter out (exclude) from the stories list */ setAllStatusFilters(included: StatusValue[], excluded: StatusValue[]): Promise; /** * Adds status filters to the included or excluded filter lists. * * @param statuses The status values to add as filters. * @param excluded Whether to add to the include or exclude filter list. */ addStatusFilters(statuses: StatusValue[], excluded: boolean): Promise; /** * Removes status filters from both the included and excluded filter lists. * * @param statuses The status values to remove from filters. */ removeStatusFilters(statuses: StatusValue[]): Promise; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/url.d.ts interface SubState$2 { customQueryParams: QueryParams; } interface QueryParams { [key: string]: string | undefined; } interface QueryParamInput { [key: string]: string | undefined | null; } /** SubAPI for managing URL navigation and state. */ interface SubAPI$2 { /** * Navigate to a new URL. * * @param {string} url - The URL to navigate to. * @param {NavigateOptions} options - Options for the navigation. * @returns {void} */ navigateUrl: (url: string, options: NavigateOptions) => void; /** * Get the manager and preview hrefs for a story. * * @param {string} storyId - The ID of the story to get the URL for. * @param {Object} options - Options for the URL. * @param {string} [options.base] - Return an absolute href based on the current origin or network * address. * @param {boolean} [options.inheritArgs] - Inherit args from the current URL. If storyId matches * current story, inheritArgs defaults to true. * @param {boolean} [options.inheritGlobals] - Inherit globals from the current URL. Defaults to * true. * @param {QueryParams} [options.queryParams] - Query params to add to the URL. * @param {string} [options.refId] - ID of the ref to get the URL for (for composed Storybooks) * @param {string} [options.viewMode] - The view mode to use, defaults to 'story'. * @param {boolean} [options.embed] - Append `embed=true` so the preview broadcasts * content dimensions to an embedding parent via `iframe.resize` postMessage. Affects * `previewHref` only. * @param {boolean} [options.freeze] - Append the `freeze=finished` preview contract so the * preview settles to a static end frame and blocks interaction. Affects `previewHref` only. * @returns {Object} Manager and preview hrefs for the story. */ getStoryHrefs(storyId: string, options?: { base?: 'origin' | 'network'; inheritArgs?: boolean; inheritGlobals?: boolean; queryParams?: QueryParams; refId?: string; viewMode?: API_ViewMode; embed?: boolean; freeze?: boolean; }): { managerHref: string; previewHref: string; }; /** * Get the value of a query parameter from the current URL. * * @param {string} key - The key of the query parameter to get. * @returns {string | undefined} The value of the query parameter, or undefined if it does not * exist. */ getQueryParam: (key: string) => string | undefined; /** * Returns an object containing the current state of the URL. * * @returns {{ * queryParams: QueryParams; * path: string; * viewMode?: string; * storyId?: string; * url: string; * }} * An object containing the current state of the URL. */ getUrlState: () => { queryParams: QueryParams; path: string; hash: string; viewMode?: string; storyId?: string; url: string; }; /** * Set the query parameters for the current URL. * * @param {QueryParams} input - An object containing the query parameters to set. * @returns {void} */ setQueryParams: (input: QueryParamInput) => void; /** * Set the query parameters for the current URL & navigates. * * @param {QueryParams} input - An object containing the query parameters to set. * @param {NavigateOptions} options - Options for the navigation. * @returns {void} */ applyQueryParams: (input: QueryParamInput, options?: NavigateOptions) => void; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/versions.d.ts interface SubState$1 { versions: API_Versions & API_UnknownEntries; lastVersionCheck: number; dismissedVersionNotification: undefined | string; } interface SubAPI$1 { /** * Returns the current version of the Storybook Manager. * * @returns {API_Version} The current version of the Storybook Manager. */ getCurrentVersion: () => API_Version; /** * Returns the latest version of the Storybook Manager. * * @returns {API_Version} The latest version of the Storybook Manager. */ getLatestVersion: () => API_Version; /** * Returns the URL of the Storybook documentation for the current version. * * @param options - The options for the documentation URL. * @param options.asset - Like subpath, but links to the docs-assets directory. * @param options.subpath - The subpath of the documentation URL. * @param options.versioned - Whether to include the versioned path. * @param options.renderer - Whether to include the renderer path. * @param options.ref - Tracking reference for the docs site. E.g. 'ui', 'error', 'upgrade', etc. * @returns {string} The URL of the Storybook Manager documentation. */ getDocsUrl: (options: { asset?: string; subpath?: string; versioned?: boolean; renderer?: boolean; ref?: string; }) => string; /** * Checks if an update is available for the Storybook Manager. * * @returns {boolean} True if an update is available, false otherwise. */ versionUpdateAvailable: () => boolean; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/modules/whatsnew.d.ts type SubState = { whatsNewData?: WhatsNewData; }; type SubAPI = { isWhatsNewUnread(): boolean; whatsNewHasBeenRead(): void; toggleWhatsNewNotifications(): void; }; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/lib/request-response.d.ts declare class RequestResponseError | void> extends Error { payload: Payload | undefined; constructor(message: string, payload?: Payload); } declare const experimental_requestResponse: | void = void>(channel: Channel, requestEvent: string, responseEvent: string, payload: RequestPayload, timeout?: number) => Promise; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/lib/platform.d.ts declare const isMacLike: () => boolean; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/lib/merge.d.ts declare function _default(a: TObj, ...b: Partial[]): TObj; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/root.d.ts declare const ActiveTabs: { SIDEBAR: 'sidebar'; CANVAS: 'canvas'; ADDONS: 'addons'; }; declare const ManagerContext: React$1.Context<{ api: API; state: State; }>; type State = SubState$8 & SubState$3 & SubState$6 & SubState$7 & SubState$1 & SubState$2 & SubState$4 & SubState$5 & SubState$9 & SubState & RouterData & API_OptionsData & Other; type API = SubAPI$13 & SubAPI$12 & SubAPI$7 & SubAPI$3 & SubAPI$6 & SubAPI$11 & SubAPI$10 & SubAPI$9 & SubAPI$4 & SubAPI$5 & SubAPI$1 & SubAPI$2 & SubAPI & SubAPI$8 & Other; interface Other { [key: string]: any; } interface Combo { api: API; state: State; } type ManagerProviderProps = RouterData & API_ProviderData & { children: ReactNode | FC; }; declare const combineParameters$1: (...parameterSets: Parameters$1[]) => {}; declare class ManagerProvider extends Component { api: API; modules: ReturnType[]; mounted: boolean; static displayName: string; constructor(props: ManagerProviderProps); componentDidMount(): void; static getDerivedStateFromProps(props: ManagerProviderProps, state: State): State; shouldComponentUpdate(nextProps: ManagerProviderProps, nextState: State): boolean; initModules: () => void; render(): React$1.JSX.Element; } interface ManagerConsumerProps

{ filter?: (combo: Combo) => P; children: FC

| ReactNode; } declare function ManagerConsumer

({ filter, children }: ManagerConsumerProps

): ReactElement; declare function useStorybookState(): State; declare function useStorybookApi(): API; interface API_EventMap { [eventId: string]: Listener$2; } declare const useChannel: (eventMap: API_EventMap, deps?: any[]) => (type: string, ...args: any[]) => void; declare function useStoryPrepared(storyId?: StoryId$1): boolean; declare function useParameter(parameterKey: string, defaultValue?: S): S; declare function useSharedState(stateId: string, defaultState?: S): [S, (newStateOrMerger: S | API_StateMerger, options?: Options$2) => void]; declare function useAddonState(addonId: string, defaultState?: S): [S, (newStateOrMerger: S | API_StateMerger, options?: Options$2) => void]; declare function useArgs(): [Args$1, (newArgs: Args$1) => void, (argNames?: string[]) => void, Args$1]; declare function useGlobals(): [globals: Globals$1, updateGlobals: (newGlobals: Globals$1) => void, storyGlobals: Globals$1, userGlobals: Globals$1]; declare function useGlobalTypes(): GlobalTypes; declare function useArgTypes(): ArgTypes$1; declare const typesX: typeof Addon_TypesEnum$2; //#endregion //#region code/core/.dts-emit/code/core/src/shared/universal-store/types.d.ts type EnvironmentType = (typeof UniversalStore.Environment)[keyof typeof UniversalStore.Environment]; type StatusType = (typeof UniversalStore.Status)[keyof typeof UniversalStore.Status]; type StateUpdater = (prevState: TState) => TState; type Actor = { id: string; type: (typeof UniversalStore.ActorType)[keyof typeof UniversalStore.ActorType]; environment: EnvironmentType; }; type EventInfo = { actor: Actor; forwardingActor?: Actor; }; type Listener$1 = (event: TEvent, eventInfo: EventInfo) => void; type BaseEvent = { type: string; payload?: any; }; interface SetStateEvent extends BaseEvent { type: typeof UniversalStore.InternalEventType.SET_STATE; payload: { state: TState; previousState: TState; }; } interface ExistingStateRequestEvent extends BaseEvent { type: typeof UniversalStore.InternalEventType.EXISTING_STATE_REQUEST; payload: never; } interface ExistingStateResponseEvent extends BaseEvent { type: typeof UniversalStore.InternalEventType.EXISTING_STATE_RESPONSE; payload: TState; } interface LeaderCreatedEvent extends BaseEvent { type: typeof UniversalStore.InternalEventType.LEADER_CREATED; payload: never; } interface FollowerCreatedEvent extends BaseEvent { type: typeof UniversalStore.InternalEventType.FOLLOWER_CREATED; payload: never; } type InternalEvent = SetStateEvent | ExistingStateRequestEvent | ExistingStateResponseEvent | FollowerCreatedEvent | LeaderCreatedEvent; type Event = TEvent | InternalEvent; type ChannelLike$1 = Pick; type StoreOptions = { id: string; leader?: boolean; initialState?: TState; debug?: boolean; }; type EnvironmentOverrides = { channel: ChannelLike$1; environment: EnvironmentType; }; //#endregion //#region code/core/.dts-emit/code/core/src/shared/universal-store/index.d.ts /** * A universal store implementation that synchronizes state across different environments using a * channel-based communication. * * The store follows a leader-follower pattern where: * * - Leader: The main store instance that owns and manages the state * - Follower: Store instances that mirror the leader's state * * Features: * * - State synchronization across environments * - Event-based communication * - Type-safe state and custom events * - Subscription system for state changes and custom events * * @remarks * - The store must be created using the static `create()` method, not the constructor * - Follower stores will automatically sync with their leader's state. If they have initial state, it * will be replaced immediately when it has synced with the leader. * * @example * * ```typescript * interface MyState { * count: number; * } * interface MyCustomEvent { * type: 'INCREMENT'; * payload: number; * } * * // Create a leader store * const leaderStore = UniversalStore.create({ * id: 'my-store', * leader: true, * initialState: { count: 0 }, * }); * * // Create a follower store * const followerStore = UniversalStore.create({ * id: 'my-store', * leader: false, * }); * ``` * * @template State - The type of state managed by the store * @template CustomEvent - Custom events that can be sent through the store. Must have a `type` * string and optional `payload` * @throws {Error} If constructed directly instead of using `create()` * @throws {Error} If created without setting a channel first * @throws {Error} If a follower is created with initial state * @throws {Error} If a follower cannot find its leader within 1 second */ declare class UniversalStore { /** * Defines the possible actor types in the store system * * @readonly */ static readonly ActorType: { readonly LEADER: 'LEADER'; readonly FOLLOWER: 'FOLLOWER'; }; /** * Defines the possible environments the store can run in * * @readonly */ static readonly Environment: { readonly SERVER: 'SERVER'; readonly MANAGER: 'MANAGER'; readonly PREVIEW: 'PREVIEW'; readonly UNKNOWN: 'UNKNOWN'; readonly MOCK: 'MOCK'; }; /** * Internal event types used for store synchronization * * @readonly */ static readonly InternalEventType: { readonly EXISTING_STATE_REQUEST: '__EXISTING_STATE_REQUEST'; readonly EXISTING_STATE_RESPONSE: '__EXISTING_STATE_RESPONSE'; readonly SET_STATE: '__SET_STATE'; readonly LEADER_CREATED: '__LEADER_CREATED'; readonly FOLLOWER_CREATED: '__FOLLOWER_CREATED'; }; static readonly Status: { readonly UNPREPARED: 'UNPREPARED'; readonly SYNCING: 'SYNCING'; readonly READY: 'READY'; readonly ERROR: 'ERROR'; }; protected static isInternalConstructing: boolean; /** * The preparation construct is used to keep track of all store's preparation state the promise is * resolved when the store is prepared with the static __prepare() method which will also change * the state from PENDING to RESOLVED */ private static preparation; private static setupPreparationPromise; /** Enable debug logs for this store */ debugging: boolean; /** The actor object representing the store instance with a unique ID and a type */ get actor(): Actor; /** * The current state of the store, that signals both if the store is prepared by Storybook and * also - in the case of a follower - if the state has been synced with the leader's state. */ get status(): StatusType; /** * A promise that resolves when the store is fully ready. A leader will be ready when the store * has been prepared by Storybook, which is almost instantly. * * A follower will be ready when the state has been synced with the leader's state, within a few * hundred milliseconds. */ untilReady(): Promise<[void | { channel: ChannelLike$1; environment: EnvironmentType; }, void | undefined]>; /** * The syncing construct is used to keep track of if the instance's state has been synced with the * other instances. A leader will immediately have the promise resolved. A follower will initially * be in a PENDING state, and resolve when the leader has sent the existing state, or reject if no * leader has responded before the timeout. */ private syncing?; private channelEventName; private state; private channel?; private environment?; private listeners; private id; private actorId; private actorType; protected constructor(options: StoreOptions, environmentOverrides?: EnvironmentOverrides); /** Creates a new instance of UniversalStore */ static create(options: StoreOptions): UniversalStore; /** Gets the current state */ getState: () => State; /** * Updates the store's state * * Either a new state or a state updater function can be passed to the method. */ setState(updater: State | StateUpdater): void; /** * Subscribes to store events * * @returns A function to unsubscribe */ subscribe: { (listener: Listener$1>): () => void; ['type']>(eventType: EventType, listener: Listener$1, { type: EventType; }>>): () => void; }; /** * Subscribes to state changes * * @returns Unsubscribe function */ onStateChange(listener: (state: State, previousState: State, eventInfo: EventInfo) => void): () => void; /** Sends a custom event to the other stores */ send: (event: CustomEvent) => void; private emitToChannel; private prepareThis; private emitToListeners; private handleChannelEvents; private debug; } //#endregion //#region code/core/.dts-emit/code/core/src/shared/universal-store/use-universal-store-manager.d.ts /** * A hook to use a UniversalStore in the manager UI (eg. in an addon panel). This hook will react to * changes in the store state and re-render when the store changes. * * @param universalStore The UniversalStore instance to use. * @param selector An optional selector function to select a subset of the store state. * @remark This hook is intended for use in the manager UI. For use in the preview, import from * `storybook/preview-api` instead. */ declare const useUniversalStore: { , TState = (TUniversalStore extends UniversalStore ? S : never)>(universalStore: TUniversalStore): [TState, TUniversalStore['setState']]; , TSelectedState, TState = (TUniversalStore extends UniversalStore ? S : never)>(universalStore: TUniversalStore, selector: (state: TState) => TSelectedState): [TSelectedState, TUniversalStore['setState']]; }; //#endregion //#region code/core/.dts-emit/code/core/src/shared/universal-store/mock.d.ts /** * A mock universal store that can be used when testing code that relies on a universal store. It * functions exactly like a normal universal store, with a few exceptions: * * - It is fully isolated, meaning that it doesn't interact with any channel, and it is always a * leader. * * If the second testUtils argument is provided, all the public methods are spied on, so they can be * asserted. * * When a mock store is re-used across tests (eg. in stories), you manually need to reset the state * after each test. * * @example * * ```ts * import * as testUtils from 'storybook/test'; // in stories * import { vi as testUtils } from 'vitest'; // ... or in Vitest tests * * const initialState = { ... }; * const store = new MockUniversalStore({ initialState }, testUtils); * * export default { * title: 'My story', * beforeEach: () => { * return () => { * store.setState(initialState); * }; * } * } * ``` */ declare class MockUniversalStore extends UniversalStore { private testUtils; constructor(options: StoreOptions, testUtils?: any); /** Create a mock universal store. This is just an alias for the constructor */ static create(options: StoreOptions, testUtils?: any): MockUniversalStore; unsubscribeAll(): void; } //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/stores/status.d.ts declare const fullStatusStore: StatusStore & { selectStatuses: (statuses: Status[]) => void; typeId: undefined; }, getStatusStoreByTypeId: (typeId: StatusTypeId) => StatusStoreByTypeId$1, useStatusStore: UseStatusStore, universalStatusStore: UniversalStore; //#endregion //#region code/core/.dts-emit/code/core/src/shared/test-provider-store/index.d.ts type TestProviderState = 'test-provider-state:pending' | 'test-provider-state:running' | 'test-provider-state:succeeded' | 'test-provider-state:crashed'; type TestProviderId = string; type TestProviderStateByProviderId = Record; type TestProviderStoreEventType = 'run-all' | 'clear-all' | 'settings-changed'; type TestProviderStoreEvent = BaseEvent & { type: TestProviderStoreEventType; }; type BaseTestProviderStore = { /** * Notifies all listeners that settings have changed for test providers. The Storybook UI will * highlight the test providers to tell the user that settings has changed. */ settingsChanged: () => void; /** * Subscribe to clicks on the "Run All" button, that is supposed to trigger all test providers to * run. Your test provider should do the "main thing" when this happens, similar to when the user * triggers your test provider specifically. * * @example * * ```typescript * // Subscribe to run-all events * const unsubscribe = myTestProviderStore.onRunAll(() => { * await runAllMyTests(); * }); * ``` */ onRunAll: (listener: () => void) => () => void; /** * Subscribe to clicks on the "Clear All" button, that is supposed to clear all state from test * providers. Storybook already clears all statuses, but if your test provider has more * non-status-based state, you can use this to clear that here. * * @remarks * The purpose of this is _not_ to clear your test provider's settings, only the test results. * @example * * ```typescript * // Subscribe to clear-all events * const unsubscribe = myTestProviderStore.onClearAll(() => { * clearMyTestResults(); * }); * * // Later, when no longer needed * unsubscribe(); * ``` */ onClearAll: (listener: () => void) => () => void; }; /** * Test provider store that holds _all_ test provider's states. * * This is an internal store only meant to be used by Storybook UI itself. The API can change at any * time. Addons and test providers should use the `getTestProvider` function instead. */ /** * Represents a store for a specific test provider, identified by its unique ID. This store provides * methods to manage the state of an individual test provider, including getting and setting its * state, running operations with automatic state management, and accessing its unique identifier. * * Each test provider has its own instance of this store, allowing for independent state management * across different test providers in the application. * * @example * * ```typescript * // Get a store for a specific test provider * const grammarStore = getTestProviderStoreById('addon-grammar'); * * // Check the current state * if (grammarStore.getState() === 'test-provider-state:pending') { * console.log('Grammar tests are ready to run'); * } * * // Run tests with automatic state management * grammarStore.runWithState(async () => { * await runGrammarTests(); * }); * ``` * * @see {@link TestProviderState} for possible state values * @see {@link BaseTestProviderStore} for methods inherited from the base store */ type TestProviderStoreById = BaseTestProviderStore & { /** * Gets the current state of this specific test provider * * The state represents the current execution status of the test provider, which can be one of the * following: * * - 'test-provider-state:pending': Tests have not been run yet * - 'test-provider-state:running': Tests are currently running * - 'test-provider-state:succeeded': Tests completed successfully * - 'test-provider-state:crashed': Running tests failed or encountered an error * * Storybook UI will use this state to determine what to show in the UI. * * @remarks * The 'test-provider-state:crashed' is meant to signify that the test run as a whole failed to * execute for some reason. It should _not_ be set just because a number of tests failed, use * statuses and the status store for that. See {@link TestStatusStore} for managing individual test * statuses. * @example * * ```typescript * // Get the current state of a specific test provider * const state = testProviderStore.getState(); * * // Conditionally render UI based on the state * const TestStatus = () => { * const state = testProviderStore.getState(); * * if (state === 'test-provider-state:running') { * return ; * } else if (state === 'test-provider-state:succeeded') { * return ; * } else if (state === 'test-provider-state:crashed') { * return ; * } * * return ; * }; * ``` */ getState: () => TestProviderState; /** * Sets the state of this specific test provider * * This method allows you to manually update the execution state of the test provider. It's * typically used when you need to reflect the current status of test execution in the UI or when * you want to programmatically control the test provider's state. * * Common use cases include: * * - Setting to 'running' when tests start * - Setting to 'succeeded' when tests complete successfully * - Setting to 'crashed' when tests fail or encounter errors * - Setting to 'pending' to reset the state * * The state represents the current execution status of the test provider, which can be one of the * following: * * - 'test-provider-state:pending': Tests have not been run yet * - 'test-provider-state:running': Tests are currently running * - 'test-provider-state:succeeded': Tests completed successfully * - 'test-provider-state:crashed': Running tests failed or encountered an error * * Storybook UI will use this state to determine what to show in the UI. * * @remarks * The 'test-provider-state:crashed' is meant to signify that the test run as a whole failed to * execute for some reason. It should _not_ be set just because a number of tests failed, use * statuses and the status store for that. See {@link TestStatusStore} for managing individual test * statuses. * * For most use cases, consider using {@link runWithState} instead, which provides automatic state * management and error handling during test execution. * @example * * ```typescript * // Update the state when tests start running * const startTests = async () => { * testProviderStore.setState('test-provider-state:running'); * ... run tests ... * }; * ``` */ setState: (state: TestProviderState) => void; /** * Runs a callback and automatically updates the test provider's state with running, succeeded or * crashed, depending on the end result. * * - Immediately changes the state to 'running' * - If the callback returns/resolves, change the state to 'succeeded'. * - If the callback throws an error/rejects, change the state to 'crashed'. * * This approach helps prevent state inconsistencies that might occur if exceptions are thrown * during test execution. * * @example * * ```typescript * // Run tests with automatic state management * const runTests = () => { * testProviderStore.runWithState(async () => { * // The state is automatically set to 'running' before this callback * * // Run tests here... * const results = await executeTests(); * }); * }; * ``` */ runWithState: (callback: () => void | Promise) => Promise; /** The unique identifier for this test provider */ testProviderId: TestProviderId; }; /** * React OR preview hook for accessing the state of _all_ test providers. This hook will only * trigger a re-render when the state changes. It is recommended to pass the optional selector, to * get more fine-grained control of re-renders. * * @example * * ```typescript * const TestStatus = () => { * const state = useTestProviderStore((state) => state['my-test-provider']); * }; * ``` */ type UseTestProviderStore = ( /** * Optional selector function to extract or transform specific parts of the state * * @example * * ```typescript * // Use the entire state * const allProviderStates = useTestProviderStore(); * * // Get state for a specific provider * const myProviderState = useTestProviderStore((state) => state['my-test-provider']); * * // Get a count of providers in each state * const statusCounts = useTestProviderStore((state) => { * const counts = { * pending: 0, * running: 0, * succeeded: 0, * crashed: 0, * }; * * Object.values(state).forEach((status) => { * if (status === 'test-provider-state:pending') counts.pending++; * else if (status === 'test-provider-state:running') counts.running++; * else if (status === 'test-provider-state:succeeded') counts.succeeded++; * else if (status === 'test-provider-state:crashed') counts.crashed++; * }); * * return counts; * }); * * // Check if all tests have completed * const allTestsCompleted = useTestProviderStore((state) => { * return Object.values(state).every( * (status) => * status === 'test-provider-state:succeeded' || * status === 'test-provider-state:crashed' * ); * }); * ``` */ selector?: (state: TestProviderStateByProviderId) => T) => T; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/stores/test-provider.d.ts declare const fullTestProviderStore: { settingsChanged: () => void; onRunAll: (listener: () => void) => () => void; onClearAll: (listener: () => void) => () => void; } & { getFullState: UniversalStore['getState']; setFullState: UniversalStore['setState']; onSettingsChanged: (listener: (testProviderId: TestProviderId) => void) => () => void; runAll: () => void; clearAll: () => void; }, getTestProviderStoreById: (testProviderId: TestProviderId) => TestProviderStoreById, useTestProviderStore: UseTestProviderStore, universalTestProviderStore: UniversalStore; //#endregion //#region node_modules/zod/v3/helpers/typeAliases.d.cts type Primitive$1 = string | number | symbol | bigint | boolean | null | undefined; //#endregion //#region node_modules/zod/v3/helpers/util.d.cts declare namespace util { type AssertEqual = (() => V extends T ? 1 : 2) extends (() => V extends U ? 1 : 2) ? true : false; export type isAny = 0 extends 1 & T ? true : false; export const assertEqual: (_: AssertEqual) => void; export function assertIs(_arg: T): void; export function assertNever(_x: never): never; export type Omit = Pick>; export type OmitKeys = Pick>; export type MakePartial = Omit & Partial>; export type Exactly = T & Record, never>; export type InexactPartial = { [k in keyof T]?: T[k] | undefined }; export const arrayToEnum: (items: U) => { [k in U[number]]: k }; export const getValidEnumValues: (obj: any) => any[]; export const objectValues: (obj: any) => any[]; export const objectKeys: ObjectConstructor["keys"]; export const find: (arr: T[], checker: (arg: T) => any) => T | undefined; export type identity = objectUtil.identity; export type flatten = objectUtil.flatten; export type noUndefined = T extends undefined ? never : T; export const isInteger: NumberConstructor["isInteger"]; export function joinValues(array: T, separator?: string): string; export const jsonStringifyReplacer: (_: string, value: any) => any; export {}; } declare namespace objectUtil { export type MergeShapes = keyof U & keyof V extends never ? U & V : { [k in Exclude]: U[k] } & V; type optionalKeys = { [k in keyof T]: undefined extends T[k] ? k : never }[keyof T]; type requiredKeys = { [k in keyof T]: undefined extends T[k] ? never : k }[keyof T]; export type addQuestionMarks = { [K in requiredKeys]: T[K] } & { [K in optionalKeys]?: T[K] } & { [k in keyof T]?: unknown }; export type identity = T; export type flatten = identity<{ [k in keyof T]: T[k] }>; export type noNeverKeys = { [k in keyof T]: [T[k]] extends [never] ? never : k }[keyof T]; export type noNever = identity<{ [k in noNeverKeys]: k extends keyof T ? T[k] : never }>; export const mergeShapes: (first: U, second: T) => T & U; export type extendShape = keyof A & keyof B extends never ? A & B : { [K in keyof A as K extends keyof B ? never : K]: A[K] } & { [K in keyof B]: B[K] }; export {}; } declare const ZodParsedType: { string: "string"; nan: "nan"; number: "number"; integer: "integer"; float: "float"; boolean: "boolean"; date: "date"; bigint: "bigint"; symbol: "symbol"; function: "function"; undefined: "undefined"; null: "null"; array: "array"; object: "object"; unknown: "unknown"; promise: "promise"; void: "void"; never: "never"; map: "map"; set: "set"; }; type ZodParsedType = keyof typeof ZodParsedType; //#endregion //#region node_modules/zod/v3/ZodError.d.cts type allKeys = T extends any ? keyof T : never; type typeToFlattenedError = { formErrors: U[]; fieldErrors: { [P in allKeys]?: U[] }; }; declare const ZodIssueCode: { invalid_type: "invalid_type"; invalid_literal: "invalid_literal"; custom: "custom"; invalid_union: "invalid_union"; invalid_union_discriminator: "invalid_union_discriminator"; invalid_enum_value: "invalid_enum_value"; unrecognized_keys: "unrecognized_keys"; invalid_arguments: "invalid_arguments"; invalid_return_type: "invalid_return_type"; invalid_date: "invalid_date"; invalid_string: "invalid_string"; too_small: "too_small"; too_big: "too_big"; invalid_intersection_types: "invalid_intersection_types"; not_multiple_of: "not_multiple_of"; not_finite: "not_finite"; }; type ZodIssueCode = keyof typeof ZodIssueCode; type ZodIssueBase = { path: (string | number)[]; message?: string | undefined; }; interface ZodInvalidTypeIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_type; expected: ZodParsedType; received: ZodParsedType; } interface ZodInvalidLiteralIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_literal; expected: unknown; received: unknown; } interface ZodUnrecognizedKeysIssue extends ZodIssueBase { code: typeof ZodIssueCode.unrecognized_keys; keys: string[]; } interface ZodInvalidUnionIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_union; unionErrors: ZodError[]; } interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_union_discriminator; options: Primitive$1[]; } interface ZodInvalidEnumValueIssue extends ZodIssueBase { received: string | number; code: typeof ZodIssueCode.invalid_enum_value; options: (string | number)[]; } interface ZodInvalidArgumentsIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_arguments; argumentsError: ZodError; } interface ZodInvalidReturnTypeIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_return_type; returnTypeError: ZodError; } interface ZodInvalidDateIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_date; } type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | { includes: string; position?: number | undefined; } | { startsWith: string; } | { endsWith: string; }; interface ZodInvalidStringIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_string; validation: StringValidation; } interface ZodTooSmallIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_small; minimum: number | bigint; inclusive: boolean; exact?: boolean; type: "array" | "string" | "number" | "set" | "date" | "bigint"; } interface ZodTooBigIssue extends ZodIssueBase { code: typeof ZodIssueCode.too_big; maximum: number | bigint; inclusive: boolean; exact?: boolean; type: "array" | "string" | "number" | "set" | "date" | "bigint"; } interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase { code: typeof ZodIssueCode.invalid_intersection_types; } interface ZodNotMultipleOfIssue extends ZodIssueBase { code: typeof ZodIssueCode.not_multiple_of; multipleOf: number | bigint; } interface ZodNotFiniteIssue extends ZodIssueBase { code: typeof ZodIssueCode.not_finite; } interface ZodCustomIssue extends ZodIssueBase { code: typeof ZodIssueCode.custom; params?: { [k: string]: any; }; } type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue; type ZodIssue = ZodIssueOptionalMessage & { fatal?: boolean | undefined; message: string; }; type recursiveZodFormattedError = T extends [any, ...any[]] ? { [K in keyof T]?: ZodFormattedError } : T extends any[] ? { [k: number]: ZodFormattedError; } : T extends object ? { [K in keyof T]?: ZodFormattedError } : unknown; type ZodFormattedError = { _errors: U[]; } & recursiveZodFormattedError>; declare class ZodError extends Error { issues: ZodIssue[]; get errors(): ZodIssue[]; constructor(issues: ZodIssue[]); format(): ZodFormattedError; format(mapper: (issue: ZodIssue) => U): ZodFormattedError; static create: (issues: ZodIssue[]) => ZodError; static assert(value: unknown): asserts value is ZodError; toString(): string; get message(): string; get isEmpty(): boolean; addIssue: (sub: ZodIssue) => void; addIssues: (subs?: ZodIssue[]) => void; flatten(): typeToFlattenedError; flatten(mapper?: (issue: ZodIssue) => U): typeToFlattenedError; get formErrors(): typeToFlattenedError; } type stripPath = T extends any ? util.OmitKeys : never; type IssueData = stripPath & { path?: (string | number)[]; fatal?: boolean | undefined; }; type ErrorMapCtx = { defaultError: string; data: any; }; type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => { message: string; }; //#endregion //#region node_modules/zod/v3/helpers/parseUtil.d.cts type ParseParams = { path: (string | number)[]; errorMap: ZodErrorMap; async: boolean; }; type ParsePathComponent = string | number; type ParsePath = ParsePathComponent[]; interface ParseContext { readonly common: { readonly issues: ZodIssue[]; readonly contextualErrorMap?: ZodErrorMap | undefined; readonly async: boolean; }; readonly path: ParsePath; readonly schemaErrorMap?: ZodErrorMap | undefined; readonly parent: ParseContext | null; readonly data: any; readonly parsedType: ZodParsedType; } type ParseInput = { data: any; path: (string | number)[]; parent: ParseContext; }; declare class ParseStatus { value: "aborted" | "dirty" | "valid"; dirty(): void; abort(): void; static mergeArray(status: ParseStatus, results: SyncParseReturnType[]): SyncParseReturnType; static mergeObjectAsync(status: ParseStatus, pairs: { key: ParseReturnType; value: ParseReturnType; }[]): Promise>; static mergeObjectSync(status: ParseStatus, pairs: { key: SyncParseReturnType; value: SyncParseReturnType; alwaysSet?: boolean; }[]): SyncParseReturnType; } type INVALID = { status: "aborted"; }; declare const INVALID: INVALID; type DIRTY = { status: "dirty"; value: T; }; declare const DIRTY: (value: T) => DIRTY; type OK = { status: "valid"; value: T; }; declare const OK: (value: T) => OK; type SyncParseReturnType = OK | DIRTY | INVALID; type AsyncParseReturnType = Promise>; type ParseReturnType = SyncParseReturnType | AsyncParseReturnType; //#endregion //#region node_modules/zod/v3/helpers/enumUtil.d.cts declare namespace enumUtil { type UnionToIntersectionFn = (T extends unknown ? (k: () => T) => void : never) extends ((k: infer Intersection) => void) ? Intersection : never; type GetUnionLast = UnionToIntersectionFn extends (() => infer Last) ? Last : never; type UnionToTuple = [T] extends [never] ? Tuple : UnionToTuple>, [GetUnionLast, ...Tuple]>; type CastToStringTuple = T extends [string, ...string[]] ? T : never; export type UnionToTupleString = CastToStringTuple>; export {}; } //#endregion //#region node_modules/zod/v3/helpers/errorUtil.d.cts declare namespace errorUtil { type ErrMessage = string | { message?: string | undefined; }; const errToObj: (message?: ErrMessage) => { message?: string | undefined; }; const toString: (message?: ErrMessage) => string | undefined; } //#endregion //#region node_modules/zod/v3/helpers/partialUtil.d.cts declare namespace partialUtil { type DeepPartial = T extends ZodObject ? ZodObject<{ [k in keyof T["shape"]]: ZodOptional> }, T["_def"]["unknownKeys"], T["_def"]["catchall"]> : T extends ZodArray ? ZodArray, Card> : T extends ZodOptional ? ZodOptional> : T extends ZodNullable ? ZodNullable> : T extends ZodTuple ? { [k in keyof Items]: Items[k] extends ZodTypeAny ? DeepPartial : never } extends infer PI ? PI extends ZodTupleItems ? ZodTuple : never : never : T; } //#endregion //#region node_modules/zod/v3/standard-schema.d.cts /** * The Standard Schema interface. */ type StandardSchemaV1$1 = { /** * The Standard Schema properties. */ readonly "~standard": StandardSchemaV1$1.Props; }; declare namespace StandardSchemaV1$1 { /** * The Standard Schema properties interface. */ export interface Props { /** * The version number of the standard. */ readonly version: 1; /** * The vendor name of the schema library. */ readonly vendor: string; /** * Validates unknown input values. */ readonly validate: (value: unknown) => Result | Promise>; /** * Inferred types associated with the schema. */ readonly types?: Types | undefined; } /** * The result interface of the validate function. */ export type Result = SuccessResult | FailureResult; /** * The result interface if validation succeeds. */ export interface SuccessResult { /** * The typed output value. */ readonly value: Output; /** * The non-existent issues. */ readonly issues?: undefined; } /** * The result interface if validation fails. */ export interface FailureResult { /** * The issues of failed validation. */ readonly issues: ReadonlyArray; } /** * The issue interface of the failure output. */ export interface Issue { /** * The error message of the issue. */ readonly message: string; /** * The path of the issue, if any. */ readonly path?: ReadonlyArray | undefined; } /** * The path segment interface of the issue. */ export interface PathSegment { /** * The key representing a path segment. */ readonly key: PropertyKey; } /** * The Standard Schema types interface. */ export interface Types { /** * The input type of the schema. */ readonly input: Input; /** * The output type of the schema. */ readonly output: Output; } /** * Infers the input type of a Standard Schema. */ export type InferInput = NonNullable["input"]; /** * Infers the output type of a Standard Schema. */ export type InferOutput = NonNullable["output"]; export {}; } //#endregion //#region node_modules/zod/v3/types.d.cts interface RefinementCtx { addIssue: (arg: IssueData) => void; path: (string | number)[]; } type ZodRawShape = { [k: string]: ZodTypeAny; }; type ZodTypeAny = ZodType; type TypeOf> = T["_output"]; type input> = T["_input"]; type output> = T["_output"]; type CustomErrorParams = Partial>; interface ZodTypeDef { errorMap?: ZodErrorMap | undefined; description?: string | undefined; } type RawCreateParams = { errorMap?: ZodErrorMap | undefined; invalid_type_error?: string | undefined; required_error?: string | undefined; message?: string | undefined; description?: string | undefined; } | undefined; type SafeParseSuccess = { success: true; data: Output; error?: never; }; type SafeParseError = { success: false; error: ZodError; data?: never; }; type SafeParseReturnType = SafeParseSuccess | SafeParseError; declare abstract class ZodType { readonly _type: Output; readonly _output: Output; readonly _input: Input; readonly _def: Def; get description(): string | undefined; "~standard": StandardSchemaV1$1.Props; abstract _parse(input: ParseInput): ParseReturnType; _getType(input: ParseInput): string; _getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext; _processInputParams(input: ParseInput): { status: ParseStatus; ctx: ParseContext; }; _parseSync(input: ParseInput): SyncParseReturnType; _parseAsync(input: ParseInput): AsyncParseReturnType; parse(data: unknown, params?: util.InexactPartial): Output; safeParse(data: unknown, params?: util.InexactPartial): SafeParseReturnType; "~validate"(data: unknown): StandardSchemaV1$1.Result | Promise>; parseAsync(data: unknown, params?: util.InexactPartial): Promise; safeParseAsync(data: unknown, params?: util.InexactPartial): Promise>; /** Alias of safeParseAsync */ spa: (data: unknown, params?: util.InexactPartial) => Promise>; refine(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; refine(check: (arg: Output) => unknown | Promise, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects; refinement(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects; _refinement(refinement: RefinementEffect["refinement"]): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects; superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise): ZodEffects; constructor(def: Def); optional(): ZodOptional; nullable(): ZodNullable; nullish(): ZodOptional>; array(): ZodArray; promise(): ZodPromise; or(option: T): ZodUnion<[this, T]>; and(incoming: T): ZodIntersection; transform(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise): ZodEffects; default(def: util.noUndefined): ZodDefault; default(def: () => util.noUndefined): ZodDefault; brand(brand?: B): ZodBranded; catch(def: Output): ZodCatch; catch(def: (ctx: { error: ZodError; input: Input; }) => Output): ZodCatch; describe(description: string): this; pipe(target: T): ZodPipeline; readonly(): ZodReadonly; isOptional(): boolean; isNullable(): boolean; } type ZodNumberCheck = { kind: "min"; value: number; inclusive: boolean; message?: string | undefined; } | { kind: "max"; value: number; inclusive: boolean; message?: string | undefined; } | { kind: "int"; message?: string | undefined; } | { kind: "multipleOf"; value: number; message?: string | undefined; } | { kind: "finite"; message?: string | undefined; }; interface ZodNumberDef extends ZodTypeDef { checks: ZodNumberCheck[]; typeName: ZodFirstPartyTypeKind.ZodNumber; coerce: boolean; } declare class ZodNumber extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams & { coerce?: boolean; }) => ZodNumber; gte(value: number, message?: errorUtil.ErrMessage): ZodNumber; min: (value: number, message?: errorUtil.ErrMessage) => ZodNumber; gt(value: number, message?: errorUtil.ErrMessage): ZodNumber; lte(value: number, message?: errorUtil.ErrMessage): ZodNumber; max: (value: number, message?: errorUtil.ErrMessage) => ZodNumber; lt(value: number, message?: errorUtil.ErrMessage): ZodNumber; protected setLimit(kind: "min" | "max", value: number, inclusive: boolean, message?: string): ZodNumber; _addCheck(check: ZodNumberCheck): ZodNumber; int(message?: errorUtil.ErrMessage): ZodNumber; positive(message?: errorUtil.ErrMessage): ZodNumber; negative(message?: errorUtil.ErrMessage): ZodNumber; nonpositive(message?: errorUtil.ErrMessage): ZodNumber; nonnegative(message?: errorUtil.ErrMessage): ZodNumber; multipleOf(value: number, message?: errorUtil.ErrMessage): ZodNumber; step: (value: number, message?: errorUtil.ErrMessage) => ZodNumber; finite(message?: errorUtil.ErrMessage): ZodNumber; safe(message?: errorUtil.ErrMessage): ZodNumber; get minValue(): number | null; get maxValue(): number | null; get isInt(): boolean; get isFinite(): boolean; } interface ZodBooleanDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodBoolean; coerce: boolean; } declare class ZodBoolean extends ZodType { _parse(input: ParseInput): ParseReturnType; static create: (params?: RawCreateParams & { coerce?: boolean; }) => ZodBoolean; } interface ZodArrayDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodArray; exactLength: { value: number; message?: string | undefined; } | null; minLength: { value: number; message?: string | undefined; } | null; maxLength: { value: number; message?: string | undefined; } | null; } type ArrayCardinality = "many" | "atleastone"; type arrayOutputType = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][]; declare class ZodArray extends ZodType, ZodArrayDef, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> { _parse(input: ParseInput): ParseReturnType; get element(): T; min(minLength: number, message?: errorUtil.ErrMessage): this; max(maxLength: number, message?: errorUtil.ErrMessage): this; length(len: number, message?: errorUtil.ErrMessage): this; nonempty(message?: errorUtil.ErrMessage): ZodArray; static create: (schema: El, params?: RawCreateParams) => ZodArray; } type UnknownKeysParam = "passthrough" | "strict" | "strip"; interface ZodObjectDef extends ZodTypeDef { typeName: ZodFirstPartyTypeKind.ZodObject; shape: () => T; catchall: Catchall; unknownKeys: UnknownKeys; } type objectOutputType = objectUtil.flatten>> & CatchallOutput & PassthroughType; type baseObjectOutputType = { [k in keyof Shape]: Shape[k]["_output"] }; type objectInputType = objectUtil.flatten> & CatchallInput & PassthroughType; type baseObjectInputType = objectUtil.addQuestionMarks<{ [k in keyof Shape]: Shape[k]["_input"] }>; type CatchallOutput = ZodType extends T ? unknown : { [k: string]: T["_output"]; }; type CatchallInput = ZodType extends T ? unknown : { [k: string]: T["_input"]; }; type PassthroughType = T extends "passthrough" ? { [k: string]: unknown; } : unknown; type deoptional = T extends ZodOptional ? deoptional : T extends ZodNullable ? ZodNullable> : T; declare class ZodObject, Input = objectInputType> extends ZodType, Input> { private _cached; _getCached(): { shape: T; keys: string[]; }; _parse(input: ParseInput): ParseReturnType; get shape(): T; strict(message?: errorUtil.ErrMessage): ZodObject; strip(): ZodObject; passthrough(): ZodObject; /** * @deprecated In most cases, this is no longer needed - unknown properties are now silently stripped. * If you want to pass through unknown properties, use `.passthrough()` instead. */ nonstrict: () => ZodObject; extend(augmentation: Augmentation): ZodObject, UnknownKeys, Catchall>; /** * @deprecated Use `.extend` instead * */ augment: (augmentation: Augmentation) => ZodObject, UnknownKeys, Catchall>; /** * Prior to zod@1.0.12 there was a bug in the * inferred type of merged objects. Please * upgrade if you are experiencing issues. */ merge(merging: Incoming): ZodObject, Incoming["_def"]["unknownKeys"], Incoming["_def"]["catchall"]>; setKey(key: Key, schema: Schema): ZodObject; catchall(index: Index): ZodObject; pick>(mask: Mask): ZodObject>, UnknownKeys, Catchall>; omit>(mask: Mask): ZodObject, UnknownKeys, Catchall>; /** * @deprecated */ deepPartial(): partialUtil.DeepPartial; partial(): ZodObject<{ [k in keyof T]: ZodOptional }, UnknownKeys, Catchall>; partial>(mask: Mask): ZodObject : T[k] }>, UnknownKeys, Catchall>; required(): ZodObject<{ [k in keyof T]: deoptional }, UnknownKeys, Catchall>; required>(mask: Mask): ZodObject : T[k] }>, UnknownKeys, Catchall>; keyof(): ZodEnum>; static create: (shape: Shape, params?: RawCreateParams) => ZodObject, objectInputType>; static strictCreate: (shape: Shape, params?: RawCreateParams) => ZodObject; static lazycreate: (shape: () => Shape, params?: RawCreateParams) => ZodObject; } type AnyZodObject = ZodObject; type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>; interface ZodUnionDef> extends ZodTypeDef { options: T; typeName: ZodFirstPartyTypeKind.ZodUnion; } declare class ZodUnion extends ZodType, T[number]["_input"]> { _parse(input: ParseInput): ParseReturnType; get options(): T; static create: >(types: Options, params?: RawCreateParams) => ZodUnion; } interface ZodIntersectionDef extends ZodTypeDef { left: T; right: U; typeName: ZodFirstPartyTypeKind.ZodIntersection; } declare class ZodIntersection extends ZodType, T["_input"] & U["_input"]> { _parse(input: ParseInput): ParseReturnType; static create: (left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection; } type ZodTupleItems = [ZodTypeAny, ...ZodTypeAny[]]; type AssertArray = T extends any[] ? T : never; type OutputTypeOfTuple = AssertArray<{ [k in keyof T]: T[k] extends ZodType ? T[k]["_output"] : never }>; type OutputTypeOfTupleWithRest = Rest extends ZodTypeAny ? [...OutputTypeOfTuple, ...Rest["_output"][]] : OutputTypeOfTuple; type InputTypeOfTuple = AssertArray<{ [k in keyof T]: T[k] extends ZodType ? T[k]["_input"] : never }>; type InputTypeOfTupleWithRest = Rest extends ZodTypeAny ? [...InputTypeOfTuple, ...Rest["_input"][]] : InputTypeOfTuple; interface ZodTupleDef extends ZodTypeDef { items: T; rest: Rest; typeName: ZodFirstPartyTypeKind.ZodTuple; } declare class ZodTuple extends ZodType, ZodTupleDef, InputTypeOfTupleWithRest> { _parse(input: ParseInput): ParseReturnType; get items(): T; rest(rest: RestSchema): ZodTuple; static create: (schemas: Items, params?: RawCreateParams) => ZodTuple; } type EnumValues = readonly [T, ...T[]]; type Values = { [k in T[number]]: k }; interface ZodEnumDef extends ZodTypeDef { values: T; typeName: ZodFirstPartyTypeKind.ZodEnum; } type Writeable = { -readonly [P in keyof T]: T[P] }; type FilterEnum = Values extends [] ? [] : Values extends [infer Head, ...infer Rest] ? Head extends ToExclude ? FilterEnum : [Head, ...FilterEnum] : never; type typecast = A extends T ? A : never; declare function createZodEnum>(values: T, params?: RawCreateParams): ZodEnum>; declare function createZodEnum(values: T, params?: RawCreateParams): ZodEnum; declare class ZodEnum extends ZodType, T[number]> { _cache: Set | undefined; _parse(input: ParseInput): ParseReturnType; get options(): T; get enum(): Values; get Values(): Values; get Enum(): Values; extract(values: ToExtract, newDef?: RawCreateParams): ZodEnum>; exclude(values: ToExclude, newDef?: RawCreateParams): ZodEnum>, [string, ...string[]]>>; static create: typeof createZodEnum; } interface ZodPromiseDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodPromise; } declare class ZodPromise extends ZodType, ZodPromiseDef, Promise> { unwrap(): T; _parse(input: ParseInput): ParseReturnType; static create: (schema: Inner, params?: RawCreateParams) => ZodPromise; } type RefinementEffect = { type: "refinement"; refinement: (arg: T, ctx: RefinementCtx) => any; }; type TransformEffect = { type: "transform"; transform: (arg: T, ctx: RefinementCtx) => any; }; type PreprocessEffect = { type: "preprocess"; transform: (arg: T, ctx: RefinementCtx) => any; }; type Effect = RefinementEffect | TransformEffect | PreprocessEffect; interface ZodEffectsDef extends ZodTypeDef { schema: T; typeName: ZodFirstPartyTypeKind.ZodEffects; effect: Effect; } declare class ZodEffects, Input = input> extends ZodType, Input> { innerType(): T; sourceType(): T; _parse(input: ParseInput): ParseReturnType; static create: (schema: I, effect: Effect, params?: RawCreateParams) => ZodEffects; static createWithPreprocess: (preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects; } interface ZodOptionalDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodOptional; } declare class ZodOptional extends ZodType, T["_input"] | undefined> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; static create: (type: Inner, params?: RawCreateParams) => ZodOptional; } interface ZodNullableDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodNullable; } declare class ZodNullable extends ZodType, T["_input"] | null> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; static create: (type: Inner, params?: RawCreateParams) => ZodNullable; } interface ZodDefaultDef extends ZodTypeDef { innerType: T; defaultValue: () => util.noUndefined; typeName: ZodFirstPartyTypeKind.ZodDefault; } declare class ZodDefault extends ZodType, ZodDefaultDef, T["_input"] | undefined> { _parse(input: ParseInput): ParseReturnType; removeDefault(): T; static create: (type: Inner, params: RawCreateParams & { default: Inner["_input"] | (() => util.noUndefined); }) => ZodDefault; } interface ZodCatchDef extends ZodTypeDef { innerType: T; catchValue: (ctx: { error: ZodError; input: unknown; }) => T["_input"]; typeName: ZodFirstPartyTypeKind.ZodCatch; } declare class ZodCatch extends ZodType, unknown> { _parse(input: ParseInput): ParseReturnType; removeCatch(): T; static create: (type: Inner, params: RawCreateParams & { catch: Inner["_output"] | (() => Inner["_output"]); }) => ZodCatch; } interface ZodBrandedDef extends ZodTypeDef { type: T; typeName: ZodFirstPartyTypeKind.ZodBranded; } declare const BRAND: unique symbol; type BRAND = { [BRAND]: { [k in T]: true }; }; declare class ZodBranded extends ZodType, ZodBrandedDef, T["_input"]> { _parse(input: ParseInput): ParseReturnType; unwrap(): T; } interface ZodPipelineDef extends ZodTypeDef { in: A; out: B; typeName: ZodFirstPartyTypeKind.ZodPipeline; } declare class ZodPipeline extends ZodType, A["_input"]> { _parse(input: ParseInput): ParseReturnType; static create(a: ASchema, b: BSchema): ZodPipeline; } type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | { readonly [Symbol.toStringTag]: string; } | Date | Error | Generator | Promise | RegExp; type MakeReadonly = T extends Map ? ReadonlyMap : T extends Set ? ReadonlySet : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array ? ReadonlyArray : T extends BuiltIn ? T : Readonly; interface ZodReadonlyDef extends ZodTypeDef { innerType: T; typeName: ZodFirstPartyTypeKind.ZodReadonly; } declare class ZodReadonly extends ZodType, ZodReadonlyDef, MakeReadonly> { _parse(input: ParseInput): ParseReturnType; static create: (type: Inner, params?: RawCreateParams) => ZodReadonly; unwrap(): T; } declare enum ZodFirstPartyTypeKind { ZodString = "ZodString", ZodNumber = "ZodNumber", ZodNaN = "ZodNaN", ZodBigInt = "ZodBigInt", ZodBoolean = "ZodBoolean", ZodDate = "ZodDate", ZodSymbol = "ZodSymbol", ZodUndefined = "ZodUndefined", ZodNull = "ZodNull", ZodAny = "ZodAny", ZodUnknown = "ZodUnknown", ZodNever = "ZodNever", ZodVoid = "ZodVoid", ZodArray = "ZodArray", ZodObject = "ZodObject", ZodUnion = "ZodUnion", ZodDiscriminatedUnion = "ZodDiscriminatedUnion", ZodIntersection = "ZodIntersection", ZodTuple = "ZodTuple", ZodRecord = "ZodRecord", ZodMap = "ZodMap", ZodSet = "ZodSet", ZodFunction = "ZodFunction", ZodLazy = "ZodLazy", ZodLiteral = "ZodLiteral", ZodEnum = "ZodEnum", ZodEffects = "ZodEffects", ZodNativeEnum = "ZodNativeEnum", ZodOptional = "ZodOptional", ZodNullable = "ZodNullable", ZodDefault = "ZodDefault", ZodCatch = "ZodCatch", ZodPromise = "ZodPromise", ZodBranded = "ZodBranded", ZodPipeline = "ZodPipeline", ZodReadonly = "ZodReadonly" } //#endregion //#region code/core/.dts-emit/code/core/src/cli/globalSettings.d.ts declare const userSettingSchema: ZodObject<{ version: ZodNumber; userSince: ZodOptional; init: ZodOptional; }, "strip", ZodTypeAny, { skipOnboarding?: boolean | undefined; }, { skipOnboarding?: boolean | undefined; }>>; checklist: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; aiSetup: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; autodocs: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; ciTests: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; controls: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; coverage: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; guidedTour: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; installA11y: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; installChromatic: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; installDocs: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; installVitest: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; mdxDocs: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; moreComponents: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; moreStories: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; onboardingSurvey: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; organizeStories: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; publishStorybook: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; shareStorybook: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; renderComponent: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; runTests: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; viewports: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; visualTests: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; whatsNewStorybook10: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; writeInteractions: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }>>; }, "strip", ZodTypeAny, { accessibilityTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; controls?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; }, { accessibilityTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; controls?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; }>>; widget: ZodOptional; }, "strip", ZodTypeAny, { disable?: boolean | undefined; }, { disable?: boolean | undefined; }>>; }, "strip", ZodTypeAny, { items?: { accessibilityTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; controls?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; } | undefined; widget?: { disable?: boolean | undefined; } | undefined; }, { items?: { accessibilityTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; controls?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; } | undefined; widget?: { disable?: boolean | undefined; } | undefined; }>>; }, "strip", ZodTypeAny, { version: number; userSince?: number | undefined; init?: { skipOnboarding?: boolean | undefined; } | undefined; checklist?: { items?: { accessibilityTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; controls?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; } | undefined; widget?: { disable?: boolean | undefined; } | undefined; } | undefined; }, { version: number; userSince?: number | undefined; init?: { skipOnboarding?: boolean | undefined; } | undefined; checklist?: { items?: { accessibilityTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; controls?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; } | undefined; widget?: { disable?: boolean | undefined; } | undefined; } | undefined; }>; declare function globalSettings(filePath?: string): Promise; declare function _clearGlobalSettings(): void; /** * A class for reading and writing settings from a JSON file. Supports nested settings with dot * notation. */ declare class Settings { private filePath; value: TypeOf; /** * Create a new Settings instance * * @param filePath Path to the JSON settings file * @param value Loaded value of settings */ constructor(filePath: string, value: TypeOf); /** Save settings to the file */ save(): Promise; } //#endregion //#region code/core/.dts-emit/code/core/src/shared/checklist-store/index.d.ts /** ChecklistState is the persisted state, which may be incomplete */ type ChecklistState = NonNullable>['value']['checklist']>; /** Store uses initialState to ensure all items are present */ type StoreState = Required> & { items: NonNullable>; loaded?: boolean; /** True unless the user opted out from AI during `storybook init`. Set by the server from the event cache. Treat empty values as true.*/ aiOptIn?: boolean; /** True when the user ran the AI setup at some point in the past. Treat empty values as false.*/ aiSetupRun?: boolean; }; type ItemId = keyof StoreState['items']; type StoreEvent = { type: 'accept'; payload: ItemId; } | { type: 'done'; payload: ItemId; } | { type: 'skip'; payload: ItemId; } | { type: 'reset'; payload: ItemId; } | { type: 'mute'; payload: Array; } | { type: 'disable'; payload: boolean; }; //#endregion //#region code/core/.dts-emit/code/core/src/manager-api/stores/checklist.d.ts declare const universalChecklistStore: UniversalStore; declare const checklistStore: { getValue: (id: ItemId) => { status?: "accepted" | "done" | "open" | "skipped" | undefined; mutedAt?: number | undefined; }; accept: (id: ItemId) => void; done: (id: ItemId) => void; skip: (id: ItemId) => void; reset: (id: ItemId) => void; mute: (itemIds: Array) => void; disable: (value: boolean) => void; }; //#endregion //#region code/core/.dts-emit/code/core/src/shared/constants/tags.d.ts /** System tags used throughout Storybook for categorizing and filtering stories and docs entries. */ declare const Tag$4: { /** Indicates that autodocs should be generated for this component */readonly AUTODOCS: 'autodocs'; /** MDX documentation attached to a component's stories file */ readonly ATTACHED_MDX: 'attached-mdx'; /** Standalone MDX documentation not attached to stories */ readonly UNATTACHED_MDX: 'unattached-mdx'; /** Story has a play function */ readonly PLAY_FN: 'play-fn'; /** Story has a test function */ readonly TEST_FN: 'test-fn'; /** Development environment tag */ readonly DEV: 'dev'; /** Test environment tag */ readonly TEST: 'test'; /** Manifest generation tag */ readonly MANIFEST: 'manifest'; }; /** * Tags can be any string, including custom user-defined tags. The Tag constant above defines the * system tags used by Storybook. */ type Tag$4 = string; //#endregion //#region node_modules/@standard-schema/spec/dist/index.d.ts /** The Standard Typed interface. This is a base type extended by other specs. */ interface StandardTypedV1 { /** The Standard properties. */ readonly "~standard": StandardTypedV1.Props; } declare namespace StandardTypedV1 { /** The Standard Typed properties interface. */ interface Props { /** The version number of the standard. */ readonly version: 1; /** The vendor name of the schema library. */ readonly vendor: string; /** Inferred types associated with the schema. */ readonly types?: Types | undefined; } /** The Standard Typed types interface. */ interface Types { /** The input type of the schema. */ readonly input: Input; /** The output type of the schema. */ readonly output: Output; } /** Infers the input type of a Standard Typed. */ type InferInput = NonNullable["input"]; /** Infers the output type of a Standard Typed. */ type InferOutput = NonNullable["output"]; } /** The Standard Schema interface. */ interface StandardSchemaV1 { /** The Standard Schema properties. */ readonly "~standard": StandardSchemaV1.Props; } declare namespace StandardSchemaV1 { /** The Standard Schema properties interface. */ interface Props extends StandardTypedV1.Props { /** Validates unknown input values. */ readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result | Promise>; } /** The result interface of the validate function. */ type Result = SuccessResult | FailureResult; /** The result interface if validation succeeds. */ interface SuccessResult { /** The typed output value. */ readonly value: Output; /** A falsy value for `issues` indicates success. */ readonly issues?: undefined; } interface Options { /** Explicit support for additional vendor-specific parameters, if needed. */ readonly libraryOptions?: Record | undefined; } /** The result interface if validation fails. */ interface FailureResult { /** The issues of failed validation. */ readonly issues: ReadonlyArray; } /** The issue interface of the failure output. */ interface Issue { /** The error message of the issue. */ readonly message: string; /** The path of the issue, if any. */ readonly path?: ReadonlyArray | undefined; } /** The path segment interface of the issue. */ interface PathSegment { /** The key representing a path segment. */ readonly key: PropertyKey; } /** The Standard types interface. */ interface Types extends StandardTypedV1.Types {} /** Infers the input type of a Standard. */ type InferInput = StandardTypedV1.InferInput; /** Infers the output type of a Standard. */ type InferOutput = StandardTypedV1.InferOutput; } /** The Standard JSON Schema interface. */ //#endregion //#region code/core/.dts-emit/code/core/src/shared/open-service/types.d.ts /** File map used by static snapshot building. Each key represents one serialized state snapshot. */ type StaticStore = Record; /** Generic Standard Schema constraint used across open-service definitions. */ type AnySchema = StandardSchemaV1; /** Stable alias for service identifiers across definition, runtime, and registration APIs. */ type ServiceId = string; /** * Constrains a service's state to a plain object — the only shape the architecture supports. * * This is not an arbitrary restriction; two layers require it: * * 1. State is wrapped in a `deepSignal` proxy for fine-grained per-field reactivity, and `deepSignal` * throws ("this object can't be observed") on primitives, `null`, and `undefined` — there are no * fields to track on a scalar. * 2. Cross-peer sync (`applyStatePatch` in `service-sync.ts`) merges state by walking object keys; * it has no notion of replacing a whole scalar, so the wire protocol only carries keyed objects. * * Arrays are technically observable by `deepSignal` but are still rejected here: `applyStatePatch` * replaces arrays wholesale rather than merging by key, so a *top-level* array state would silently * fail to sync between peers. Wrap collections in a field instead (`{ items: [...] }`). * * Authoring helpers pair this with an `extends object` bound (which rejects primitives, `null`, and * `undefined` while still accepting both `interface` and `type` declarations). The naked `TState` in * the intersection keeps it transparent to inference; only an array collapses to the branded error. */ type ServiceState = TState & (TState extends readonly unknown[] ? { __openServiceStateError: 'Service state must be a plain object, not an array.'; } : unknown); /** Public schema shape exposed when describing a schema-backed service contract. */ type SchemaDescriptor = AnySchema; /** Raw caller-facing value type accepted by a schema-backed operation. */ type InferSchemaInput = StandardSchemaV1.InferInput; /** Parsed value type produced by a schema after validation. */ type InferSchemaOutput = StandardSchemaV1.InferOutput; /** * Named schema maps are the core inference surface for inline open-service authoring. * * `defineService()` infers one input-schema map and one output-schema map per operation family * (queries and commands). Keeping those maps separate gives TypeScript a place to correlate the * `input` and `output` properties of each inline object before it contextually types sibling * callbacks like `handler`, `load`, `staticPath`, and `staticInputs`. */ type OperationInputSchemas = Record; /** * Output-schema maps must stay key-aligned with their input-schema map. * * The authoring helper uses this alias instead of a plain `Record` so each * operation key retains its own input/output schema pair during inference. */ type MatchingOutputSchemas = { [TKey in keyof TInputSchemas]: AnySchema }; /** * Internal utility used to keep handler maps assignable without collapsing everything to `unknown`. */ type BivariantCallback = { bivarianceHack(...args: TArgs): TResult; }['bivarianceHack']; /** Runtime shape shared by all command collections after they are built. */ type Command = Record Promise>; /** * Runtime command map derived directly from the inferred command schema maps. * * Queries only need command-call typing, not the full command definition objects, so this helper * keeps query contexts readable while still preserving exact input/output types per command. */ type CommandFunctions> = { [TKey in keyof TCommandInputSchemas]: BivariantCallback<[input: InferSchemaInput], Promise>> }; /** * Coarse lifecycle of a query's `load`, modeled after TanStack Query's `status`. * * - `pending` — no successful load has completed yet (and none has failed). The query may still * expose `data` (the synchronous "current best" handler result), but nothing has been loaded. * - `error` — the most recent attempt (load rejection, or a synchronous handler / validation throw) * failed. `data` keeps the last successful value, if any. * - `success` — a load has completed (or the query has no `load`, so there is nothing to load). */ type QueryStatus = 'pending' | 'error' | 'success'; /** * Whether a `load` is currently running, modeled after TanStack Query's `fetchStatus` — but named * with our own `load` vocabulary because open-service "loads" are any slow async work (computation, * extraction, I/O), not specifically remote fetching. * * - `loading` — a `load` is in flight (the first load, or a reactive background re-load). * - `idle` — no `load` is currently running. */ type LoadStatus = 'loading' | 'idle'; /** * The reactive state of a subscribed query: its current `data` plus the lifecycle of its `load`. * * `data` and `status` are independent. `data` is the synchronous handler result ("current best * effort") and holds the last successful value (or `undefined` before the first success / when a * handler throws), while `status`/`loadStatus`/`error` describe the asynchronous `load` lifecycle * tracked per subscription. A query with no `load` is `success`/`idle` from its first emission. * * `isLoading` is intentionally "any load in flight" (TanStack's `isFetching`), and * `isInitialLoading` is "a load is in flight and there is nothing to show yet"; the names follow our * `load` vocabulary rather than TanStack's `fetch`/`load` split. Unlike TanStack Query, a * subscription here can attach to a query whose `data` is already cached in service state, so * `isInitialLoading` additionally requires `data === undefined` — it never flags over cached data. */ type QueryState = { /** Last successfully produced value; `undefined` before the first success. */data: TData | undefined; /** The failure that produced `status: 'error'`, otherwise `undefined`. */ error: Error | undefined; status: QueryStatus; loadStatus: LoadStatus; /** `status === 'pending'`. */ isPending: boolean; /** `status === 'success'`. */ isSuccess: boolean; /** `status === 'error'`. */ isError: boolean; /** `loadStatus === 'loading'` — any load in flight, foreground or background. */ isLoading: boolean; /** `isPending && isLoading && data === undefined` — a first load with nothing to show yet. */ isInitialLoading: boolean; /** `isLoading && !isPending` — a background re-load while data is already shown. */ isRefreshing: boolean; }; /** * Public runtime shape of a query. * * - `.get(input)` reads synchronously: it validates input, runs the handler against current state, * and returns the validated result. It does **not** fire the query's `load` — it is a pure * "current best effort" read. (Reads of *other* queries from inside a handler or `load` body still * participate in dependency tracking, so `.loaded()` and subscriptions trigger those dependency * loads; a bare consumer `.get()` does not.) * - `.loaded(input)` awaits the full load — this query's `load` plus every transitively read * dependency — before resolving with the validated result. * - `.subscribe(input, callback)` invokes `callback` synchronously with the current {@link QueryState} * and again whenever tracked state or the load lifecycle changes (deduped on the whole state). * Subscribing is what fires the query's reactive `load`. * * There is intentionally no bare-call form: a previous `query(input)` that returned synchronously * *and* fired the `load` behind the scenes was removed because the implicit background load was * confusing. Read with `.get(input)`, await with `.loaded(input)`, observe with `.subscribe(...)`. * * Queries whose input schema resolves to `undefined` (for example `v.void()`) may be called with * zero arguments: `query.get()`, `query.loaded()`. */ type InputQuery = { get(input: TInput): TOutput; loaded(input: TInput): Promise; subscribe(input: TInput, callback: (state: QueryState) => void): () => void; subscribe(input: TInput, selector: (value: TOutput) => TSelected, callback: (state: QueryState) => void): () => void; }; /** Zero-argument overloads merged into {@link Query} when the input schema is void. */ type VoidQuery = { get(): TOutput; loaded(): Promise; subscribe(callback: (state: QueryState) => void): () => void; subscribe(selector: (value: TOutput) => TSelected, callback: (state: QueryState) => void): () => void; }; type Query = undefined extends TInput ? VoidQuery & InputQuery : InputQuery; /** * Runtime query map derived directly from the inferred query schema maps. * * The query counterpart to {@link CommandFunctions}: it preserves each sibling query's exact * input/output types on the read-only `self.queries` handle, so a handler or `load` can call * `self.queries.someQuery.get(input)` without manual casts. `defineService` computes this map from * the inferred query schema maps and threads it into the handler/load contexts as their `TQueries`; * the erased {@link AnyQueryFunctions} bound is used everywhere the concrete map is not known. */ type QueryFunctions> = { [TKey in keyof TQueryInputSchemas]: Query, InferSchemaOutput> }; /** * Permissive bound for a `self.queries` handle. * * Every {@link Query} — input or void — structurally satisfies {@link InputQuery} (the void * overloads are additive), so this is the supertype that any concrete {@link QueryFunctions} map is * assignable to. It is the bound (and erased default) for the `TQueries` parameter below, which lets * the precise per-service map flow into handler contexts while still erasing cleanly into the * structural `AnyQueryDefinition` storage constraint. Using `Query` here instead * would wrongly demand the void zero-arg overloads from input queries. */ type AnyQueryFunctions = Record>; /** * Read-only service handle exposed to query handlers. * * Query handlers are strict readers: they can read state and call sibling queries, but they cannot * mutate state and cannot invoke commands. Mutations belong in commands; load-side preparation * belongs in `load`. */ type QuerySelf = { readonly state: TState; queries: TQueries; }; /** * Load handle exposed to `load` functions. * * `load` may read state and queries, and may invoke declared commands to mutate state. It does * not receive `setState` directly — all writes must flow through commands so authors keep one * documented mutation surface per service. */ type LoadSelf = MatchingOutputSchemas, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = QuerySelf & { commands: CommandFunctions; }; /** * Mutable service handle exposed to command handlers. * * Commands receive both `setState` for direct state mutation and `commands` so one command can * delegate to another within the same service. */ type CommandSelf = MatchingOutputSchemas, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = LoadSelf & { setState(mutate: (state: TState) => void): void; }; type ServiceSummary = { id: ServiceId; description?: string; queryNames: string[]; commandNames: string[]; }; type OperationDescriptor = { name: string; description?: string; input: SchemaDescriptor; output: SchemaDescriptor; /** Present when the query declares `staticPath` at definition time. */ staticPath?: true; }; type ServiceDescriptor = { id: ServiceId; description?: string; queries: Record; commands: Record; }; /** Context passed to query handlers. */ type QueryCtx = { self: QuerySelf; getService: ServiceRegistryApi['getService']; }; /** Context passed to `load` functions and static-input enumerators. */ type LoadCtx = MatchingOutputSchemas, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = { self: LoadSelf; getService: ServiceRegistryApi['getService']; }; /** Static input enumerator stored on registered definitions; always receives load context. */ type RegisteredStaticInputs = BivariantCallback<[ctx: LoadCtx], unknown[] | Promise>; /** Context passed to command handlers. */ type CommandCtx = MatchingOutputSchemas, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = { self: CommandSelf; getService: ServiceRegistryApi['getService']; }; /** * Declarative definition for one query. * * Queries validate caller input synchronously, run a synchronous read-only handler, and validate * the resolved output. The optional `load` hook is fired by subscriptions (reactively) and by * `.loaded()` callers (drained to completion), deduped per `(service, query, input)` while one is * already in flight — a bare `.get()` read never fires it. * * Queries that participate in static JSON generation declare `staticPath` at definition time. * `staticInputs` may also be declared here when the input list has no runtime dependencies; inputs * that need registry or story-index context belong in server registration instead. */ type QueryDefinition = MatchingOutputSchemas, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = { description?: string; /** * When true, hides this query from `describeService()` output. Defaults to false. Does not disable * the query at runtime — callers with a service handle can still invoke it. */ internal?: boolean; input: TInputSchema; output: TOutputSchema; /** Logical path for the serialized state snapshot, relative to this service's output folder. */ staticPath?: BivariantCallback<[input: InferSchemaOutput], string>; /** Dependency-free static build inputs declared alongside the public contract. */ staticInputs?: BivariantCallback<[], InferSchemaInput[] | Promise[]>>; handler?: BivariantCallback<[input: InferSchemaOutput, ctx: QueryCtx], InferSchemaInput>; load?: BivariantCallback<[input: InferSchemaOutput, ctx: LoadCtx], void | Promise>; }; /** * Declarative definition for one command. * * Commands validate caller input, run against a mutable context, and validate the resolved output. */ type CommandDefinition = MatchingOutputSchemas, TQueries extends AnyQueryFunctions = AnyQueryFunctions> = { description?: string; /** * When true, hides this command from `describeService()` output. Defaults to false. Does not * disable the command at runtime — callers with a service handle can still invoke it. */ internal?: boolean; input: TInputSchema; output: TOutputSchema; handler?: BivariantCallback<[input: InferSchemaOutput, ctx: CommandCtx], InferSchemaInput | Promise>>; }; /** Internal structural constraint used to store any query definition in a record. */ type AnyQueryDefinition = { description?: string; internal?: boolean; input: AnySchema; output: AnySchema; staticPath?: BivariantCallback<[input: unknown], string>; staticInputs?: RegisteredStaticInputs; handler?: BivariantCallback<[input: unknown, ctx: QueryCtx], unknown>; load?: BivariantCallback<[input: unknown, ctx: LoadCtx], void | Promise>; }; /** Internal structural constraint used to store any command definition in a record. */ type AnyCommandDefinition = { description?: string; internal?: boolean; input: AnySchema; output: AnySchema; handler?: BivariantCallback<[input: unknown, ctx: CommandCtx], unknown | Promise>; }; /** Named query map attached to a service definition. */ type Queries = Record>; /** Named command map attached to a service definition. */ type Commands = Record>; /** Top-level description of a service: identity, initial state, queries, and commands. */ type ServiceDefinition, TCommands extends Commands, TId extends ServiceId = ServiceId> = { id: TId; description?: string; /** * When true, hides this service from `listServices()` output. Defaults to false. Does not disable * the service at runtime — callers can still resolve it through `getService()`. */ internal?: boolean; /** * Initial state for the service. Must be a plain object (not a primitive, `null`, or array) — see * {@link ServiceState} for why. The authoring boundary (`defineService`) enforces this; the runtime * type stays `TState` so already-constructed definitions flow through the registry unchanged. */ initialState: TState; queries: TQueries; commands: TCommands; }; /** Structural constraint for any service definition stored in the registry. */ type AnyServiceDefinition = ServiceDefinition, Commands>; /** Runtime service instance derived from a `ServiceDefinition`. */ type ServiceInstance, TCommands extends Commands> = { queries: { [TKey in keyof TQueries]: TQueries[TKey] extends { input: infer TInputSchema extends AnySchema; output: infer TOutputSchema extends AnySchema; } ? Query, InferSchemaOutput> : never }; commands: { [TKey in keyof TCommands]: TCommands[TKey] extends { input: infer TInputSchema extends AnySchema; output: infer TOutputSchema extends AnySchema; } ? (input: InferSchemaInput) => Promise> : never }; }; /** Runtime instance type recovered from one authored service definition. */ type ServiceInstanceOf = TDefinition extends ServiceDefinition ? ServiceInstance : never; interface ServiceRegistryApi { listServices(): Promise; describeService(serviceId: ServiceId): Promise; getService(serviceId: ServiceId): TInstance; } type RuntimeService = ServiceInstance, Commands> & ServiceRegistryApi; type ServiceQueryRegistration = { /** Static build inputs that may depend on registry or other server context. */staticInputs?: RegisteredStaticInputs; }; type ServiceCommandRegistration> = Pick; type ServiceRegistrationOptions, TCommands extends Commands> = { queries?: { [TKey in keyof TQueries]?: ServiceQueryRegistration }; commands?: { [TKey in keyof TCommands]?: ServiceCommandRegistration }; }; type ServerServiceRegistration, TCommands extends Commands> = { definition: ServiceDefinition; } & ServiceRegistrationOptions; //#endregion //#region code/core/.dts-emit/code/core/src/shared/open-service/service-definition.d.ts type InvalidInternalOperationName = { __internal_naming_error: `Operation "${TName}" has internal: true but must be prefixed with "_"`; }; type InvalidUnderscoreWithoutInternal = { __internal_naming_error: `Operation "${TName}" is prefixed with "_" and must set internal: true`; }; type InternalOperationNaming = TKey extends string ? TKey extends `_${string}` ? { internal: true; } | InvalidUnderscoreWithoutInternal : { internal?: false; } | InvalidInternalOperationName : {}; /** * Authoring-side query map derived from separate query input/output schema maps. * * The second mapped-type intersection is deliberate. During experiments, TypeScript would infer * the `input` schema for each inline query, but then lose the corresponding `output` schema before * it contextually typed sibling callbacks. Repeating the output map through a keyed `output` view * keeps each query key's input and output schemas correlated while handlers, load hooks, and * static callbacks are being typed. */ type DefinedQueries, TCommandInputSchemas extends OperationInputSchemas, TCommandOutputSchemas extends MatchingOutputSchemas> = { [TKey in keyof TQueryInputSchemas]: QueryDefinition> & InternalOperationNaming } & { [TKey in keyof TQueryOutputSchemas]: { output: TQueryOutputSchemas[TKey]; } }; /** * Authoring-side command map derived from separate command input/output schema maps. * * Commands do not need access to the command schema maps in their own context, but they still * benefit from the same key-correlation trick as queries so TypeScript preserves each inline * command object's `output` schema while typing its `handler`. */ type DefinedCommands, TQueryInputSchemas extends OperationInputSchemas, TQueryOutputSchemas extends MatchingOutputSchemas> = { [TKey in keyof TCommandInputSchemas]: CommandDefinition> & InternalOperationNaming } & { [TKey in keyof TCommandOutputSchemas]: { output: TCommandOutputSchemas[TKey]; } }; /** * Finalizes a service definition while preserving inline query and command inference. * * The generic order matters here. We infer the per-operation schema maps first, then derive the * concrete query/command definition maps from those schemas. If we instead ask TypeScript to infer * the full runtime `ServiceDefinition` maps directly, it widens callback parameters to `unknown` * before it has correlated each inline object's `input` and `output` properties. */ declare const defineService: , const TCommandInputSchemas extends OperationInputSchemas, const TCommandOutputSchemas extends MatchingOutputSchemas, const TId extends ServiceId = ServiceId>(def: { id: TId; description?: string; internal?: boolean; initialState: ServiceState; queries: DefinedQueries; commands: DefinedCommands; }) => ServiceDefinition, DefinedCommands, TId>; //#endregion //#region code/core/.dts-emit/code/core/src/shared/open-service/query-state.d.ts /** * Builds the synthetic first-render {@link QueryState} for a subscription hook, from a pure * `query.get(input)` read. * * Subscription hooks must return a {@link QueryState} on their very first render, before the * subscription's first emission has delivered the real lifecycle (`useSyncExternalStore` reads the * snapshot during render; the React 16-compatible preview hooks read it synchronously too). `get()` * returns only data (no lifecycle, no load), so we pair it with a `pending`/`loading` status as a * placeholder until the subscription delivers the real lifecycle moments later. A throw from * `get()` (e.g. input validation) becomes an `error` state — mirroring what the subscription would * emit — so the hook never throws during render. * * Shared by the manager-side `useServiceQuery` and the preview-side docs hooks so their first-render * seeds can never drift apart. * * Only the query's `get` method is needed, so the parameter is narrowed to that shape: `TOutput` then * infers purely (and reliably) from `get`'s return type, rather than through the contravariant * positions of the full `Query` type — which would widen `TOutput` and break callers that pass a * query with a hand-written payload type. */ declare function seedQueryState(query: { get(input: TInput): TOutput; }, input: TInput): QueryState; declare function seedQueryState(query: { get(input: TInput): TOutput; }, input: TInput, selector: (value: TOutput) => TSelected): QueryState; //#endregion //#region node_modules/valibot/dist/index.d.mts //#endregion //#region src/methods/fallback/fallback.d.ts /** * Fallback type. */ type Fallback>> = MaybeDeepReadonly> | ((dataset?: OutputDataset, InferIssue>, config?: Config>) => MaybeDeepReadonly>); /** * Schema with fallback type. */ type SchemaWithFallback>, TFallback$1 extends Fallback> = TSchema & { /** * The fallback value. */ readonly fallback: TFallback$1; }; /** * Returns a fallback value as output if the input does not match the schema. * * @param schema The schema to catch. * @param fallback The fallback value. * * @returns The passed schema. */ //#endregion //#region src/methods/fallback/fallbackAsync.d.ts /** * Fallback async type. */ type FallbackAsync> | BaseSchemaAsync>> = MaybeDeepReadonly> | ((dataset?: OutputDataset, InferIssue>, config?: Config>) => MaybePromise$2>>); /** * Schema with fallback async type. */ type SchemaWithFallbackAsync> | BaseSchemaAsync>, TFallback$1 extends FallbackAsync> = Omit & { /** * The fallback value. */ readonly fallback: TFallback$1; /** * Whether it's async. */ readonly async: true; /** * The Standard Schema properties. * * @internal */ readonly "~standard": StandardProps, InferOutput>; /** * Parses unknown input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise, InferIssue>>; }; /** * Returns a fallback value as output if the input does not match the schema. * * @param schema The schema to catch. * @param fallback The fallback value. * * @returns The passed schema. */ //#endregion //#region src/methods/pipe/pipe.d.ts /** * Schema with pipe type. */ type SchemaWithPipe>, ...PipeItem>[]]> = Omit, "pipe" | "~standard" | "~run" | "~types"> & { /** * The pipe items. */ readonly pipe: TPipe$1; /** * The Standard Schema properties. * * @internal */ readonly "~standard": StandardProps>, InferOutput>>; /** * Parses unknown input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, InferIssue>; /** * The input, output and issue type. * * @internal */ readonly "~types"?: { readonly input: InferInput>; readonly output: InferOutput>; readonly issue: InferIssue; } | undefined; }; /** * Adds a pipeline to a schema, that can validate and transform its input. * * @param schema The root schema. * @param item1 The first pipe item. * * @returns A schema with a pipeline. */ //#endregion //#region src/types/metadata.d.ts /** * Base metadata interface. */ interface BaseMetadata { /** * The object kind. */ readonly kind: "metadata"; /** * The metadata type. */ readonly type: string; /** * The metadata reference. */ readonly reference: (...args: any[]) => BaseMetadata; /** * The input, output and issue type. * * @internal */ readonly "~types"?: { readonly input: TInput$1; readonly output: TInput$1; readonly issue: never; } | undefined; } /** * Generic metadata type. */ //#endregion //#region src/types/dataset.d.ts /** * Unknown dataset interface. */ interface UnknownDataset { /** * Whether is's typed. */ typed?: false; /** * The dataset value. */ value: unknown; /** * The dataset issues. */ issues?: undefined; } /** * Success dataset interface. */ interface SuccessDataset { /** * Whether is's typed. */ typed: true; /** * The dataset value. */ value: TValue$1; /** * The dataset issues. */ issues?: undefined; } /** * Partial dataset interface. */ interface PartialDataset> { /** * Whether is's typed. */ typed: true; /** * The dataset value. */ value: TValue$1; /** * The dataset issues. */ issues: [TIssue, ...TIssue[]]; } /** * Failure dataset interface. */ interface FailureDataset> { /** * Whether is's typed. */ typed: false; /** * The dataset value. */ value: unknown; /** * The dataset issues. */ issues: [TIssue, ...TIssue[]]; } /** * Output dataset type. */ type OutputDataset> = SuccessDataset | PartialDataset | FailureDataset; //#endregion //#region src/types/standard.d.ts /** * The Standard Schema properties interface. */ interface StandardProps { /** * The version number of the standard. */ readonly version: 1; /** * The vendor name of the schema library. */ readonly vendor: "valibot"; /** * Validates unknown input values. */ readonly validate: (value: unknown) => StandardResult | Promise>; /** * Inferred types associated with the schema. */ readonly types?: StandardTypes | undefined; } /** * The result interface of the validate function. */ type StandardResult = StandardSuccessResult | StandardFailureResult; /** * The result interface if validation succeeds. */ interface StandardSuccessResult { /** * The typed output value. */ readonly value: TOutput$1; /** * The non-existent issues. */ readonly issues?: undefined; } /** * The result interface if validation fails. */ interface StandardFailureResult { /** * The issues of failed validation. */ readonly issues: readonly StandardIssue[]; } /** * The issue interface of the failure output. */ interface StandardIssue { /** * The error message of the issue. */ readonly message: string; /** * The path of the issue, if any. */ readonly path?: readonly (PropertyKey | StandardPathItem)[] | undefined; } /** * The path item interface of the issue. */ interface StandardPathItem { /** * The key of the path item. */ readonly key: PropertyKey; } /** * The Standard Schema types interface. */ interface StandardTypes { /** * The input type of the schema. */ readonly input: TInput$1; /** * The output type of the schema. */ readonly output: TOutput$1; } //#endregion //#region src/types/schema.d.ts /** * Base schema interface. */ interface BaseSchema> { /** * The object kind. */ readonly kind: "schema"; /** * The schema type. */ readonly type: string; /** * The schema reference. */ readonly reference: (...args: any[]) => BaseSchema>; /** * The expected property. */ readonly expects: string; /** * Whether it's async. */ readonly async: false; /** * The Standard Schema properties. * * @internal */ readonly "~standard": StandardProps; /** * Parses unknown input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset; /** * The input, output and issue type. * * @internal */ readonly "~types"?: { readonly input: TInput$1; readonly output: TOutput$1; readonly issue: TIssue; } | undefined; } /** * Base schema async interface. */ interface BaseSchemaAsync> extends Omit, "reference" | "async" | "~run"> { /** * The schema reference. */ readonly reference: (...args: any[]) => BaseSchema> | BaseSchemaAsync>; /** * Whether it's async. */ readonly async: true; /** * Parses unknown input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>; } /** * Generic schema type. */ type GenericSchema = BaseIssue> = BaseSchema; /** * Generic schema async type. */ //#endregion //#region src/types/transformation.d.ts /** * Base transformation interface. */ interface BaseTransformation> { /** * The object kind. */ readonly kind: "transformation"; /** * The transformation type. */ readonly type: string; /** * The transformation reference. */ readonly reference: (...args: any[]) => BaseTransformation>; /** * Whether it's async. */ readonly async: false; /** * Transforms known input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: SuccessDataset, config: Config>) => OutputDataset | TIssue>; /** * The input, output and issue type. * * @internal */ readonly "~types"?: { readonly input: TInput$1; readonly output: TOutput$1; readonly issue: TIssue; } | undefined; } /** * Base transformation async interface. */ interface BaseTransformationAsync> extends Omit, "reference" | "async" | "~run"> { /** * The transformation reference. */ readonly reference: (...args: any[]) => BaseTransformation> | BaseTransformationAsync>; /** * Whether it's async. */ readonly async: true; /** * Transforms known input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: SuccessDataset, config: Config>) => Promise | TIssue>>; } /** * Generic transformation type. */ //#endregion //#region src/types/validation.d.ts /** * Base validation interface. */ interface BaseValidation> { /** * The object kind. */ readonly kind: "validation"; /** * The validation type. */ readonly type: string; /** * The validation reference. */ readonly reference: (...args: any[]) => BaseValidation>; /** * The expected property. */ readonly expects: string | null; /** * Whether it's async. */ readonly async: false; /** * Validates known input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: OutputDataset>, config: Config>) => OutputDataset | TIssue>; /** * The input, output and issue type. * * @internal */ readonly "~types"?: { readonly input: TInput$1; readonly output: TOutput$1; readonly issue: TIssue; } | undefined; } /** * Base validation async interface. */ interface BaseValidationAsync> extends Omit, "reference" | "async" | "~run"> { /** * The validation reference. */ readonly reference: (...args: any[]) => BaseValidation> | BaseValidationAsync>; /** * Whether it's async. */ readonly async: true; /** * Validates known input values. * * @param dataset The input dataset. * @param config The configuration. * * @returns The output dataset. * * @internal */ readonly "~run": (dataset: OutputDataset>, config: Config>) => Promise | TIssue>>; } /** * Generic validation type. */ //#endregion //#region src/types/infer.d.ts /** * Infer input type. */ type InferInput> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["input"]; /** * Infer output type. */ type InferOutput> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["output"]; /** * Infer issue type. */ type InferIssue> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["issue"]; //#endregion //#region src/types/utils.d.ts /** * Checks if a type is `any`. */ /** * Constructs a type that is maybe readonly. */ type MaybeReadonly = TValue$1 | Readonly; /** * Constructs a type that is deeply readonly. */ type DeepReadonly = TValue$1 extends Record | readonly unknown[] ? { readonly [TKey in keyof TValue$1]: DeepReadonly } : TValue$1; /** * Constructs a type that is maybe deeply readonly. */ type MaybeDeepReadonly = TValue$1 | DeepReadonly; /** * Constructs a type that is maybe a promise. */ type MaybePromise$2 = TValue$1 | Promise; /** * Prettifies a type for better readability. * * Hint: This type has no effect and is only used so that TypeScript displays * the final type in the preview instead of the utility types used. */ type Prettify = { [TKey in keyof TObject]: TObject[TKey] } & {}; /** * Marks specific keys as optional. */ type MarkOptional = { [TKey in keyof TObject]?: unknown } & Omit & Partial>; /** * Merges two objects. Overlapping entries from the second object overwrite * properties from the first object. */ /** * Extracts first tuple item. */ type FirstTupleItem = TTuple[0]; /** * Extracts last tuple item. */ type LastTupleItem = TTuple[TTuple extends readonly [unknown, ...infer TRest] ? TRest["length"] : never]; /** * Converts union to intersection type. */ //#endregion //#region src/types/other.d.ts /** * Error message type. */ type ErrorMessage> = ((issue: TIssue) => string) | string; /** * Default type. */ type Default>, TInput$1 extends null | undefined> = MaybeDeepReadonly | TInput$1> | ((dataset?: UnknownDataset, config?: Config>) => MaybeDeepReadonly | TInput$1>) | undefined; /** * Default async type. */ type DefaultAsync> | BaseSchemaAsync>, TInput$1 extends null | undefined> = MaybeDeepReadonly | TInput$1> | ((dataset?: UnknownDataset, config?: Config>) => MaybePromise$2 | TInput$1>>) | undefined; /** * Default value type. */ type DefaultValue>, null | undefined> | DefaultAsync> | BaseSchemaAsync>, null | undefined>> = TDefault extends DefaultAsync> | BaseSchemaAsync>, infer TInput> ? TDefault extends ((dataset?: UnknownDataset, config?: Config>) => MaybePromise$2 | TInput>>) ? Awaited> : TDefault : never; //#endregion //#region src/types/object.d.ts /** * Optional entry schema type. */ type OptionalEntrySchema = ExactOptionalSchema>, unknown> | NullishSchema>, unknown> | OptionalSchema>, unknown>; /** * Optional entry schema async type. */ type OptionalEntrySchemaAsync = ExactOptionalSchemaAsync> | BaseSchemaAsync>, unknown> | NullishSchemaAsync> | BaseSchemaAsync>, unknown> | OptionalSchemaAsync> | BaseSchemaAsync>, unknown>; /** * Object entries interface. */ interface ObjectEntries { [key: string]: BaseSchema> | SchemaWithFallback>, unknown> | OptionalEntrySchema; } /** * Object entries async interface. */ interface ObjectEntriesAsync { [key: string]: BaseSchema> | BaseSchemaAsync> | SchemaWithFallback>, unknown> | SchemaWithFallbackAsync> | BaseSchemaAsync>, unknown> | OptionalEntrySchema | OptionalEntrySchemaAsync; } /** * Object keys type. */ /** * Infer entries input type. */ type InferEntriesInput = { -readonly [TKey in keyof TEntries$1]: InferInput }; /** * Infer entries output type. */ type InferEntriesOutput = { -readonly [TKey in keyof TEntries$1]: InferOutput }; /** * Optional input keys type. */ type OptionalInputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? TKey : never }[keyof TEntries$1]; /** * Optional output keys type. */ type OptionalOutputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? undefined extends TEntries$1[TKey]["default"] ? TKey : never : never }[keyof TEntries$1]; /** * Input with question marks type. */ type InputWithQuestionMarks> = MarkOptional>; /** * Output with question marks type. */ type OutputWithQuestionMarks> = MarkOptional>; /** * Readonly output keys type. */ type ReadonlyOutputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends { readonly pipe: readonly unknown[]; } ? ReadonlyAction extends TEntries$1[TKey]["pipe"][number] ? TKey : never : never }[keyof TEntries$1]; /** * Output with readonly type. */ type OutputWithReadonly>> = ReadonlyOutputKeys extends never ? TObject : Readonly & Pick>>; /** * Infer object input type. */ type InferObjectInput = Prettify>>; /** * Infer object output type. */ type InferObjectOutput = Prettify>>>; /** * Infer object issue type. */ type InferObjectIssue = InferIssue; //#endregion //#region src/types/tuple.d.ts /** * Tuple items type. */ //#endregion //#region src/types/issue.d.ts /** * Array path item interface. */ interface ArrayPathItem { /** * The path item type. */ readonly type: "array"; /** * The path item origin. */ readonly origin: "value"; /** * The path item input. */ readonly input: MaybeReadonly; /** * The path item key. */ readonly key: number; /** * The path item value. */ readonly value: unknown; } /** * Map path item interface. */ interface MapPathItem { /** * The path item type. */ readonly type: "map"; /** * The path item origin. */ readonly origin: "key" | "value"; /** * The path item input. */ readonly input: Map; /** * The path item key. */ readonly key: unknown; /** * The path item value. */ readonly value: unknown; } /** * Object path item interface. */ interface ObjectPathItem { /** * The path item type. */ readonly type: "object"; /** * The path item origin. */ readonly origin: "key" | "value"; /** * The path item input. */ readonly input: Record; /** * The path item key. */ readonly key: string; /** * The path item value. */ readonly value: unknown; } /** * Set path item interface. */ interface SetPathItem { /** * The path item type. */ readonly type: "set"; /** * The path item origin. */ readonly origin: "value"; /** * The path item input. */ readonly input: Set; /** * The path item key. */ readonly key: null; /** * The path item key. */ readonly value: unknown; } /** * Unknown path item interface. */ interface UnknownPathItem { /** * The path item type. */ readonly type: "unknown"; /** * The path item origin. */ readonly origin: "key" | "value"; /** * The path item input. */ readonly input: unknown; /** * The path item key. */ readonly key: unknown; /** * The path item value. */ readonly value: unknown; } /** * Issue path item type. */ type IssuePathItem = ArrayPathItem | MapPathItem | ObjectPathItem | SetPathItem | UnknownPathItem; /** * Base issue interface. */ interface BaseIssue extends Config> { /** * The issue kind. */ readonly kind: "schema" | "validation" | "transformation"; /** * The issue type. */ readonly type: string; /** * The raw input data. */ readonly input: TInput$1; /** * The expected property. */ readonly expected: string | null; /** * The received property. */ readonly received: string; /** * The error message. */ readonly message: string; /** * The input requirement. */ readonly requirement?: unknown | undefined; /** * The issue path. */ readonly path?: [IssuePathItem, ...IssuePathItem[]] | undefined; /** * The sub issues. */ readonly issues?: [BaseIssue, ...BaseIssue[]] | undefined; } /** * Generic issue type. */ //#endregion //#region src/types/config.d.ts /** * Config interface. */ interface Config> { /** * The selected language. */ readonly lang?: string | undefined; /** * The error message. */ readonly message?: ErrorMessage | undefined; /** * Whether it should be aborted early. */ readonly abortEarly?: boolean | undefined; /** * Whether a pipe should be aborted early. */ readonly abortPipeEarly?: boolean | undefined; } //#endregion //#region src/types/pipe.d.ts /** * Pipe action type. */ type PipeAction> = BaseValidation | BaseTransformation | BaseMetadata; /** * Pipe action async type. */ /** * Pipe item type. */ type PipeItem> = BaseSchema | PipeAction; /** * Pipe item async type. */ //#endregion //#region src/schemas/array/types.d.ts /** * Array issue interface. */ interface ArrayIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "array"; /** * The expected property. */ readonly expected: "Array"; } //#endregion //#region src/schemas/array/array.d.ts /** * Array schema interface. */ interface ArraySchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema[], InferOutput[], ArrayIssue | InferIssue> { /** * The schema type. */ readonly type: "array"; /** * The schema reference. */ readonly reference: typeof array; /** * The expected property. */ readonly expects: "Array"; /** * The array item schema. */ readonly item: TItem$1; /** * The error message. */ readonly message: TMessage; } /** * Creates an array schema. * * @param item The item schema. * * @returns An array schema. */ declare function array>>(item: TItem$1): ArraySchema; /** * Creates an array schema. * * @param item The item schema. * @param message The error message. * * @returns An array schema. */ declare function array>, const TMessage extends ErrorMessage | undefined>(item: TItem$1, message: TMessage): ArraySchema; //#endregion //#region src/schemas/array/arrayAsync.d.ts /** * Array schema interface. */ //#endregion //#region src/schemas/custom/types.d.ts /** * Custom issue interface. */ interface CustomIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "custom"; /** * The expected property. */ readonly expected: "unknown"; } //#endregion //#region src/schemas/custom/custom.d.ts /** * Check type. */ type Check = (input: unknown) => boolean; /** * Custom schema interface. */ interface CustomSchema | undefined> extends BaseSchema { /** * The schema type. */ readonly type: "custom"; /** * The schema reference. */ readonly reference: typeof custom; /** * The expected property. */ readonly expects: "unknown"; /** * The type check function. */ readonly check: Check; /** * The error message. */ readonly message: TMessage; } /** * Creates a custom schema. * * @param check The type check function. * * @returns A custom schema. */ declare function custom(check: Check): CustomSchema; /** * Creates a custom schema. * * @param check The type check function. * @param message The error message. * * @returns A custom schema. */ declare function custom | undefined = ErrorMessage | undefined>(check: Check, message: TMessage): CustomSchema; //#endregion //#region src/schemas/custom/customAsync.d.ts /** * Check async type. */ //#endregion //#region src/schemas/exactOptional/exactOptional.d.ts /** * Exact optional schema interface. */ interface ExactOptionalSchema>, TDefault extends Default> extends BaseSchema, InferOutput, InferIssue> { /** * The schema type. */ readonly type: "exact_optional"; /** * The schema reference. */ readonly reference: typeof exactOptional; /** * The expected property. */ readonly expects: TWrapped$1["expects"]; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates an exact optional schema. * * @param wrapped The wrapped schema. * * @returns An exact optional schema. */ declare function exactOptional>>(wrapped: TWrapped$1): ExactOptionalSchema; /** * Creates an exact optional schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns An exact optional schema. */ declare function exactOptional>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): ExactOptionalSchema; //#endregion //#region src/schemas/exactOptional/exactOptionalAsync.d.ts /** * Exact optional schema async interface. */ interface ExactOptionalSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync, InferOutput, InferIssue> { /** * The schema type. */ readonly type: "exact_optional"; /** * The schema reference. */ readonly reference: typeof exactOptional | typeof exactOptionalAsync; /** * The expected property. */ readonly expects: TWrapped$1["expects"]; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates an exact optional schema. * * @param wrapped The wrapped schema. * * @returns An exact optional schema. */ declare function exactOptionalAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): ExactOptionalSchemaAsync; /** * Creates an exact optional schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns An exact optional schema. */ declare function exactOptionalAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): ExactOptionalSchemaAsync; //#endregion //#region src/schemas/file/file.d.ts /** * File issue interface. */ //#endregion //#region src/schemas/literal/literal.d.ts /** * Literal type. */ type Literal = bigint | boolean | number | string | symbol; /** * Literal issue interface. */ interface LiteralIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "literal"; /** * The expected property. */ readonly expected: string; } /** * Literal schema interface. */ interface LiteralSchema | undefined> extends BaseSchema { /** * The schema type. */ readonly type: "literal"; /** * The schema reference. */ readonly reference: typeof literal; /** * The literal value. */ readonly literal: TLiteral; /** * The error message. */ readonly message: TMessage; } /** * Creates a literal schema. * * @param literal_ The literal value. * * @returns A literal schema. */ declare function literal(literal_: TLiteral): LiteralSchema; /** * Creates a literal schema. * * @param literal_ The literal value. * @param message The error message. * * @returns A literal schema. */ declare function literal | undefined>(literal_: TLiteral, message: TMessage): LiteralSchema; //#endregion //#region src/schemas/looseObject/types.d.ts /** * Loose object issue interface. */ interface LooseObjectIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "loose_object"; /** * The expected property. */ readonly expected: "Object" | `"${string}"`; } //#endregion //#region src/schemas/looseObject/looseObject.d.ts /** * Loose object schema interface. */ interface LooseObjectSchema | undefined> extends BaseSchema & { [key: string]: unknown; }, InferObjectOutput & { [key: string]: unknown; }, LooseObjectIssue | InferObjectIssue> { /** * The schema type. */ readonly type: "loose_object"; /** * The schema reference. */ readonly reference: typeof looseObject; /** * The expected property. */ readonly expects: "Object"; /** * The entries schema. */ readonly entries: TEntries$1; /** * The error message. */ readonly message: TMessage; } /** * Creates a loose object schema. * * @param entries The entries schema. * * @returns A loose object schema. */ declare function looseObject(entries: TEntries$1): LooseObjectSchema; /** * Creates a loose object schema. * * @param entries The entries schema. * @param message The error message. * * @returns A loose object schema. */ declare function looseObject | undefined>(entries: TEntries$1, message: TMessage): LooseObjectSchema; //#endregion //#region src/schemas/looseObject/looseObjectAsync.d.ts /** * Object schema async interface. */ interface LooseObjectSchemaAsync | undefined> extends BaseSchemaAsync & { [key: string]: unknown; }, InferObjectOutput & { [key: string]: unknown; }, LooseObjectIssue | InferObjectIssue> { /** * The schema type. */ readonly type: "loose_object"; /** * The schema reference. */ readonly reference: typeof looseObject | typeof looseObjectAsync; /** * The expected property. */ readonly expects: "Object"; /** * The entries schema. */ readonly entries: TEntries$1; /** * The error message. */ readonly message: TMessage; } /** * Creates a loose object schema. * * @param entries The entries schema. * * @returns A loose object schema. */ declare function looseObjectAsync(entries: TEntries$1): LooseObjectSchemaAsync; /** * Creates a loose object schema. * * @param entries The entries schema. * @param message The error message. * * @returns A loose object schema. */ declare function looseObjectAsync | undefined>(entries: TEntries$1, message: TMessage): LooseObjectSchemaAsync; //#endregion //#region src/schemas/looseTuple/types.d.ts /** * Loose tuple issue interface. */ //#endregion //#region src/schemas/nullish/types.d.ts /** * Infer nullish output type. */ type InferNullishOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | null | undefined : InferOutput | Extract, null | undefined>; //#endregion //#region src/schemas/nullish/nullish.d.ts /** * Nullish schema interface. */ interface NullishSchema>, TDefault extends Default> extends BaseSchema | null | undefined, InferNullishOutput, InferIssue> { /** * The schema type. */ readonly type: "nullish"; /** * The schema reference. */ readonly reference: typeof nullish; /** * The expected property. */ readonly expects: `(${TWrapped$1["expects"]} | null | undefined)`; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates a nullish schema. * * @param wrapped The wrapped schema. * * @returns A nullish schema. */ declare function nullish>>(wrapped: TWrapped$1): NullishSchema; /** * Creates a nullish schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns A nullish schema. */ declare function nullish>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): NullishSchema; //#endregion //#region src/schemas/nullish/nullishAsync.d.ts /** * Nullish schema async interface. */ interface NullishSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | null | undefined, InferNullishOutput, InferIssue> { /** * The schema type. */ readonly type: "nullish"; /** * The schema reference. */ readonly reference: typeof nullish | typeof nullishAsync; /** * The expected property. */ readonly expects: `(${TWrapped$1["expects"]} | null | undefined)`; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates a nullish schema. * * @param wrapped The wrapped schema. * * @returns A nullish schema. */ declare function nullishAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NullishSchemaAsync; /** * Creates a nullish schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns A nullish schema. */ declare function nullishAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): NullishSchemaAsync; //#endregion //#region src/schemas/number/number.d.ts /** * Number issue interface. */ interface NumberIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "number"; /** * The expected property. */ readonly expected: "number"; } /** * Number schema interface. */ interface NumberSchema | undefined> extends BaseSchema { /** * The schema type. */ readonly type: "number"; /** * The schema reference. */ readonly reference: typeof number; /** * The expected property. */ readonly expects: "number"; /** * The error message. */ readonly message: TMessage; } /** * Creates a number schema. * * @returns A number schema. */ declare function number(): NumberSchema; /** * Creates a number schema. * * @param message The error message. * * @returns A number schema. */ declare function number | undefined>(message: TMessage): NumberSchema; //#endregion //#region src/schemas/object/types.d.ts /** * Object issue interface. */ interface ObjectIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "object"; /** * The expected property. */ readonly expected: "Object" | `"${string}"`; } //#endregion //#region src/schemas/object/object.d.ts /** * Object schema interface. */ interface ObjectSchema | undefined> extends BaseSchema, InferObjectOutput, ObjectIssue | InferObjectIssue> { /** * The schema type. */ readonly type: "object"; /** * The schema reference. */ readonly reference: typeof object; /** * The expected property. */ readonly expects: "Object"; /** * The entries schema. */ readonly entries: TEntries$1; /** * The error message. */ readonly message: TMessage; } /** * Creates an object schema. * * Hint: This schema removes unknown entries. The output will only include the * entries you specify. To include unknown entries, use `looseObject`. To * return an issue for unknown entries, use `strictObject`. To include and * validate unknown entries, use `objectWithRest`. * * @param entries The entries schema. * * @returns An object schema. */ declare function object(entries: TEntries$1): ObjectSchema; /** * Creates an object schema. * * Hint: This schema removes unknown entries. The output will only include the * entries you specify. To include unknown entries, use `looseObject`. To * return an issue for unknown entries, use `strictObject`. To include and * validate unknown entries, use `objectWithRest`. * * @param entries The entries schema. * @param message The error message. * * @returns An object schema. */ declare function object | undefined>(entries: TEntries$1, message: TMessage): ObjectSchema; //#endregion //#region src/schemas/object/objectAsync.d.ts /** * Object schema async interface. */ interface ObjectSchemaAsync | undefined> extends BaseSchemaAsync, InferObjectOutput, ObjectIssue | InferObjectIssue> { /** * The schema type. */ readonly type: "object"; /** * The schema reference. */ readonly reference: typeof object | typeof objectAsync; /** * The expected property. */ readonly expects: "Object"; /** * The entries schema. */ readonly entries: TEntries$1; /** * The error message. */ readonly message: TMessage; } /** * Creates an object schema. * * Hint: This schema removes unknown entries. The output will only include the * entries you specify. To include unknown entries, use `looseObjectAsync`. To * return an issue for unknown entries, use `strictObjectAsync`. To include and * validate unknown entries, use `objectWithRestAsync`. * * @param entries The entries schema. * * @returns An object schema. */ declare function objectAsync(entries: TEntries$1): ObjectSchemaAsync; /** * Creates an object schema. * * Hint: This schema removes unknown entries. The output will only include the * entries you specify. To include unknown entries, use `looseObjectAsync`. To * return an issue for unknown entries, use `strictObjectAsync`. To include and * validate unknown entries, use `objectWithRestAsync`. * * @param entries The entries schema. * @param message The error message. * * @returns An object schema. */ declare function objectAsync | undefined>(entries: TEntries$1, message: TMessage): ObjectSchemaAsync; //#endregion //#region src/schemas/objectWithRest/types.d.ts /** * Object with rest issue interface. */ interface ObjectWithRestIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "object_with_rest"; /** * The expected property. */ readonly expected: "Object" | `"${string}"`; } //#endregion //#region src/schemas/objectWithRest/objectWithRest.d.ts /** * Object with rest schema interface. */ interface ObjectWithRestSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema & { [key: string]: InferInput; }, InferObjectOutput & { [key: string]: InferOutput; }, ObjectWithRestIssue | InferObjectIssue | InferIssue> { /** * The schema type. */ readonly type: "object_with_rest"; /** * The schema reference. */ readonly reference: typeof objectWithRest; /** * The expected property. */ readonly expects: "Object"; /** * The entries schema. */ readonly entries: TEntries$1; /** * The rest schema. */ readonly rest: TRest$1; /** * The error message. */ readonly message: TMessage; } /** * Creates an object with rest schema. * * @param entries The entries schema. * @param rest The rest schema. * * @returns An object with rest schema. */ declare function objectWithRest>>(entries: TEntries$1, rest: TRest$1): ObjectWithRestSchema; /** * Creates an object with rest schema. * * @param entries The entries schema. * @param rest The rest schema. * @param message The error message. * * @returns An object with rest schema. */ declare function objectWithRest>, const TMessage extends ErrorMessage | undefined>(entries: TEntries$1, rest: TRest$1, message: TMessage): ObjectWithRestSchema; //#endregion //#region src/schemas/objectWithRest/objectWithRestAsync.d.ts /** * Object schema async interface. */ interface ObjectWithRestSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync & { [key: string]: InferInput; }, InferObjectOutput & { [key: string]: InferOutput; }, ObjectWithRestIssue | InferObjectIssue | InferIssue> { /** * The schema type. */ readonly type: "object_with_rest"; /** * The schema reference. */ readonly reference: typeof objectWithRest | typeof objectWithRestAsync; /** * The expected property. */ readonly expects: "Object"; /** * The entries schema. */ readonly entries: TEntries$1; /** * The rest schema. */ readonly rest: TRest$1; /** * The error message. */ readonly message: TMessage; } /** * Creates an object with rest schema. * * @param entries The entries schema. * @param rest The rest schema. * * @returns An object with rest schema. */ declare function objectWithRestAsync> | BaseSchemaAsync>>(entries: TEntries$1, rest: TRest$1): ObjectWithRestSchemaAsync; /** * Creates an object with rest schema. * * @param entries The entries schema. * @param rest The rest schema. * @param message The error message. * * @returns An object with rest schema. */ declare function objectWithRestAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(entries: TEntries$1, rest: TRest$1, message: TMessage): ObjectWithRestSchemaAsync; //#endregion //#region src/schemas/optional/types.d.ts /** * Infer optional output type. */ type InferOptionalOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | undefined : InferOutput | Extract, undefined>; //#endregion //#region src/schemas/optional/optional.d.ts /** * Optional schema interface. */ interface OptionalSchema>, TDefault extends Default> extends BaseSchema | undefined, InferOptionalOutput, InferIssue> { /** * The schema type. */ readonly type: "optional"; /** * The schema reference. */ readonly reference: typeof optional; /** * The expected property. */ readonly expects: `(${TWrapped$1["expects"]} | undefined)`; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates an optional schema. * * @param wrapped The wrapped schema. * * @returns An optional schema. */ declare function optional>>(wrapped: TWrapped$1): OptionalSchema; /** * Creates an optional schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns An optional schema. */ declare function optional>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): OptionalSchema; //#endregion //#region src/schemas/optional/optionalAsync.d.ts /** * Optional schema async interface. */ interface OptionalSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | undefined, InferOptionalOutput, InferIssue> { /** * The schema type. */ readonly type: "optional"; /** * The schema reference. */ readonly reference: typeof optional | typeof optionalAsync; /** * The expected property. */ readonly expects: `(${TWrapped$1["expects"]} | undefined)`; /** * The wrapped schema. */ readonly wrapped: TWrapped$1; /** * The default value. */ readonly default: TDefault; } /** * Creates an optional schema. * * @param wrapped The wrapped schema. * * @returns An optional schema. */ declare function optionalAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): OptionalSchemaAsync; /** * Creates an optional schema. * * @param wrapped The wrapped schema. * @param default_ The default value. * * @returns An optional schema. */ declare function optionalAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): OptionalSchemaAsync; //#endregion //#region src/schemas/picklist/picklist.d.ts /** * Picklist options type. */ //#endregion //#region src/schemas/record/types.d.ts /** * Record issue interface. */ interface RecordIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "record"; /** * The expected property. */ readonly expected: "Object"; } /** * Is literal type. */ type IsLiteral = string extends TKey$1 ? false : number extends TKey$1 ? false : symbol extends TKey$1 ? false : TKey$1 extends Brand ? false : true; /** * Optional keys type. */ type OptionalKeys> = { [TKey in keyof TObject]: IsLiteral extends true ? TKey : never }[keyof TObject]; /** * With question marks type. * * Hint: We mark an entry as optional if we detect that its key is a literal * type. The reason for this is that it is not technically possible to detect * missing literal keys without restricting the key schema to `string`, `enum` * and `picklist`. However, if `enum` and `picklist` are used, it is better to * use `object` with `entriesFromList` because it already covers the needed * functionality. This decision also reduces the bundle size of `record`, * because it only needs to check the entries of the input and not any missing * keys. */ type WithQuestionMarks> = MarkOptional>; /** * With readonly type. */ type WithReadonly> | BaseSchemaAsync>, TObject extends WithQuestionMarks>> = TValue$1 extends { readonly pipe: readonly unknown[]; } ? ReadonlyAction extends TValue$1["pipe"][number] ? Readonly : TObject : TObject; /** * Infer record input type. */ type InferRecordInput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Prettify, InferInput>>>; /** * Infer record output type. */ type InferRecordOutput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Prettify, InferOutput>>>>; //#endregion //#region src/schemas/record/record.d.ts /** * Record schema interface. */ interface RecordSchema>, TValue$1 extends BaseSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferRecordOutput, RecordIssue | InferIssue | InferIssue> { /** * The schema type. */ readonly type: "record"; /** * The schema reference. */ readonly reference: typeof record; /** * The expected property. */ readonly expects: "Object"; /** * The record key schema. */ readonly key: TKey$1; /** * The record value schema. */ readonly value: TValue$1; /** * The error message. */ readonly message: TMessage; } /** * Creates a record schema. * * @param key The key schema. * @param value The value schema. * * @returns A record schema. */ declare function record>, const TValue$1 extends BaseSchema>>(key: TKey$1, value: TValue$1): RecordSchema; /** * Creates a record schema. * * @param key The key schema. * @param value The value schema. * @param message The error message. * * @returns A record schema. */ declare function record>, const TValue$1 extends BaseSchema>, const TMessage extends ErrorMessage | undefined>(key: TKey$1, value: TValue$1, message: TMessage): RecordSchema; //#endregion //#region src/schemas/record/recordAsync.d.ts /** * Record schema async interface. */ //#endregion //#region src/schemas/strictObject/types.d.ts /** * Strict object issue interface. */ interface StrictObjectIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "strict_object"; /** * The expected property. */ readonly expected: "Object" | `"${string}"` | "never"; } //#endregion //#region src/schemas/strictObject/strictObject.d.ts /** * Strict object schema interface. */ interface StrictObjectSchema | undefined> extends BaseSchema, InferObjectOutput, StrictObjectIssue | InferObjectIssue> { /** * The schema type. */ readonly type: "strict_object"; /** * The schema reference. */ readonly reference: typeof strictObject; /** * The expected property. */ readonly expects: "Object"; /** * The entries schema. */ readonly entries: TEntries$1; /** * The error message. */ readonly message: TMessage; } /** * Creates a strict object schema. * * @param entries The entries schema. * * @returns A strict object schema. */ declare function strictObject(entries: TEntries$1): StrictObjectSchema; /** * Creates a strict object schema. * * @param entries The entries schema. * @param message The error message. * * @returns A strict object schema. */ declare function strictObject | undefined>(entries: TEntries$1, message: TMessage): StrictObjectSchema; //#endregion //#region src/schemas/strictObject/strictObjectAsync.d.ts /** * Strict object schema async interface. */ interface StrictObjectSchemaAsync | undefined> extends BaseSchemaAsync, InferObjectOutput, StrictObjectIssue | InferObjectIssue> { /** * The schema type. */ readonly type: "strict_object"; /** * The schema reference. */ readonly reference: typeof strictObject | typeof strictObjectAsync; /** * The expected property. */ readonly expects: "Object"; /** * The entries schema. */ readonly entries: TEntries$1; /** * The error message. */ readonly message: TMessage; } /** * Creates a strict object schema. * * @param entries The entries schema. * * @returns A strict object schema. */ declare function strictObjectAsync(entries: TEntries$1): StrictObjectSchemaAsync; /** * Creates a strict object schema. * * @param entries The entries schema. * @param message The error message. * * @returns A strict object schema. */ declare function strictObjectAsync | undefined>(entries: TEntries$1, message: TMessage): StrictObjectSchemaAsync; //#endregion //#region src/schemas/strictTuple/types.d.ts /** * Strict tuple issue interface. */ //#endregion //#region src/schemas/string/string.d.ts /** * String issue interface. */ interface StringIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "string"; /** * The expected property. */ readonly expected: "string"; } /** * String schema interface. */ interface StringSchema | undefined> extends BaseSchema { /** * The schema type. */ readonly type: "string"; /** * The schema reference. */ readonly reference: typeof string; /** * The expected property. */ readonly expects: "string"; /** * The error message. */ readonly message: TMessage; } /** * Creates a string schema. * * @returns A string schema. */ declare function string(): StringSchema; /** * Creates a string schema. * * @param message The error message. * * @returns A string schema. */ declare function string | undefined>(message: TMessage): StringSchema; //#endregion //#region src/schemas/symbol/symbol.d.ts /** * Symbol issue interface. */ //#endregion //#region src/schemas/undefined/undefined.d.ts /** * Undefined issue interface. */ interface UndefinedIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "undefined"; /** * The expected property. */ readonly expected: "undefined"; } /** * Undefined schema interface. */ interface UndefinedSchema | undefined> extends BaseSchema { /** * The schema type. */ readonly type: "undefined"; /** * The schema reference. */ readonly reference: typeof undefined_; /** * The expected property. */ readonly expects: "undefined"; /** * The error message. */ readonly message: TMessage; } /** * Creates an undefined schema. * * @returns An undefined schema. */ declare function undefined_(): UndefinedSchema; /** * Creates an undefined schema. * * @param message The error message. * * @returns An undefined schema. */ declare function undefined_ | undefined>(message: TMessage): UndefinedSchema; //#endregion //#region src/schemas/undefinedable/types.d.ts /** * Infer undefinedable output type. */ //#endregion //#region src/schemas/variant/variant.d.ts /** * Variant schema interface. */ interface VariantSchema, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferOutput, VariantIssue | InferVariantIssue> { /** * The schema type. */ readonly type: "variant"; /** * The schema reference. */ readonly reference: typeof variant; /** * The expected property. */ readonly expects: "Object"; /** * The discriminator key. */ readonly key: TKey$1; /** * The variant options. */ readonly options: TOptions$1; /** * The error message. */ readonly message: TMessage; } /** * Creates a variant schema. * * @param key The discriminator key. * @param options The variant options. * * @returns A variant schema. */ declare function variant>(key: TKey$1, options: TOptions$1): VariantSchema; /** * Creates a variant schema. * * @param key The discriminator key. * @param options The variant options. * @param message The error message. * * @returns An variant schema. */ declare function variant, const TMessage extends ErrorMessage | undefined>(key: TKey$1, options: TOptions$1, message: TMessage): VariantSchema; //#endregion //#region src/schemas/variant/variantAsync.d.ts /** * Variant schema async interface. */ interface VariantSchemaAsync, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferOutput, VariantIssue | InferVariantIssue> { /** * The schema type. */ readonly type: "variant"; /** * The schema reference. */ readonly reference: typeof variant | typeof variantAsync; /** * The expected property. */ readonly expects: "Object"; /** * The discriminator key. */ readonly key: TKey$1; /** * The variant options. */ readonly options: TOptions$1; /** * The error message. */ readonly message: TMessage; } /** * Creates a variant schema. * * @param key The discriminator key. * @param options The variant options. * * @returns A variant schema. */ declare function variantAsync>(key: TKey$1, options: TOptions$1): VariantSchemaAsync; /** * Creates a variant schema. * * @param key The discriminator key. * @param options The variant options. * @param message The error message. * * @returns An variant schema. */ declare function variantAsync, const TMessage extends ErrorMessage | undefined>(key: TKey$1, options: TOptions$1, message: TMessage): VariantSchemaAsync; //#endregion //#region src/schemas/variant/types.d.ts /** * Variant issue interface. */ interface VariantIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "variant"; /** * The expected property. */ readonly expected: string; } /** * Variant option schema interface. */ interface VariantOptionSchema extends BaseSchema> { readonly type: "variant"; readonly reference: typeof variant; readonly key: string; readonly options: VariantOptions; readonly message: ErrorMessage | undefined; } /** * Variant option schema async interface. */ interface VariantOptionSchemaAsync extends BaseSchemaAsync> { readonly type: "variant"; readonly reference: typeof variant | typeof variantAsync; readonly key: string; readonly options: VariantOptionsAsync; readonly message: ErrorMessage | undefined; } /** * Variant object entries type. */ type VariantObjectEntries = Record> | OptionalEntrySchema> & ObjectEntries; /** * Variant object entries async type. */ type VariantObjectEntriesAsync = Record> | BaseSchemaAsync> | OptionalEntrySchema | OptionalEntrySchemaAsync> & ObjectEntriesAsync; /** * Variant option type. */ type VariantOption = LooseObjectSchema, ErrorMessage | undefined> | ObjectSchema, ErrorMessage | undefined> | ObjectWithRestSchema, BaseSchema>, ErrorMessage | undefined> | StrictObjectSchema, ErrorMessage | undefined> | VariantOptionSchema; /** * Variant option async type. */ type VariantOptionAsync = LooseObjectSchemaAsync, ErrorMessage | undefined> | ObjectSchemaAsync, ErrorMessage | undefined> | ObjectWithRestSchemaAsync, BaseSchema> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync, ErrorMessage | undefined> | VariantOptionSchemaAsync; /** * Variant options type. */ type VariantOptions = MaybeReadonly[]>; /** * Variant options async type. */ type VariantOptionsAsync = MaybeReadonly<(VariantOption | VariantOptionAsync)[]>; /** * Infer variant issue type. */ type InferVariantIssue | VariantOptionsAsync> = Exclude, { type: "loose_object" | "object" | "object_with_rest"; }>; //#endregion //#region src/schemas/void/void.d.ts /** * Void issue interface. */ interface VoidIssue extends BaseIssue { /** * The issue kind. */ readonly kind: "schema"; /** * The issue type. */ readonly type: "void"; /** * The expected property. */ readonly expected: "void"; } /** * Void schema interface. */ interface VoidSchema | undefined> extends BaseSchema { /** * The schema type. */ readonly type: "void"; /** * The schema reference. */ readonly reference: typeof void_; /** * The expected property. */ readonly expects: "void"; /** * The error message. */ readonly message: TMessage; } /** * Creates a void schema. * * @returns A void schema. */ declare function void_(): VoidSchema; /** * Creates a void schema. * * @param message The error message. * * @returns A void schema. */ declare function void_ | undefined>(message: TMessage): VoidSchema; //#endregion //#region src/actions/args/args.d.ts /** * Schema type. */ //#endregion //#region src/actions/brand/brand.d.ts /** * Brand symbol. */ declare const BrandSymbol: unique symbol; /** * Brand name type. */ type BrandName = string | number | symbol; /** * Brand interface. */ interface Brand { [BrandSymbol]: { [TValue in TName]: TValue }; } /** * Brand action interface. */ //#endregion //#region src/actions/description/description.d.ts /** * Description action interface. */ interface DescriptionAction extends BaseMetadata { /** * The action type. */ readonly type: "description"; /** * The action reference. */ readonly reference: typeof description$1; /** * The description text. */ readonly description: TDescription; } /** * Creates a description metadata action. * * @param description_ The description text. * * @returns A description action. */ declare function description$1(description_: TDescription): DescriptionAction; //#endregion //#region src/actions/digits/digits.d.ts /** * Digits issue interface. */ //#endregion //#region src/actions/readonly/readonly.d.ts /** * Readonly output type. */ type ReadonlyOutput = TInput$1 extends Map ? ReadonlyMap : TInput$1 extends Set ? ReadonlySet : Readonly; /** * Readonly action interface. */ interface ReadonlyAction extends BaseTransformation, never> { /** * The action type. */ readonly type: "readonly"; /** * The action reference. */ readonly reference: typeof readonly; } /** * Creates a readonly transformation action. * * @returns A readonly action. */ declare function readonly(): ReadonlyAction; //#endregion //#region src/actions/reduceItems/reduceItems.d.ts /** * Array action type. */ //#endregion //#region code/core/.dts-emit/code/core/src/types/modules/indexer.d.ts type ExportName = string; type MetaId = string; interface StoriesSpecifier { /** When auto-titling, what to prefix all generated titles with (default: '') */ titlePrefix?: string; /** Where to start looking for story files */ directory: string; /** * What does the filename of a story file look like? (a glob, relative to directory, no leading * `./`) If unset, we use `** / *.@(mdx|stories.@(mdx|js|jsx|mjs|ts|tsx))` (no spaces) */ files?: string; } type StoriesEntry$1 = string | StoriesSpecifier; type NormalizedStoriesSpecifier$1 = Required & { importPathMatcher: RegExp; }; interface IndexerOptions { makeTitle: (userTitle?: string) => string; } interface IndexedStory { id: string; name: string; tags?: Tag$2[]; parameters?: Parameters$2; } interface IndexedCSFFile$1 { meta: { id?: string; title?: string; tags?: Tag$2[]; }; stories: IndexedStory[]; } /** * 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$1 = 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. */ createIndex: (fileName: string, options: IndexerOptions) => Promise; }; interface BaseIndexEntry { id: StoryId$2; name: StoryName$1; title: ComponentTitle$1; tags?: Tag$2[]; importPath: Path$1; } type StoryIndexEntry$1 = BaseIndexEntry & { type: 'story'; subtype: 'story' | 'test'; componentPath?: string; exportName?: string; parent?: StoryId$2; parentName?: StoryName$1; }; type DocsIndexEntry$1 = BaseIndexEntry & { storiesImports: Path$1[]; type: 'docs'; }; type IndexEntry$1 = StoryIndexEntry$1 | DocsIndexEntry$1; interface IndexInputStats$1 { loaders?: boolean; play?: boolean; tests?: boolean; render?: boolean; storyFn?: boolean; mount?: boolean; beforeEach?: boolean; moduleMock?: boolean; globals?: boolean; factory?: boolean; tags?: boolean; } /** The base input for indexing a story or docs entry. */ type BaseIndexInput = { /** The file to import from e.g. the story file. Defaults to the fileName arg passed to createIndex */importPath?: Path$1; /** The raw path/package of the file that provides meta.component, if one exists */ rawComponentPath?: Path$1; /** The name of the export to import. */ exportName: ExportName; /** The name of the entry, auto-generated from {@link exportName} if unspecified. */ name?: StoryName$1; /** The location in the sidebar, auto-generated from {@link importPath} if unspecified. */ title?: ComponentTitle$1; /** * 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$2[]; /** * 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$2; /** Stats about language feature usage that the indexer can optionally report */ __stats?: IndexInputStats$1; }; /** The input for indexing a story entry. */ type StoryIndexInput = BaseIndexInput & { type: 'story'; subtype?: 'story' | 'test'; parent?: StoryId$2; parentName?: StoryName$1; }; /** 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$1[]; }; type IndexInput$1 = StoryIndexInput | DocsIndexInput; interface V3CompatIndexEntry extends Omit { kind: ComponentTitle$1; story: StoryName$1; parameters: Parameters$2; } interface StoryIndexV2 { v: number; stories: Record & { name?: StoryName$1; }>; } interface StoryIndexV3 { v: number; stories: Record; } interface StoryIndex$1 { v: number; entries: Record; } //#endregion //#region code/core/.dts-emit/code/core/src/shared/open-service/services/docgen/types.d.ts /** * Caller-facing input to a docgen provider middleware. * * `entry` is the authoritative story-index entry for the requested component, selected with the * same rules as the React component manifest generator (`selectComponentEntriesByComponentId` in * `storybook/internal/common`): eligible story entries and attached docs, with story entries * preferred over attached docs for the same component id. */ interface DocgenProviderInput { entry: IndexEntry$1; } /** Free-form error attached to a payload or subcomponent. */ interface DocgenError { name: string; message: string; } /** Compact JSDoc tag map: tag name → list of tag values (e.g. `@example a` → `{ example: ['a'] }`). */ type DocgenJsDocTags = Record; /** * Docgen payload returned by `core/docgen`'s `docgen` query. * * Component-only fields (props, descriptions, subcomponents). Story snippets and file-level * imports live in `core/story-docs` when `experimentalDocgenServer` is enabled. */ interface DocgenPayload$1 { id: string; name: string; /** CSF story file import path from the index entry (same as component manifest `path`). */ path: string; description?: string; summary?: string; jsDocTags: DocgenJsDocTags; /** Renderer-converted argTypes derived from integration-specific docgen data at write time. */ argTypes?: StrictArgTypes$2; subcomponents?: Record; error?: DocgenError; [key: string]: unknown; } /** Component-level summary + docgen for one subcomponent. */ interface DocgenSubcomponent { name: string; path: string; description?: string; summary?: string; import?: string; jsDocTags: DocgenJsDocTags; /** Renderer-converted argTypes derived from integration-specific docgen data at write time. */ argTypes?: StrictArgTypes$2; error?: DocgenError; [key: string]: unknown; } /** * A docgen provider: given a component's index entry, returns a complete {@link DocgenPayload} or * `undefined` when no docgen is available for the file. * * Providers are composed middleware-style inside the docgen worker — each wraps the previous one in * the chain and may delegate to it to merge with downstream output. * * **Merge convention.** When combining your output with downstream's, use spread * (`{ ...downstream, ...yourOverrides }`) and `downstream?.field ?? yours` rather than rebuilding * the payload field-by-field. Manual reconstruction silently drops any fields a future provider * (or future schema change) adds and your provider doesn't know about. `??` preserves explicit * values from downstream — including empty strings — so providers that intentionally set a field * are not overridden by a later provider's defaults. */ type DocgenProvider = (input: DocgenProviderInput) => Promise; /** * Middleware that wraps the next provider in the docgen chain. * * The worker seeds the chain with an identity provider (returns `undefined`) and folds each * descriptor's middleware over it in registration order, so a later registrant wraps (and can * delegate to) the earlier ones. */ type DocgenMiddleware = (nextDocgen: DocgenProvider) => DocgenProvider; /** * Serializable descriptor a renderer or addon contributes via the `experimental_docgenProvider` * preset. * * Docgen extraction runs off the main thread in a long-lived worker owned by core. Because a * closure cannot cross a worker boundary, integrations describe their provider as data: a * `moduleSpecifier` pointing at a module that satisfies {@link DocgenWorkerModule}. Core collects * these descriptors (preserving preset order) and the worker imports and composes them. */ interface DocgenProviderDescriptor { /** Absolute path to a module that exports {@link DocgenWorkerModule.createDocgenProvider}. */ moduleSpecifier: string; } /** * Contract a worker-target docgen module must satisfy. The worker imports the descriptor's * `moduleSpecifier` and calls `createDocgenProvider()` once to build the middleware it folds into * the provider chain. Integrations implement only this factory — they never touch threading. */ interface DocgenWorkerModule { createDocgenProvider: () => DocgenMiddleware | Promise; } //#endregion //#region code/core/.dts-emit/code/core/src/shared/open-service/services/docgen/definition.d.ts type DocgenServiceState = { /** Extracted docgen keyed by component id. Populated by the `extractDocgen` command. */components: Record; }; /** * Definition for the `core/docgen` open service. * * The service carries only provider-extracted docgen (component name, description, props, JSDoc * tags, and the renderer-converted argTypes). Story/meta/project custom argTypes are NOT stored * here — consumers layer those in from their own sources (the docs blocks resolve the prepared * meta/story locally; the manager Controls panel reads them from the `STORY_PREPARED` channel). * * The query is a thin synchronous read of `state.components[id]` — it returns undefined when * nothing has been extracted yet rather than throwing, matching the open-service convention for * sync reads. The real work — story index lookup, provider invocation, error handling — lives in * the `extractDocgen` command, whose body is supplied at registration time because it needs to * close over the server-only story index and the composed `experimental_docgenProvider` chain. * The query's `load` hook calls `extractDocgen`, so `docgen.loaded()` is the awaitable form and * surfaces extraction errors. `docgenForAllComponents` delegates to the `extractAllDocgen` * command, whose handler is supplied at registration because it needs the story index. */ declare const docgenServiceDef: import("storybook/open-service").ServiceDefinition; }, undefined>, OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>, { readonly extractDocgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly extractAllDocgen: UndefinedSchema; }, { readonly extractDocgen: OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; readonly extractAllDocgen: VoidSchema; }, import("storybook/open-service").QueryFunctions<{ readonly docgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly docgenForAllComponents: VoidSchema; }, { readonly docgen: OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; readonly docgenForAllComponents: RecordSchema, LooseObjectSchema<{ readonly name: StringSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; }>> & ({ __internal_naming_error: "Operation \"docgen\" has internal: true but must be prefixed with \"_\""; } | { internal?: false; }); readonly docgenForAllComponents: import("storybook/open-service").QueryDefinition, RecordSchema, LooseObjectSchema<{ readonly name: StringSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>, { readonly extractDocgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly extractAllDocgen: UndefinedSchema; }, { readonly extractDocgen: OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; readonly extractAllDocgen: VoidSchema; }, import("storybook/open-service").QueryFunctions<{ readonly docgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly docgenForAllComponents: VoidSchema; }, { readonly docgen: OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; readonly docgenForAllComponents: RecordSchema, LooseObjectSchema<{ readonly name: StringSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; }>> & ({ __internal_naming_error: "Operation \"docgenForAllComponents\" has internal: true but must be prefixed with \"_\""; } | { internal?: false; }); } & { readonly docgen: { output: OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; }; readonly docgenForAllComponents: { output: RecordSchema, LooseObjectSchema<{ readonly name: StringSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; }; }, { readonly extractDocgen: import("storybook/open-service").CommandDefinition; }, undefined>, OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>, { readonly extractDocgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly extractAllDocgen: UndefinedSchema; }, { readonly extractDocgen: OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; readonly extractAllDocgen: VoidSchema; }, import("storybook/open-service").QueryFunctions<{ readonly docgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly docgenForAllComponents: VoidSchema; }, { readonly docgen: OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; readonly docgenForAllComponents: RecordSchema, LooseObjectSchema<{ readonly name: StringSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; }>> & ({ __internal_naming_error: "Operation \"extractDocgen\" has internal: true but must be prefixed with \"_\""; } | { internal?: false; }); readonly extractAllDocgen: import("storybook/open-service").CommandDefinition, VoidSchema, { readonly extractDocgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly extractAllDocgen: UndefinedSchema; }, { readonly extractDocgen: OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; readonly extractAllDocgen: VoidSchema; }, import("storybook/open-service").QueryFunctions<{ readonly docgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly docgenForAllComponents: VoidSchema; }, { readonly docgen: OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; readonly docgenForAllComponents: RecordSchema, LooseObjectSchema<{ readonly name: StringSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; }>> & ({ __internal_naming_error: "Operation \"extractAllDocgen\" has internal: true but must be prefixed with \"_\""; } | { internal?: false; }); } & { readonly extractDocgen: { output: OptionalSchema; readonly path: StringSchema; readonly description: OptionalSchema, undefined>; readonly summary: OptionalSchema, undefined>; readonly jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; readonly argTypes: OptionalSchema, undefined>, undefined>; readonly error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; readonly id: StringSchema; readonly subcomponents: OptionalSchema, LooseObjectSchema<{ name: StringSchema; path: StringSchema; description: OptionalSchema, undefined>; summary: OptionalSchema, undefined>; jsDocTags: RecordSchema, ArraySchema, undefined>, undefined>; argTypes: OptionalSchema, undefined>, undefined>; error: OptionalSchema; readonly message: StringSchema; }, undefined>, undefined>; import: OptionalSchema, undefined>; }, undefined>, undefined>, undefined>; }, undefined>, undefined>; }; readonly extractAllDocgen: { output: VoidSchema; }; }, "core/docgen">; type DocgenService = ServiceInstanceOf; //#endregion //#region code/core/.dts-emit/code/core/src/shared/open-service/services/module-graph/engine/adapters/types.d.ts type FileChangeEvent = { kind: 'add'; path: string; } | { kind: 'change'; path: string; } | { kind: 'unlink'; path: string; }; interface ChangeDetectionAdapter { /** Pull: builder produces resolve-config once at start; detector caches it. */ getResolveConfig(): Promise; /** Push: builder reports file-system events; returns an unsubscribe function. */ onFileChange(handler: (event: FileChangeEvent) => void): () => void; /** Optional: builder reports a startup failure so the detector can mark itself unavailable. */ onStartupFailure?(handler: (event: { reason: string; error?: Error; }) => void): () => void; } //#endregion //#region code/core/.dts-emit/code/core/src/shared/open-service/services/module-graph/engine/parser-registry/types.d.ts /** Arguments handed to an {@link ImportParser} when the registry dispatches a file to it. */ interface ParseFileArgs { filePath: string; source: string; } /** * Services passed to every parser. SFC parsers (vue, svelte) extract a `