import React, { FC, ReactNode, ReactElement, Component } from 'react'; import { Channel as Channel$1, Listener as Listener$2 } from 'storybook/internal/channels'; export { Listener as ChannelListener } from 'storybook/internal/channels'; import { RouterData, NavigateOptions } from 'storybook/internal/router'; import { Addon_Types, Addon_TypesEnum, Addon_Collection, Addon_TypesMapping, Addon_BaseType, Addon_TestProviderType, Addon_PageType, Addon_WrapperType, Addon_Config, API_ProviderData, API_StateMerger, API_Provider, Globals, GlobalTypes, API_Layout, API_LayoutCustomisations, API_UI, API_PanelPositions, API_Notification, API_IframeRenderer, API_Refs, API_ComposedRef, API_SetRefData, API_ComposedRefUpdate, API_Settings, StoryId, API_LoadedRefData, API_PreparedStoryIndex, API_ViewMode, API_FilterFunction, TagsOptions, Tag as Tag$1, StatusValue as StatusValue$1, API_HashEntry, API_LeafEntry, API_StoryEntry, API_TestEntry, Args, API_IndexHash, API_DocsEntry, API_Versions, API_UnknownEntries, API_Version, API_OptionsData, Parameters, ArgTypes, NormalizedProjectAnnotations, ProjectAnnotations, ComposedStoryFn } from 'storybook/internal/types'; export { Addon_Type as Addon, API_ComponentEntry as ComponentEntry, API_ComposedRef as ComposedRef, API_DocsEntry as DocsEntry, API_GroupEntry as GroupEntry, API_HashEntry as HashEntry, API_IndexHash as IndexHash, API_LeafEntry as LeafEntry, API_Refs as Refs, API_RootEntry as RootEntry, API_IndexHash as StoriesHash, API_StoryEntry as StoryEntry } from 'storybook/internal/types'; import { ThemeVars } from 'storybook/theming'; import { OpenInEditorResponsePayload, WhatsNewData } from 'storybook/internal/core-events'; import { toId, StrictArgTypes, Args as Args$1, StoryId as StoryId$1 } from 'storybook/internal/csf'; type ChannelHandler = (event: ChannelEvent) => void; interface ChannelTransport { send(event: ChannelEvent, options?: any): void; setHandler(handler: ChannelHandler): void; } interface ChannelEvent { type: string; from: string; args: any[]; } interface Listener$1 { (...args: any[]): void; } /** * Structural interface for Channel, used in type declarations to avoid nominal incompatibility * between source and dist Channel class declarations. */ interface ChannelLike$1 { readonly isAsync: boolean; readonly hasTransport: boolean; addListener(eventName: string, listener: Listener$1): void; emit(eventName: string, ...args: any): void; last(eventName: string): any; eventNames(): string[]; listenerCount(eventName: string): number; listeners(eventName: string): Listener$1[] | undefined; once(eventName: string, listener: Listener$1): void; removeAllListeners(eventName?: string): void; removeListener(eventName: string, listener: Listener$1): void; on(eventName: string, listener: Listener$1): void; off(eventName: string, listener: Listener$1): void; } interface ChannelArgsSingle { transport?: ChannelTransport; async?: boolean; } interface ChannelArgsMulti { transports: ChannelTransport[]; async?: boolean; } declare class Channel implements ChannelLike$1 { readonly isAsync: boolean; private sender; private events; private data; private readonly transports; constructor(input: ChannelArgsMulti); constructor(input: ChannelArgsSingle); get hasTransport(): boolean; addListener(eventName: string, listener: Listener$1): void; emit(eventName: string, ...args: any): void; last(eventName: string): any; eventNames(): string[]; listenerCount(eventName: string): number; listeners(eventName: string): Listener$1[] | undefined; once(eventName: string, listener: Listener$1): void; removeAllListeners(eventName?: string): void; removeListener(eventName: string, listener: Listener$1): void; on(eventName: string, listener: Listener$1): void; off(eventName: string, listener: Listener$1): void; private handleEvent; private onceListener; } /** In-process channel with no transport — the default for unit tests and manager story mocks. */ declare function mockChannel(): Channel; declare class AddonStore { constructor(); private loaders; private elements; private config; private channel; private promise; private resolve; getChannel: () => Channel$1; ready: () => Promise; hasChannel: () => boolean; setChannel: (channel: Channel$1) => 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: AddonStore; 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 { 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): Promise; setState(inputPatch: InputPatch, callback?: CallBack, options?: Options): Promise; } 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; }; interface SubAPI$d { /** * 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): 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; } interface SubAPI$c { /** * 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$2) => () => 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$2) => 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$2) => void; } interface SubState$9 { globals?: Globals; userGlobals?: Globals; storyGlobals?: Globals; globalTypes?: GlobalTypes; } interface SubAPI$b { /** * Returns the current globals, which is the user globals overlaid with the story globals * * @returns {Globals} The current globals. */ getGlobals: () => Globals; /** * Returns the current globals, as set by the user (a story may have override values) * * @returns {Globals} The current user globals. */ getUserGlobals: () => Globals /** * /** Returns the current globals, as set by the story * * @returns {Globals} The current story globals. */; getStoryGlobals: () => Globals /** * 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) => void; } 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$a { /** * 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; } 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; } /** 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; } interface SubAPI$7 { renderPreview?: API_IframeRenderer; } 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; } interface SubAPI$5 { storeSelection: () => void; retrieveSelection: () => StoryId; /** * 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; } declare const controlOrMetaSymbol: () => "⌘" | "ctrl"; declare const controlOrMetaKey: () => "meta" | "control"; 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; 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; type Direction = -1 | 1; type ParameterName = string; type StoryUpdate = Partial>; type DocsUpdate = Partial>; interface SubState$3 extends API_LoadedRefData { storyId: StoryId; 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$1[]; excludedStatusFilters: StatusValue$1[]; } 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, 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, 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, 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, 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 | { storyId: StoryId; 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): 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): 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): StoryId | 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[]; /** * 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, index: API_IndexHash, direction: Direction, toSiblingGroup: boolean): StoryId; /** * 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, 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, 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) => 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$1[], excluded: StatusValue$1[]): 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$1[], 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$1[]): Promise; } 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; } 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; } type SubState = { whatsNewData?: WhatsNewData; }; type SubAPI = { isWhatsNewUnread(): boolean; whatsNewHasBeenRead(): void; toggleWhatsNewNotifications(): void; }; declare class RequestResponseError | void> extends Error { payload: Payload | undefined; constructor(message: string, payload?: Payload); } declare const experimental_requestResponse: | void = void>(channel: Channel$1, requestEvent: string, responseEvent: string, payload: RequestPayload, timeout?: number) => Promise; declare const isMacLike: () => boolean; declare const _default: (a: TObj, ...b: Partial[]) => TObj; declare const ActiveTabs: { SIDEBAR: "sidebar"; CANVAS: "canvas"; ADDONS: "addons"; }; declare const ManagerContext: React.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$d & SubAPI$c & SubAPI$7 & SubAPI$3 & SubAPI$6 & SubAPI$b & SubAPI$a & 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: (...parameterSets: Parameters[]) => {}; 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.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): boolean; declare function useParameter(parameterKey: string, defaultValue?: S): S; declare function useSharedState(stateId: string, defaultState?: S): [S, (newStateOrMerger: S | API_StateMerger, options?: Options) => void]; declare function useAddonState(addonId: string, defaultState?: S): [S, (newStateOrMerger: S | API_StateMerger, options?: Options) => void]; declare function useArgs(): [Args, (newArgs: Args) => void, (argNames?: string[]) => void, Args]; declare function useGlobals(): [ globals: Globals, updateGlobals: (newGlobals: Globals) => void, storyGlobals: Globals, userGlobals: Globals ]; declare function useGlobalTypes(): GlobalTypes; declare function useArgTypes(): ArgTypes; declare const typesX: typeof Addon_TypesEnum; 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 = (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 = Pick; type StoreOptions = { id: string; leader?: boolean; initialState?: TState; debug?: boolean; }; type EnvironmentOverrides = { channel: ChannelLike; environment: EnvironmentType; }; /** * 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; 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>): () => void; ['type']>(eventType: EventType, listener: Listener, { 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; } /** * 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']]; }; /** * 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; } /** * Actions represent the type of change to a location value. */ declare enum Action { /** * A POP indicates a change to an arbitrary index in the history stack, such * as a back or forward navigation. It does not describe the direction of the * navigation, only that the current index changed. * * Note: This is the default action for newly created history objects. */ Pop = "POP", /** * A PUSH indicates a new entry being added to the history stack, such as when * a link is clicked and a new page loads. When this happens, all subsequent * entries in the stack are lost. */ Push = "PUSH", /** * A REPLACE indicates the entry at the current index in the history stack * being replaced by a new one. */ Replace = "REPLACE" } /** * The pathname, search, and hash values of a URL. */ interface Path { /** * A URL pathname, beginning with a /. */ pathname: string; /** * A URL search string, beginning with a ?. */ search: string; /** * A URL fragment identifier, beginning with a #. */ hash: string; } /** * An entry in a history stack. A location contains information about the * URL path, as well as possibly some arbitrary state and a key. */ interface Location extends Path { /** * A value of arbitrary data associated with this location. */ state: any; /** * A unique string associated with this location. May be used to safely store * and retrieve data in some other storage API, like `localStorage`. * * Note: This value is always "default" on the initial location. */ key: string; } /** * Map of routeId -> data returned from a loader/action/error */ interface RouteData { [routeId: string]: any; } declare enum ResultType { data = "data", deferred = "deferred", redirect = "redirect", error = "error" } /** * Successful result from a loader or action */ interface SuccessResult { type: ResultType.data; data: any; statusCode?: number; headers?: Headers; } /** * Successful defer() result from a loader or action */ interface DeferredResult { type: ResultType.deferred; deferredData: DeferredData; statusCode?: number; headers?: Headers; } /** * Redirect result from a loader or action */ interface RedirectResult { type: ResultType.redirect; status: number; location: string; revalidate: boolean; reloadDocument?: boolean; } /** * Unsuccessful result from a loader or action */ interface ErrorResult { type: ResultType.error; error: any; headers?: Headers; } /** * Result from a loader or action - potentially successful or unsuccessful */ type DataResult = SuccessResult | DeferredResult | RedirectResult | ErrorResult; type LowerCaseFormMethod = "get" | "post" | "put" | "patch" | "delete"; type UpperCaseFormMethod = Uppercase; /** * Active navigation/fetcher form methods are exposed in lowercase on the * RouterState */ type FormMethod = LowerCaseFormMethod; /** * In v7, active navigation/fetcher form methods are exposed in uppercase on the * RouterState. This is to align with the normalization done via fetch(). */ type V7_FormMethod = UpperCaseFormMethod; type FormEncType = "application/x-www-form-urlencoded" | "multipart/form-data" | "application/json" | "text/plain"; type JsonObject = { [Key in string]: JsonValue; } & { [Key in string]?: JsonValue | undefined; }; type JsonArray = JsonValue[] | readonly JsonValue[]; type JsonPrimitive = string | number | boolean | null; type JsonValue = JsonPrimitive | JsonObject | JsonArray; /** * @private * Internal interface to pass around for action submissions, not intended for * external consumption */ type Submission = { formMethod: FormMethod | V7_FormMethod; formAction: string; formEncType: FormEncType; formData: FormData; json: undefined; text: undefined; } | { formMethod: FormMethod | V7_FormMethod; formAction: string; formEncType: FormEncType; formData: undefined; json: JsonValue; text: undefined; } | { formMethod: FormMethod | V7_FormMethod; formAction: string; formEncType: FormEncType; formData: undefined; json: undefined; text: string; }; /** * @private * Arguments passed to route loader/action functions. Same for now but we keep * this as a private implementation detail in case they diverge in the future. */ interface DataFunctionArgs { request: Request; params: Params; context?: any; } /** * Arguments passed to loader functions */ interface LoaderFunctionArgs extends DataFunctionArgs { } /** * Arguments passed to action functions */ interface ActionFunctionArgs extends DataFunctionArgs { } /** * Loaders and actions can return anything except `undefined` (`null` is a * valid return value if there is no data to return). Responses are preferred * and will ease any future migration to Remix */ type DataFunctionValue = Response | NonNullable | null; /** * Route loader function signature */ interface LoaderFunction { (args: LoaderFunctionArgs): Promise | DataFunctionValue; } /** * Route action function signature */ interface ActionFunction { (args: ActionFunctionArgs): Promise | DataFunctionValue; } /** * Route shouldRevalidate function signature. This runs after any submission * (navigation or fetcher), so we flatten the navigation/fetcher submission * onto the arguments. It shouldn't matter whether it came from a navigation * or a fetcher, what really matters is the URLs and the formData since loaders * have to re-run based on the data models that were potentially mutated. */ interface ShouldRevalidateFunction { (args: { currentUrl: URL; currentParams: AgnosticDataRouteMatch["params"]; nextUrl: URL; nextParams: AgnosticDataRouteMatch["params"]; formMethod?: Submission["formMethod"]; formAction?: Submission["formAction"]; formEncType?: Submission["formEncType"]; text?: Submission["text"]; formData?: Submission["formData"]; json?: Submission["json"]; actionResult?: DataResult; defaultShouldRevalidate: boolean; }): boolean; } /** * Keys we cannot change from within a lazy() function. We spread all other keys * onto the route. Either they're meaningful to the router, or they'll get * ignored. */ type ImmutableRouteKey = "lazy" | "caseSensitive" | "path" | "id" | "index" | "children"; type RequireOne = Exclude<{ [K in keyof T]: K extends Key ? Omit & Required> : never; }[keyof T], undefined>; /** * lazy() function to load a route definition, which can add non-matching * related properties to a route */ interface LazyRouteFunction { (): Promise>>; } /** * Base RouteObject with common props shared by all types of routes */ type AgnosticBaseRouteObject = { caseSensitive?: boolean; path?: string; id?: string; loader?: LoaderFunction; action?: ActionFunction; hasErrorBoundary?: boolean; shouldRevalidate?: ShouldRevalidateFunction; handle?: any; lazy?: LazyRouteFunction; }; /** * Index routes must not have children */ type AgnosticIndexRouteObject = AgnosticBaseRouteObject & { children?: undefined; index: true; }; /** * Non-index routes may have children, but cannot have index */ type AgnosticNonIndexRouteObject = AgnosticBaseRouteObject & { children?: AgnosticRouteObject[]; index?: false; }; /** * A route object represents a logical route, with (optionally) its child * routes organized in a tree-like structure. */ type AgnosticRouteObject = AgnosticIndexRouteObject | AgnosticNonIndexRouteObject; type AgnosticDataIndexRouteObject = AgnosticIndexRouteObject & { id: string; }; type AgnosticDataNonIndexRouteObject = AgnosticNonIndexRouteObject & { children?: AgnosticDataRouteObject[]; id: string; }; /** * A data route object, which is just a RouteObject with a required unique ID */ type AgnosticDataRouteObject = AgnosticDataIndexRouteObject | AgnosticDataNonIndexRouteObject; /** * The parameters that were parsed from the URL path. */ type Params = { readonly [key in Key]: string | undefined; }; /** * A RouteMatch contains info about how a route matched a URL. */ interface AgnosticRouteMatch { /** * The names and values of dynamic parameters in the URL. */ params: Params; /** * The portion of the URL pathname that was matched. */ pathname: string; /** * The portion of the URL pathname that was matched before child routes. */ pathnameBase: string; /** * The route object that was used to match. */ route: RouteObjectType; } interface AgnosticDataRouteMatch extends AgnosticRouteMatch { } declare class DeferredData { private pendingKeysSet; private controller; private abortPromise; private unlistenAbortSignal; private subscribers; data: Record; init?: ResponseInit; deferredKeys: string[]; constructor(data: Record, responseInit?: ResponseInit); private trackPromise; private onSettle; private emit; subscribe(fn: (aborted: boolean, settledKey?: string) => void): () => boolean; cancel(): void; resolveData(signal: AbortSignal): Promise; get done(): boolean; get unwrappedData(): {}; get pendingKeys(): string[]; } /** * State maintained internally by the router. During a navigation, all states * reflect the the "old" location unless otherwise noted. */ interface RouterState { /** * The action of the most recent navigation */ historyAction: Action; /** * The current location reflected by the router */ location: Location; /** * The current set of route matches */ matches: AgnosticDataRouteMatch[]; /** * Tracks whether we've completed our initial data load */ initialized: boolean; /** * Current scroll position we should start at for a new view * - number -> scroll position to restore to * - false -> do not restore scroll at all (used during submissions) * - null -> don't have a saved position, scroll to hash or top of page */ restoreScrollPosition: number | false | null; /** * Indicate whether this navigation should skip resetting the scroll position * if we are unable to restore the scroll position */ preventScrollReset: boolean; /** * Tracks the state of the current navigation */ navigation: Navigation; /** * Tracks any in-progress revalidations */ revalidation: RevalidationState; /** * Data from the loaders for the current matches */ loaderData: RouteData; /** * Data from the action for the current matches */ actionData: RouteData | null; /** * Errors caught from loaders for the current matches */ errors: RouteData | null; /** * Map of current fetchers */ fetchers: Map; /** * Map of current blockers */ blockers: Map; } /** * Data that can be passed into hydrate a Router from SSR */ type HydrationState = Partial>; /** * Potential states for state.navigation */ type NavigationStates = { Idle: { state: "idle"; location: undefined; formMethod: undefined; formAction: undefined; formEncType: undefined; formData: undefined; json: undefined; text: undefined; }; Loading: { state: "loading"; location: Location; formMethod: Submission["formMethod"] | undefined; formAction: Submission["formAction"] | undefined; formEncType: Submission["formEncType"] | undefined; formData: Submission["formData"] | undefined; json: Submission["json"] | undefined; text: Submission["text"] | undefined; }; Submitting: { state: "submitting"; location: Location; formMethod: Submission["formMethod"]; formAction: Submission["formAction"]; formEncType: Submission["formEncType"]; formData: Submission["formData"]; json: Submission["json"]; text: Submission["text"]; }; }; type Navigation = NavigationStates[keyof NavigationStates]; type RevalidationState = "idle" | "loading"; /** * Potential states for fetchers */ type FetcherStates = { Idle: { state: "idle"; formMethod: undefined; formAction: undefined; formEncType: undefined; text: undefined; formData: undefined; json: undefined; data: TData | undefined; " _hasFetcherDoneAnything "?: boolean; }; Loading: { state: "loading"; formMethod: Submission["formMethod"] | undefined; formAction: Submission["formAction"] | undefined; formEncType: Submission["formEncType"] | undefined; text: Submission["text"] | undefined; formData: Submission["formData"] | undefined; json: Submission["json"] | undefined; data: TData | undefined; " _hasFetcherDoneAnything "?: boolean; }; Submitting: { state: "submitting"; formMethod: Submission["formMethod"]; formAction: Submission["formAction"]; formEncType: Submission["formEncType"]; text: Submission["text"]; formData: Submission["formData"]; json: Submission["json"]; data: TData | undefined; " _hasFetcherDoneAnything "?: boolean; }; }; type Fetcher = FetcherStates[keyof FetcherStates]; interface BlockerBlocked { state: "blocked"; reset(): void; proceed(): void; location: Location; } interface BlockerUnblocked { state: "unblocked"; reset: undefined; proceed: undefined; location: undefined; } interface BlockerProceeding { state: "proceeding"; reset: undefined; proceed: undefined; location: Location; } type Blocker = BlockerUnblocked | BlockerBlocked | BlockerProceeding; /** * NOTE: If you refactor this to split up the modules into separate files, * you'll need to update the rollup config for react-router-dom-v5-compat. */ declare global { var __staticRouterHydrationData: HydrationState | undefined; } /** 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 { 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; 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; error?: DocgenError; [key: string]: unknown; } declare global { var globalProjectAnnotations: NormalizedProjectAnnotations; var defaultProjectAnnotations: ProjectAnnotations; } type WrappedStoryRef = { __pw_type: 'jsx'; props: Record; } | { __pw_type: 'importRef'; }; type UnwrappedJSXStoryRef = { __pw_type: 'jsx'; type: UnwrappedImportStoryRef; }; type UnwrappedImportStoryRef = ComposedStoryFn; declare global { function __pwUnwrapObject(storyRef: WrappedStoryRef): Promise; } /** System tags used throughout Storybook for categorizing and filtering stories and docs entries. */ declare const Tag: { /** 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 = string; /** 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$1 { /** The Standard Schema properties. */ readonly "~standard": StandardSchemaV1$1.Props; } declare namespace StandardSchemaV1$1 { /** The Standard Schema properties interface. */ interface Props extends StandardTypedV1.Props { /** Validates unknown input values. */ readonly validate: (value: unknown, options?: StandardSchemaV1$1.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; } /** Generic Standard Schema constraint used across open-service definitions. */ type AnySchema = StandardSchemaV1$1; /** Stable alias for service identifiers across definition, runtime, and registration APIs. */ type ServiceId = string; /** 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$1.InferInput; /** Parsed value type produced by a schema after validation. */ type InferSchemaOutput = StandardSchemaV1$1.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 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; }; }; //#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; }; //#endregion //#region src/methods/fallback/fallbackAsync.d.ts /** * Fallback async type. */ type FallbackAsync> | BaseSchemaAsync>> = MaybeDeepReadonly> | ((dataset?: OutputDataset, InferIssue>, config?: Config>) => MaybePromise>>); /** * 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>>; }; //#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; } //#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>; } //#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>>; } //#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>>; } //#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"]; /** * 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 = 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>; //#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 | 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 | 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; } /** * 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/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; } //#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/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/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/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/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/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/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/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/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/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/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/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/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 }; } //#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; /** * The core services registered in each runtime. * * These lists are the single source of truth: the `*CoreServices` types below derive their keys * from each definition's `id` (so `getService` typing follows the list), and * `core-service-types.test.ts` checks the lists against the per-runtime registrar-file convention * (a `services//.{ts,tsx}` file exists for each listed service, and vice versa) to * catch a service being added to one without the other. Note this guards the convention, not the * actual call: a service can have a registrar file yet still not be wired up by its caller. * * Each list only references definitions already loaded in that runtime, and the runtime entrypoints * import the derived *types* (`import type`), so these value imports add no runtime cost to the * manager/preview/server bundles — only the membership test pulls them in as values. */ declare const managerCoreServiceDefs: ServiceDefinition<{ components: Record; }, { readonly docgen: QueryDefinition<{ components: Record; }, ObjectSchema<{ readonly id: StringSchema; }, undefined>, OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>, { readonly extractDocgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly extractAllDocgen: UndefinedSchema; }, { readonly extractDocgen: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; readonly extractAllDocgen: VoidSchema; }, QueryFunctions<{ readonly docgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly docgenForAllComponents: VoidSchema; }, { readonly docgen: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; readonly docgenForAllComponents: RecordSchema, LooseObjectSchema<{ readonly subcomponents: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; }>> & ({ internal?: false; } | { __internal_naming_error: "Operation \"docgen\" has internal: true but must be prefixed with \"_\""; }); readonly docgenForAllComponents: QueryDefinition<{ components: Record; }, VoidSchema, RecordSchema, LooseObjectSchema<{ readonly subcomponents: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>, { readonly extractDocgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly extractAllDocgen: UndefinedSchema; }, { readonly extractDocgen: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; readonly extractAllDocgen: VoidSchema; }, QueryFunctions<{ readonly docgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly docgenForAllComponents: VoidSchema; }, { readonly docgen: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; readonly docgenForAllComponents: RecordSchema, LooseObjectSchema<{ readonly subcomponents: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; }>> & ({ internal?: false; } | { __internal_naming_error: "Operation \"docgenForAllComponents\" has internal: true but must be prefixed with \"_\""; }); } & { readonly docgen: { output: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; }; readonly docgenForAllComponents: { output: RecordSchema, LooseObjectSchema<{ readonly subcomponents: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; }; }, { readonly extractDocgen: CommandDefinition<{ components: Record; }, ObjectSchema<{ readonly id: StringSchema; }, undefined>, OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>, { readonly extractDocgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly extractAllDocgen: UndefinedSchema; }, { readonly extractDocgen: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; readonly extractAllDocgen: VoidSchema; }, QueryFunctions<{ readonly docgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly docgenForAllComponents: VoidSchema; }, { readonly docgen: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; readonly docgenForAllComponents: RecordSchema, LooseObjectSchema<{ readonly subcomponents: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; }>> & ({ internal?: false; } | { __internal_naming_error: "Operation \"extractDocgen\" has internal: true but must be prefixed with \"_\""; }); readonly extractAllDocgen: CommandDefinition<{ components: Record; }, UndefinedSchema, VoidSchema, { readonly extractDocgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly extractAllDocgen: UndefinedSchema; }, { readonly extractDocgen: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; readonly extractAllDocgen: VoidSchema; }, QueryFunctions<{ readonly docgen: ObjectSchema<{ readonly id: StringSchema; }, undefined>; readonly docgenForAllComponents: VoidSchema; }, { readonly docgen: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; readonly docgenForAllComponents: RecordSchema, LooseObjectSchema<{ readonly subcomponents: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; }>> & ({ internal?: false; } | { __internal_naming_error: "Operation \"extractAllDocgen\" has internal: true but must be prefixed with \"_\""; }); } & { readonly extractDocgen: { output: OptionalSchema, LooseObjectSchema<{ import: OptionalSchema, undefined>; 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>; }, undefined>, undefined>, undefined>; 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; }, undefined>, undefined>; }; readonly extractAllDocgen: { output: VoidSchema; }; }, "core/docgen">[]; /** Maps a list of service definitions to `{ [id]: instance }`, keyed by each definition's id. */ type CoreServices = { [Def in TDefs[number] as Def['id']]: ServiceInstanceOf; }; /** Core services registered in the Storybook manager. */ type ManagerCoreServices = CoreServices; /** Module-level `getService` overloads keyed by a per-runtime core-service map. */ interface TypedGetService { (serviceId: K): TMap[K]; (serviceId: ServiceId): TInstance; } 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; }; /** * 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; type StatusValue = 'status-value:pending' | 'status-value:success' | 'status-value:new' | 'status-value:modified' | 'status-value:affected' | 'status-value:reviewing' | 'status-value:warning' | 'status-value:error' | 'status-value:unknown'; type StatusTypeId = string; type StatusByTypeId = Record; type StatusesByStoryIdAndTypeId = Record; interface Status { value: StatusValue; typeId: StatusTypeId; storyId: StoryId$1; title: string; description: string; data?: any; sidebarContextMenu?: boolean; } declare const StatusStoreEventType: { readonly SELECT: "select"; }; type StatusStoreEvent = { type: typeof StatusStoreEventType.SELECT; payload: Status[]; }; type StatusStore = { getAll: () => StatusesByStoryIdAndTypeId; set: (statuses: Status[]) => void; onAllStatusChange: (listener: (statuses: StatusesByStoryIdAndTypeId, previousStatuses: StatusesByStoryIdAndTypeId) => void) => () => void; onSelect: (listener: (selectedStatuses: Status[]) => void) => () => void; unset: (storyIds?: StoryId$1[]) => void; }; type StatusStoreByTypeId = StatusStore & { typeId: StatusTypeId; }; type UseStatusStore = (selector?: (statuses: StatusesByStoryIdAndTypeId) => T) => T; declare const fullStatusStore: StatusStore & { selectStatuses: (statuses: Status[]) => void; typeId: undefined; }; declare const getStatusStoreByTypeId: (typeId: StatusTypeId) => StatusStoreByTypeId; declare const useStatusStore: UseStatusStore; declare const universalStatusStore: UniversalStore; 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; }; declare const getTestProviderStoreById: (testProviderId: TestProviderId) => TestProviderStoreById; declare const useTestProviderStore: UseTestProviderStore; declare const universalTestProviderStore: UniversalStore; type Primitive = string | number | symbol | bigint | boolean | null | undefined; 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; 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[]; } 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; }; 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; 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 { }; } declare namespace errorUtil { type ErrMessage = string | { message?: string | undefined; }; const errToObj: (message?: ErrMessage) => { message?: string | undefined; }; const toString: (message?: ErrMessage) => string | undefined; } 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; } /** * The Standard Schema interface. */ type StandardSchemaV1 = { /** * The Standard Schema properties. */ readonly "~standard": StandardSchemaV1.Props; }; declare namespace StandardSchemaV1 { /** * 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 { }; } 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.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.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" } 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?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; aiSetup: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; autodocs: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; ciTests: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; controls: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; coverage: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; guidedTour: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; installA11y: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; installChromatic: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; installDocs: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; installVitest: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; mdxDocs: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; moreComponents: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; moreStories: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; onboardingSurvey: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; organizeStories: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; publishStorybook: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; shareStorybook: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; renderComponent: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; runTests: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; viewports: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; visualTests: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; whatsNewStorybook10: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; writeInteractions: ZodOptional>; mutedAt: ZodOptional; }, "strict", ZodTypeAny, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }, { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; }>>; }, "strip", ZodTypeAny, { controls?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; accessibilityTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; }, { controls?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; accessibilityTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; }>>; widget: ZodOptional; }, "strip", ZodTypeAny, { disable?: boolean | undefined; }, { disable?: boolean | undefined; }>>; }, "strip", ZodTypeAny, { items?: { controls?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; accessibilityTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; } | undefined; widget?: { disable?: boolean | undefined; } | undefined; }, { items?: { controls?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; accessibilityTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "done" | "open" | "accepted" | "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?: { controls?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; accessibilityTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "done" | "open" | "accepted" | "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?: { controls?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; autodocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; accessibilityTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; aiSetup?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; ciTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; coverage?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; guidedTour?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installA11y?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installChromatic?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; installVitest?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; mdxDocs?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreComponents?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; moreStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; onboardingSurvey?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; organizeStories?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; publishStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; shareStorybook?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; renderComponent?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; runTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; viewports?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; visualTests?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; whatsNewStorybook10?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; writeInteractions?: { status?: "done" | "open" | "accepted" | "skipped" | undefined; mutedAt?: number | undefined; } | undefined; } | undefined; widget?: { disable?: boolean | undefined; } | undefined; } | undefined; }>; declare function globalSettings(filePath?: string): Promise; /** * 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; } /** 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; }; declare const universalChecklistStore: UniversalStore; declare const checklistStore: { getValue: (id: ItemId) => { status?: "done" | "open" | "accepted" | "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; }; /** * React hook to get a stable reference to a service command. * * Fire-and-forget: the returned async function invokes the command and returns a Promise. * Callers manage their own loading/error state. This keeps the hook minimal and composable * with any state management approach (local `useState`, `useReducer`, TanStack Query, etc.). * * The reference is stable as long as `service` and `commandName` do not change, so it is * safe to pass to child components or include in effect dependency arrays. */ type CommandFn = TCommands[TKey] extends (...args: any[]) => any ? TCommands[TKey] : never; /** * Returns a stable reference to the named service command. * * @param service - A service instance from `registerService`. * @param commandName - The name of the command to invoke. * * @example * ```tsx * const assignField = useServiceCommand(service, 'assignRecordField'); * * return ( * * ); * ``` */ declare function useServiceCommand Promise>; }, TKey extends keyof TInstance['commands'] & string>(service: TInstance, commandName: TKey): CommandFn; /** * React hook to subscribe to a service query with fine-grained reactivity. * * Backed by React's `useSyncExternalStore`, so it integrates correctly with React 18+ concurrent * features. Manager-only: that hook does not exist before React 18, and the preview must keep * supporting React 16/17, so preview docs blocks use the shim-based `useQuerySubscription` instead. * * Returns a {@link QueryState}: the current `data` plus the `load` lifecycle (`status`, * `loadStatus`, `error`, and the derived booleans). Re-renders whenever the subscribed query emits * (the runtime already dedupes deeply-equal emissions, so the hook does not). Object inputs are * compared with deep equality when deciding whether to re-subscribe, so inline literals at the call * site are safe; selectors are compared by reference, so memoize them (`useCallback` / module * scope) to avoid re-subscribing every render. */ /** * Subscribe to a service query and receive reactive {@link QueryState} updates in a React component. * * Pass the query directly (e.g. `myService.queries.thing`) so its input/output types infer per * query. The service must exist: if it may be absent (e.g. behind a feature flag), guard at a parent * and conditionally render the component that calls this hook. * * A void-input query needs no input argument. As soon as a selector is involved the input is * positional, so a void-input query passes `undefined` explicitly: * `useServiceQuery(query, undefined, selector)`. * * @example * ```tsx * const { data, isInitialLoading, isError } = useServiceQuery(recordService.queries.recordFields, { * entryId: 'a', * }); * ``` */ declare function useServiceQuery(query: Query): QueryState; declare function useServiceQuery(query: Query, input: TInput): QueryState; declare function useServiceQuery(query: Query, input: TInput, selector: (value: TOutput) => TSelected): QueryState; /** * Manager-side entrypoint for the open-service architecture. * * Import from here in manager (React) code. Define services with `storybook/open-service`. * * Quick start: * * ```ts * import { registerService, useServiceQuery, useServiceCommand } from 'storybook/manager-api'; * * // Inside an addons.register callback: * const service = registerService(myServiceDef); * * function MyTool() { * const { data } = useServiceQuery(service.queries.value); * const setValue = useServiceCommand(service, 'setValue'); * return ; * } * ``` */ declare const getService: TypedGetService; /** * Registers a service in the manager and returns its runtime surface. * * The manager is a relay hub: it bridges the dev server and the preview iframes. The channel is read * via `getChannel()` from `storybook/internal/channels`, which the manager runtime installs before any * `addons.register` callback runs, so no manual channel setup is needed. */ declare function registerService, TCommands extends Commands>(definition: ServiceDefinition, registration?: ServiceRegistrationOptions): ServiceInstance & ServiceRegistryApi; export { type API, type API_EventMap, type API_KeyCollection, ActiveTabs, AddonStore, type Combo, ManagerConsumer as Consumer, type KeyboardEventLike, ManagerContext, type ManagerProviderProps, ManagerProvider as Provider, RequestResponseError, type State, type Options as StoreOptions, Tag, addons, combineParameters, controlOrMetaKey, controlOrMetaSymbol, eventMatchesShortcut, eventToShortcut, MockUniversalStore as experimental_MockUniversalStore, UniversalStore as experimental_UniversalStore, getStatusStoreByTypeId as experimental_getStatusStore, getTestProviderStoreById as experimental_getTestProviderStore, experimental_requestResponse, useStatusStore as experimental_useStatusStore, useTestProviderStore as experimental_useTestProviderStore, useUniversalStore as experimental_useUniversalStore, getService, checklistStore as internal_checklistStore, fullStatusStore as internal_fullStatusStore, fullTestProviderStore as internal_fullTestProviderStore, universalChecklistStore as internal_universalChecklistStore, universalStatusStore as internal_universalStatusStore, universalTestProviderStore as internal_universalTestProviderStore, isMacLike, isShortcutTaken, keyToSymbol, _default as merge, mockChannel, optionOrAltSymbol, registerService, shortcutMatchesShortcut, shortcutToAriaKeyshortcuts, shortcutToHumanString, typesX as types, useAddonState, useArgTypes, useArgs, useChannel, useGlobalTypes, useGlobals, useParameter, useServiceCommand, useServiceQuery, useSharedState, useStoryPrepared, useStorybookApi, useStorybookState };