storybook 9.0.0-alpha.0 → 9.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -29
- package/assets/browser/favicon.svg +1 -0
- package/assets/browser/nunito-sans-bold-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-bold.woff2 +0 -0
- package/assets/browser/nunito-sans-italic.woff2 +0 -0
- package/assets/browser/nunito-sans-regular.woff2 +0 -0
- package/assets/docs/addon-controls-args-annotated.png +0 -0
- package/assets/docs/addon-controls-args-background-color.png +0 -0
- package/assets/docs/addon-controls-args-background-string.png +0 -0
- package/assets/docs/addon-controls-args-docs.png +0 -0
- package/assets/docs/addon-controls-args-logging.png +0 -0
- package/assets/docs/addon-controls-args-no-annotation.png +0 -0
- package/assets/docs/addon-controls-args-reflow-slider.png +0 -0
- package/assets/docs/addon-controls-args-reflow.png +0 -0
- package/assets/docs/addon-controls-args-template.png +0 -0
- package/assets/docs/addon-controls-expanded.png +0 -0
- package/assets/docs/addon-controls-hero.gif +0 -0
- package/assets/docs/addon-controls-install.png +0 -0
- package/assets/docs/hero.gif +0 -0
- package/assets/docs/message-reference.png +0 -0
- package/assets/docs/viewport.png +0 -0
- package/assets/server/addon.tsconfig.json +6 -0
- package/assets/server/base-preview-body.html +119 -0
- package/assets/server/base-preview-head.html +451 -0
- package/assets/server/template.ejs +87 -0
- package/bin/index.cjs +1 -1
- package/dist/actions/decorator.d.ts +6 -0
- package/dist/actions/decorator.js +139 -0
- package/dist/actions/index.cjs +127 -0
- package/dist/actions/index.d.ts +105 -0
- package/dist/actions/index.js +112 -0
- package/dist/actions/manager.js +1196 -0
- package/dist/actions/preview.cjs +165 -0
- package/dist/actions/preview.d.ts +55 -0
- package/dist/actions/preview.js +156 -0
- package/dist/babel/index.cjs +54034 -0
- package/dist/babel/index.d.ts +7488 -0
- package/dist/babel/index.js +54044 -0
- package/dist/bin/index.cjs +119 -0
- package/dist/bin/index.js +113 -0
- package/dist/builder-manager/index.cjs +2140 -0
- package/dist/builder-manager/index.d.ts +19 -0
- package/dist/builder-manager/index.js +2162 -0
- package/dist/channels/index.cjs +1913 -0
- package/dist/channels/index.d.ts +108 -0
- package/dist/channels/index.js +1881 -0
- package/dist/cli/bin/index.cjs +2687 -0
- package/dist/cli/bin/index.d.ts +2 -0
- package/dist/cli/bin/index.js +2707 -0
- package/dist/cli/index.cjs +17327 -0
- package/dist/cli/index.d.ts +209 -0
- package/dist/cli/index.js +17349 -0
- package/dist/client-logger/index.cjs +80 -0
- package/dist/client-logger/index.d.ts +29 -0
- package/dist/client-logger/index.js +64 -0
- package/dist/common/index.cjs +20569 -0
- package/dist/common/index.d.ts +949 -0
- package/dist/common/index.js +20654 -0
- package/dist/components/index.cjs +27924 -0
- package/dist/components/index.d.ts +1423 -0
- package/dist/components/index.js +24673 -0
- package/dist/controls/decorator.d.ts +5 -0
- package/dist/controls/decorator.js +8 -0
- package/dist/controls/index.cjs +26 -0
- package/dist/controls/index.d.ts +39 -0
- package/dist/controls/index.js +6 -0
- package/dist/controls/manager.js +5545 -0
- package/dist/controls/preview.cjs +26 -0
- package/dist/controls/preview.d.ts +55 -0
- package/dist/controls/preview.js +9 -0
- package/dist/core-events/index.cjs +167 -0
- package/dist/core-events/index.d.ts +426 -0
- package/dist/core-events/index.js +149 -0
- package/dist/core-server/index.cjs +38183 -0
- package/dist/core-server/index.d.ts +720 -0
- package/dist/core-server/index.js +38272 -0
- package/dist/core-server/presets/common-manager.js +20 -0
- package/dist/core-server/presets/common-override-preset.cjs +4824 -0
- package/dist/core-server/presets/common-override-preset.js +4829 -0
- package/dist/core-server/presets/common-preset.cjs +10231 -0
- package/dist/core-server/presets/common-preset.js +10309 -0
- package/dist/csf/index.cjs +179 -0
- package/dist/csf/index.d.ts +750 -0
- package/dist/csf/index.js +172 -0
- package/dist/csf-tools/index.cjs +1422 -0
- package/dist/csf-tools/index.d.ts +250 -0
- package/dist/csf-tools/index.js +1439 -0
- package/dist/docs-tools/index.cjs +2891 -0
- package/dist/docs-tools/index.d.ts +162 -0
- package/dist/docs-tools/index.js +2876 -0
- package/dist/index.cjs +17 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -7
- package/dist/instrumenter/index.cjs +3485 -0
- package/dist/instrumenter/index.d.ts +104 -0
- package/dist/instrumenter/index.js +4965 -0
- package/dist/manager/globals-module-info.cjs +817 -0
- package/dist/manager/globals-module-info.d.ts +36 -0
- package/dist/manager/globals-module-info.js +804 -0
- package/dist/manager/globals-runtime.js +77536 -0
- package/dist/manager/globals.cjs +47 -0
- package/dist/manager/globals.d.ts +24 -0
- package/dist/manager/globals.js +34 -0
- package/dist/manager/runtime.js +12323 -0
- package/dist/manager-api/index.cjs +11074 -0
- package/dist/manager-api/index.d.ts +1512 -0
- package/dist/manager-api/index.js +4835 -0
- package/dist/manager-errors.d.ts +89 -0
- package/dist/manager-errors.js +99 -0
- package/dist/node-logger/index.cjs +1642 -0
- package/dist/node-logger/index.d.ts +117 -0
- package/dist/node-logger/index.js +1652 -0
- package/dist/preview/globals.cjs +38 -0
- package/dist/preview/globals.d.ts +15 -0
- package/dist/preview/globals.js +25 -0
- package/dist/preview/runtime.js +43629 -0
- package/dist/preview-api/index.cjs +5224 -0
- package/dist/preview-api/index.d.ts +1093 -0
- package/dist/preview-api/index.js +5292 -0
- package/dist/preview-errors.cjs +503 -0
- package/dist/preview-errors.d.ts +212 -0
- package/dist/preview-errors.js +449 -0
- package/dist/router/index.cjs +3296 -0
- package/dist/router/index.d.ts +385 -0
- package/dist/router/index.js +1843 -0
- package/dist/server-errors.cjs +727 -0
- package/dist/server-errors.d.ts +296 -0
- package/dist/server-errors.js +728 -0
- package/dist/telemetry/index.cjs +2756 -0
- package/dist/telemetry/index.d.ts +133 -0
- package/dist/telemetry/index.js +2797 -0
- package/dist/test/index.cjs +35685 -0
- package/dist/test/index.d.ts +186 -0
- package/dist/test/index.js +33751 -0
- package/dist/test/preview.cjs +15869 -0
- package/dist/test/preview.d.ts +54 -0
- package/dist/test/preview.js +14440 -0
- package/dist/test/spy.cjs +257 -0
- package/dist/test/spy.d.ts +66 -0
- package/dist/test/spy.js +239 -0
- package/dist/theming/create.cjs +232 -0
- package/dist/theming/create.d.ts +50 -0
- package/dist/theming/create.js +216 -0
- package/dist/theming/index.cjs +2665 -0
- package/dist/theming/index.d.ts +11939 -0
- package/dist/theming/index.js +2485 -0
- package/dist/types/index.cjs +27 -0
- package/dist/types/index.d.ts +2795 -0
- package/dist/types/index.js +7 -0
- package/dist/viewport/index.cjs +310 -0
- package/dist/viewport/index.d.ts +320 -0
- package/dist/viewport/index.js +290 -0
- package/dist/viewport/manager.js +400 -0
- package/dist/viewport/preview.cjs +35 -0
- package/dist/viewport/preview.d.ts +69 -0
- package/dist/viewport/preview.js +19 -0
- package/package.json +518 -209
- package/.eslintrc.cjs +0 -31
- package/__mocks__/@aw-web-design/x-default-browser.js +0 -2
- package/core/babel/index.cjs +0 -1
- package/core/babel/index.d.ts +0 -2
- package/core/babel/index.js +0 -1
- package/core/builder-manager/index.cjs +0 -1
- package/core/builder-manager/index.d.ts +0 -2
- package/core/builder-manager/index.js +0 -1
- package/core/channels/index.cjs +0 -1
- package/core/channels/index.d.ts +0 -2
- package/core/channels/index.js +0 -1
- package/core/cli/bin/index.cjs +0 -1
- package/core/cli/bin/index.d.ts +0 -2
- package/core/cli/bin/index.js +0 -1
- package/core/cli/index.cjs +0 -1
- package/core/cli/index.d.ts +0 -2
- package/core/cli/index.js +0 -1
- package/core/client-logger/index.cjs +0 -1
- package/core/client-logger/index.d.ts +0 -2
- package/core/client-logger/index.js +0 -1
- package/core/common/index.cjs +0 -1
- package/core/common/index.d.ts +0 -2
- package/core/common/index.js +0 -1
- package/core/components/index.cjs +0 -1
- package/core/components/index.d.ts +0 -2
- package/core/components/index.js +0 -1
- package/core/core-events/index.cjs +0 -1
- package/core/core-events/index.d.ts +0 -2
- package/core/core-events/index.js +0 -1
- package/core/core-server/index.cjs +0 -1
- package/core/core-server/index.d.ts +0 -2
- package/core/core-server/index.js +0 -1
- package/core/core-server/presets/common-manager.js +0 -1
- package/core/core-server/presets/common-override-preset.cjs +0 -1
- package/core/core-server/presets/common-override-preset.js +0 -1
- package/core/core-server/presets/common-preset.cjs +0 -1
- package/core/core-server/presets/common-preset.js +0 -1
- package/core/csf/index.cjs +0 -1
- package/core/csf/index.d.ts +0 -2
- package/core/csf/index.js +0 -1
- package/core/csf-tools/index.cjs +0 -1
- package/core/csf-tools/index.d.ts +0 -2
- package/core/csf-tools/index.js +0 -1
- package/core/docs-tools/index.cjs +0 -1
- package/core/docs-tools/index.d.ts +0 -2
- package/core/docs-tools/index.js +0 -1
- package/core/index.cjs +0 -1
- package/core/index.d.ts +0 -2
- package/core/index.js +0 -1
- package/core/manager/globals-module-info.cjs +0 -1
- package/core/manager/globals-module-info.d.ts +0 -2
- package/core/manager/globals-module-info.js +0 -1
- package/core/manager/globals-runtime.js +0 -1
- package/core/manager/globals.cjs +0 -1
- package/core/manager/globals.d.ts +0 -2
- package/core/manager/globals.js +0 -1
- package/core/manager-api/index.cjs +0 -1
- package/core/manager-api/index.d.ts +0 -2
- package/core/manager-api/index.js +0 -1
- package/core/manager-errors.d.ts +0 -2
- package/core/manager-errors.js +0 -1
- package/core/node-logger/index.cjs +0 -1
- package/core/node-logger/index.d.ts +0 -2
- package/core/node-logger/index.js +0 -1
- package/core/preview/globals.cjs +0 -1
- package/core/preview/globals.d.ts +0 -2
- package/core/preview/globals.js +0 -1
- package/core/preview/runtime.js +0 -1
- package/core/preview-api/index.cjs +0 -1
- package/core/preview-api/index.d.ts +0 -2
- package/core/preview-api/index.js +0 -1
- package/core/preview-errors.cjs +0 -1
- package/core/preview-errors.d.ts +0 -2
- package/core/preview-errors.js +0 -1
- package/core/router/index.cjs +0 -1
- package/core/router/index.d.ts +0 -2
- package/core/router/index.js +0 -1
- package/core/server-errors.cjs +0 -1
- package/core/server-errors.d.ts +0 -2
- package/core/server-errors.js +0 -1
- package/core/telemetry/index.cjs +0 -1
- package/core/telemetry/index.d.ts +0 -2
- package/core/telemetry/index.js +0 -1
- package/core/theming/create.cjs +0 -1
- package/core/theming/create.d.ts +0 -2
- package/core/theming/create.js +0 -1
- package/core/theming/index.cjs +0 -1
- package/core/theming/index.d.ts +0 -2
- package/core/theming/index.js +0 -1
- package/core/types/index.cjs +0 -1
- package/core/types/index.d.ts +0 -2
- package/core/types/index.js +0 -1
- package/core.cjs +0 -0
- package/core.d.ts +0 -0
- package/core.js +0 -1
- package/dist/chunk-OWLSIX54.js +0 -8
- package/dist/core-path.cjs +0 -1
- package/dist/core-path.d.ts +0 -3
- package/dist/core-path.js +0 -9
- package/dist/proxy.cjs +0 -1
- package/dist/proxy.d.ts +0 -2
- package/dist/proxy.js +0 -9
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { TestingLibraryMatchers } from '@testing-library/jest-dom/matchers';
|
|
2
|
+
import { AsymmetricMatchersContaining, JestAssertion, ExpectStatic, MatchersObject, MatcherState } from '@vitest/expect';
|
|
3
|
+
import * as domTestingLibrary from '@testing-library/dom';
|
|
4
|
+
import { BoundFunctions } from '@testing-library/dom';
|
|
5
|
+
import _userEvent, { userEvent as userEvent$1 } from '@testing-library/user-event';
|
|
6
|
+
import { MockInstance, spyOn as spyOn$1, Mock as Mock$1, MaybeMocked, MaybeMockedDeep, MaybePartiallyMocked, MaybePartiallyMockedDeep } from '@vitest/spy';
|
|
7
|
+
export * from '@vitest/spy';
|
|
8
|
+
export { isMockFunction, mocks } from '@vitest/spy';
|
|
9
|
+
|
|
10
|
+
type Promisify<Fn> = Fn extends (...args: infer A) => infer R ? (...args: A) => R extends Promise<any> ? R : Promise<R> : Fn;
|
|
11
|
+
type PromisifyObject<O> = {
|
|
12
|
+
[K in keyof O]: Promisify<O[K]>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
type Matchers<T> = PromisifyObject<JestAssertion<T>> & TestingLibraryMatchers<ReturnType<ExpectStatic['stringContaining']>, Promise<void>>;
|
|
16
|
+
interface Assertion<T> extends Matchers<T> {
|
|
17
|
+
toHaveBeenCalledOnce(): Promise<void>;
|
|
18
|
+
toSatisfy<E>(matcher: (value: E) => boolean, message?: string): Promise<void>;
|
|
19
|
+
resolves: Assertion<T>;
|
|
20
|
+
rejects: Assertion<T>;
|
|
21
|
+
not: Assertion<T>;
|
|
22
|
+
}
|
|
23
|
+
interface Expect extends AsymmetricMatchersContaining {
|
|
24
|
+
<T>(actual: T, message?: string): Assertion<T>;
|
|
25
|
+
unreachable(message?: string): Promise<never>;
|
|
26
|
+
soft<T>(actual: T, message?: string): Assertion<T>;
|
|
27
|
+
extend(expects: MatchersObject): void;
|
|
28
|
+
assertions(expected: number): Promise<void>;
|
|
29
|
+
hasAssertions(): Promise<void>;
|
|
30
|
+
anything(): any;
|
|
31
|
+
any(constructor: unknown): any;
|
|
32
|
+
getState(): MatcherState;
|
|
33
|
+
setState(state: Partial<MatcherState>): void;
|
|
34
|
+
not: AsymmetricMatchersContaining;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare const buildQueries: typeof domTestingLibrary.buildQueries;
|
|
38
|
+
declare const configure: typeof domTestingLibrary.configure;
|
|
39
|
+
declare const createEvent: domTestingLibrary.CreateObject & domTestingLibrary.CreateFunction;
|
|
40
|
+
declare const fireEvent: ((element: Element | Node | Document | Window, event: Event) => Promise<false> | Promise<true>) & PromisifyObject<domTestingLibrary.FireObject>;
|
|
41
|
+
declare const findAllByAltText: typeof domTestingLibrary.findAllByAltText;
|
|
42
|
+
declare const findAllByDisplayValue: typeof domTestingLibrary.findAllByDisplayValue;
|
|
43
|
+
declare const findAllByLabelText: typeof domTestingLibrary.findAllByLabelText;
|
|
44
|
+
declare const findAllByPlaceholderText: typeof domTestingLibrary.findAllByPlaceholderText;
|
|
45
|
+
declare const findAllByRole: typeof domTestingLibrary.findAllByRole;
|
|
46
|
+
declare const findAllByTestId: typeof domTestingLibrary.findAllByTestId;
|
|
47
|
+
declare const findAllByText: typeof domTestingLibrary.findAllByText;
|
|
48
|
+
declare const findAllByTitle: typeof domTestingLibrary.findAllByTitle;
|
|
49
|
+
declare const findByAltText: typeof domTestingLibrary.findByAltText;
|
|
50
|
+
declare const findByDisplayValue: typeof domTestingLibrary.findByDisplayValue;
|
|
51
|
+
declare const findByLabelText: typeof domTestingLibrary.findByLabelText;
|
|
52
|
+
declare const findByPlaceholderText: typeof domTestingLibrary.findByPlaceholderText;
|
|
53
|
+
declare const findByRole: typeof domTestingLibrary.findByRole;
|
|
54
|
+
declare const findByTestId: typeof domTestingLibrary.findByTestId;
|
|
55
|
+
declare const findByText: typeof domTestingLibrary.findByText;
|
|
56
|
+
declare const findByTitle: typeof domTestingLibrary.findByTitle;
|
|
57
|
+
declare const getAllByAltText: typeof domTestingLibrary.getAllByAltText;
|
|
58
|
+
declare const getAllByDisplayValue: typeof domTestingLibrary.getAllByDisplayValue;
|
|
59
|
+
declare const getAllByLabelText: typeof domTestingLibrary.getAllByLabelText;
|
|
60
|
+
declare const getAllByPlaceholderText: typeof domTestingLibrary.getAllByPlaceholderText;
|
|
61
|
+
declare const getAllByRole: typeof domTestingLibrary.getAllByRole;
|
|
62
|
+
declare const getAllByTestId: typeof domTestingLibrary.getAllByTestId;
|
|
63
|
+
declare const getAllByText: typeof domTestingLibrary.getAllByText;
|
|
64
|
+
declare const getAllByTitle: typeof domTestingLibrary.getAllByTitle;
|
|
65
|
+
declare const getByAltText: typeof domTestingLibrary.getByAltText;
|
|
66
|
+
declare const getByDisplayValue: typeof domTestingLibrary.getByDisplayValue;
|
|
67
|
+
declare const getByLabelText: typeof domTestingLibrary.getByLabelText;
|
|
68
|
+
declare const getByPlaceholderText: typeof domTestingLibrary.getByPlaceholderText;
|
|
69
|
+
declare const getByRole: typeof domTestingLibrary.getByRole;
|
|
70
|
+
declare const getByTestId: typeof domTestingLibrary.getByTestId;
|
|
71
|
+
declare const getByText: typeof domTestingLibrary.getByText;
|
|
72
|
+
declare const getByTitle: typeof domTestingLibrary.getByTitle;
|
|
73
|
+
declare const getConfig: typeof domTestingLibrary.getConfig;
|
|
74
|
+
declare const getDefaultNormalizer: typeof domTestingLibrary.getDefaultNormalizer;
|
|
75
|
+
declare const getElementError: typeof domTestingLibrary.getElementError;
|
|
76
|
+
declare const getNodeText: typeof domTestingLibrary.getNodeText;
|
|
77
|
+
declare const getQueriesForElement: typeof domTestingLibrary.getQueriesForElement;
|
|
78
|
+
declare const getRoles: typeof domTestingLibrary.getRoles;
|
|
79
|
+
declare const getSuggestedQuery: typeof domTestingLibrary.getSuggestedQuery;
|
|
80
|
+
declare const isInaccessible: typeof domTestingLibrary.isInaccessible;
|
|
81
|
+
declare const logDOM: typeof domTestingLibrary.logDOM;
|
|
82
|
+
declare const logRoles: typeof domTestingLibrary.logRoles;
|
|
83
|
+
declare const prettyDOM: typeof domTestingLibrary.prettyDOM;
|
|
84
|
+
declare const queries: typeof domTestingLibrary.queries;
|
|
85
|
+
declare const queryAllByAltText: typeof domTestingLibrary.queryAllByAltText;
|
|
86
|
+
declare const queryAllByAttribute: domTestingLibrary.AllByAttribute;
|
|
87
|
+
declare const queryAllByDisplayValue: typeof domTestingLibrary.queryAllByDisplayValue;
|
|
88
|
+
declare const queryAllByLabelText: typeof domTestingLibrary.queryAllByLabelText;
|
|
89
|
+
declare const queryAllByPlaceholderText: typeof domTestingLibrary.queryAllByPlaceholderText;
|
|
90
|
+
declare const queryAllByRole: typeof domTestingLibrary.queryAllByRole;
|
|
91
|
+
declare const queryAllByTestId: typeof domTestingLibrary.queryAllByTestId;
|
|
92
|
+
declare const queryAllByText: typeof domTestingLibrary.queryAllByText;
|
|
93
|
+
declare const queryAllByTitle: typeof domTestingLibrary.queryAllByTitle;
|
|
94
|
+
declare const queryByAltText: typeof domTestingLibrary.queryByAltText;
|
|
95
|
+
declare const queryByAttribute: domTestingLibrary.QueryByAttribute;
|
|
96
|
+
declare const queryByDisplayValue: typeof domTestingLibrary.queryByDisplayValue;
|
|
97
|
+
declare const queryByLabelText: typeof domTestingLibrary.queryByLabelText;
|
|
98
|
+
declare const queryByPlaceholderText: typeof domTestingLibrary.queryByPlaceholderText;
|
|
99
|
+
declare const queryByRole: typeof domTestingLibrary.queryByRole;
|
|
100
|
+
declare const queryByTestId: typeof domTestingLibrary.queryByTestId;
|
|
101
|
+
declare const queryByText: typeof domTestingLibrary.queryByText;
|
|
102
|
+
declare const queryByTitle: typeof domTestingLibrary.queryByTitle;
|
|
103
|
+
declare const queryHelpers: typeof domTestingLibrary.queryHelpers;
|
|
104
|
+
declare const screen: domTestingLibrary.Screen<typeof domTestingLibrary.queries>;
|
|
105
|
+
declare const waitFor: typeof domTestingLibrary.waitFor;
|
|
106
|
+
declare const waitForElementToBeRemoved: typeof domTestingLibrary.waitForElementToBeRemoved;
|
|
107
|
+
declare const within: typeof domTestingLibrary.getQueriesForElement;
|
|
108
|
+
declare const prettyFormat: typeof domTestingLibrary.prettyFormat;
|
|
109
|
+
type _UserEvent = typeof _userEvent;
|
|
110
|
+
interface UserEvent extends _UserEvent {
|
|
111
|
+
}
|
|
112
|
+
declare const userEvent: UserEvent;
|
|
113
|
+
|
|
114
|
+
type Listener = (mock: MockInstance, args: unknown[]) => void;
|
|
115
|
+
declare function onMockCall(callback: Listener): () => void;
|
|
116
|
+
declare const spyOn: typeof spyOn$1;
|
|
117
|
+
type Procedure = (...args: any[]) => any;
|
|
118
|
+
type Mock<T extends Procedure | any[] = any[], R = any> = T extends Procedure ? Mock$1<T> : T extends any[] ? Mock$1<(...args: T) => R> : never;
|
|
119
|
+
declare function fn<T extends Procedure = Procedure>(implementation?: T): Mock<T>;
|
|
120
|
+
declare function fn<TArgs extends any[] = any, R = any>(): Mock<(...args: TArgs) => R>;
|
|
121
|
+
declare function fn<TArgs extends any[] = any[], R = any>(implementation: (...args: TArgs) => R): Mock<(...args: TArgs) => R>;
|
|
122
|
+
declare function fn<TArgs extends any[] = any[], R = any>(implementation?: (...args: TArgs) => R): Mock<(...args: TArgs) => R>;
|
|
123
|
+
/**
|
|
124
|
+
* Calls [`.mockClear()`](https://vitest.dev/api/mock#mockclear) on every mocked function. This will
|
|
125
|
+
* only empty `.mock` state, it will not reset implementation.
|
|
126
|
+
*
|
|
127
|
+
* It is useful if you need to clean up mock between different assertions.
|
|
128
|
+
*/
|
|
129
|
+
declare function clearAllMocks(): void;
|
|
130
|
+
/**
|
|
131
|
+
* Calls [`.mockReset()`](https://vitest.dev/api/mock#mockreset) on every mocked function. This will
|
|
132
|
+
* empty `.mock` state, reset "once" implementations and force the base implementation to return
|
|
133
|
+
* `undefined` when invoked.
|
|
134
|
+
*
|
|
135
|
+
* This is useful when you want to completely reset a mock to the default state.
|
|
136
|
+
*/
|
|
137
|
+
declare function resetAllMocks(): void;
|
|
138
|
+
/**
|
|
139
|
+
* Calls [`.mockRestore()`](https://vitest.dev/api/mock#mockrestore) on every mocked function. This
|
|
140
|
+
* will restore all original implementations.
|
|
141
|
+
*/
|
|
142
|
+
declare function restoreAllMocks(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Type helper for TypeScript. Just returns the object that was passed.
|
|
145
|
+
*
|
|
146
|
+
* When `partial` is `true` it will expect a `Partial<T>` as a return value. By default, this will
|
|
147
|
+
* only make TypeScript believe that the first level values are mocked. You can pass down `{ deep:
|
|
148
|
+
* true }` as a second argument to tell TypeScript that the whole object is mocked, if it actually
|
|
149
|
+
* is.
|
|
150
|
+
*
|
|
151
|
+
* @param item Anything that can be mocked
|
|
152
|
+
* @param deep If the object is deeply mocked
|
|
153
|
+
* @param options If the object is partially or deeply mocked
|
|
154
|
+
*/
|
|
155
|
+
declare function mocked<T>(item: T, deep?: false): MaybeMocked<T>;
|
|
156
|
+
declare function mocked<T>(item: T, deep: true): MaybeMockedDeep<T>;
|
|
157
|
+
declare function mocked<T>(item: T, options: {
|
|
158
|
+
partial?: false;
|
|
159
|
+
deep?: false;
|
|
160
|
+
}): MaybeMocked<T>;
|
|
161
|
+
declare function mocked<T>(item: T, options: {
|
|
162
|
+
partial?: false;
|
|
163
|
+
deep: true;
|
|
164
|
+
}): MaybeMockedDeep<T>;
|
|
165
|
+
declare function mocked<T>(item: T, options: {
|
|
166
|
+
partial: true;
|
|
167
|
+
deep?: false;
|
|
168
|
+
}): MaybePartiallyMocked<T>;
|
|
169
|
+
declare function mocked<T>(item: T, options: {
|
|
170
|
+
partial: true;
|
|
171
|
+
deep: true;
|
|
172
|
+
}): MaybePartiallyMockedDeep<T>;
|
|
173
|
+
declare function mocked<T>(item: T): MaybeMocked<T>;
|
|
174
|
+
|
|
175
|
+
type Queries = BoundFunctions<typeof queries>;
|
|
176
|
+
type UserEventObject = ReturnType<typeof userEvent$1.setup>;
|
|
177
|
+
declare module 'storybook/internal/csf' {
|
|
178
|
+
interface Canvas extends Queries {
|
|
179
|
+
}
|
|
180
|
+
interface StoryContext {
|
|
181
|
+
userEvent: UserEventObject;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
declare const expect: Expect;
|
|
185
|
+
|
|
186
|
+
export { type Mock, type UserEvent, type UserEventObject, buildQueries, clearAllMocks, configure, createEvent, expect, findAllByAltText, findAllByDisplayValue, findAllByLabelText, findAllByPlaceholderText, findAllByRole, findAllByTestId, findAllByText, findAllByTitle, findByAltText, findByDisplayValue, findByLabelText, findByPlaceholderText, findByRole, findByTestId, findByText, findByTitle, fireEvent, fn, getAllByAltText, getAllByDisplayValue, getAllByLabelText, getAllByPlaceholderText, getAllByRole, getAllByTestId, getAllByText, getAllByTitle, getByAltText, getByDisplayValue, getByLabelText, getByPlaceholderText, getByRole, getByTestId, getByText, getByTitle, getConfig, getDefaultNormalizer, getElementError, getNodeText, getQueriesForElement, getRoles, getSuggestedQuery, isInaccessible, logDOM, logRoles, mocked, onMockCall, prettyDOM, prettyFormat, queries, queryAllByAltText, queryAllByAttribute, queryAllByDisplayValue, queryAllByLabelText, queryAllByPlaceholderText, queryAllByRole, queryAllByTestId, queryAllByText, queryAllByTitle, queryByAltText, queryByAttribute, queryByDisplayValue, queryByLabelText, queryByPlaceholderText, queryByRole, queryByTestId, queryByText, queryByTitle, queryHelpers, resetAllMocks, restoreAllMocks, screen, spyOn, userEvent, waitFor, waitForElementToBeRemoved, within };
|