Kaelig Deloumeau-Prigent 797b7df6ce
[addon-a11y] Export types of params
In order to match addon-a11y's options in our automated a11y testing suite, I'd like to use the same types.

Workaround:

```ts
import type {A11yParameters} from '@storybook/addon-a11y/dist/ts3.9/params';
```

Not sure my PR shows the correct way to do this, or if there are other existing workarounds – I'd appreciate some advice!
2021-09-22 10:43:52 -07:00

27 lines
716 B
TypeScript

import { AnyFramework, DecoratorFunction } from '@storybook/csf';
import deprecate from 'util-deprecate';
import dedent from 'ts-dedent';
export { PARAM_KEY } from './constants';
export * from './highlight';
export * from './params';
if (module && module.hot && module.hot.decline) {
module.hot.decline();
}
export const withA11y: DecoratorFunction<AnyFramework> = deprecate(
(storyFn, storyContext) => {
return storyFn(storyContext);
},
dedent`
withA11y(options) is deprecated, please configure addon-a11y using the addParameter api:
addParameters({
a11y: options,
});
More at: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#removed-witha11y-decorator
`
);