mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
@storybook/html: add support for stories generated by dom elements (#35947)
This commit is contained in:
committed by
Andrew Casey
parent
bf0310e305
commit
6c9328fbf3
Vendored
+1
-1
@@ -6,7 +6,7 @@
|
||||
|
||||
/// <reference types="webpack-env" />
|
||||
|
||||
export type RenderFunction = () => string | string[];
|
||||
export type RenderFunction = () => string | string[] | HTMLElement;
|
||||
|
||||
export interface DecoratorParameters {
|
||||
[key: string]: any;
|
||||
|
||||
@@ -33,6 +33,11 @@ storiesOf<AnyAddon>('withAnyAddon', module)
|
||||
.addWithSideEffect('more', () => "<div></div>")
|
||||
.add('another story', () => "<div></div>")
|
||||
.add('to Storybook as Array', () => ["<div></div>", "<div></div>"])
|
||||
.add('storybook with dom', () => {
|
||||
const button = document.createElement('button');
|
||||
button.innerText = '😀 😎 👍 💯';
|
||||
return button;
|
||||
})
|
||||
.add('and a story with additional parameters', () => "<div></div>", parameters)
|
||||
.addWithSideEffect('even more', () => "<div></div>");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user