Updates new functions in @storybook/addon-actions (#27627)

* Updates new functions in @storybook/addon-actions

* Fix about reviewed contents.
This commit is contained in:
junseok
2018-07-27 17:12:31 -07:00
committed by Andy
parent 735b9a1cc6
commit d8814ea085
2 changed files with 14 additions and 4 deletions
+9 -3
View File
@@ -1,11 +1,17 @@
// Type definitions for @storybook/addon-actions 3.0
// Type definitions for @storybook/addon-actions 3.4
// Project: https://github.com/storybooks/storybook
// Definitions by: Joscha Feth <https://github.com/joscha>
// Definitions by: Joscha Feth <https://github.com/joscha>, June <https://github.com/jicjjang>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.6
export type HandlerFunction = (...args: any[]) => undefined;
export type DecoratorFunction = (args: any[]) => any[];
export interface Options {
depth?: number;
clearOnStoryChange?: boolean;
limit?: number;
}
export function decorateAction(decorators: DecoratorFunction[]): (name: string) => HandlerFunction;
export function decorateAction(decorators: DecoratorFunction[]): (name: string, options?: Options) => HandlerFunction;
export function configureActions(options: Options): undefined;
export function action(name: string): HandlerFunction;
@@ -2,7 +2,11 @@
import * as React from 'react';
import { storiesOf } from '@storybook/react';
import { action, decorateAction } from '@storybook/addon-actions';
import { action, decorateAction, configureActions } from '@storybook/addon-actions';
configureActions({
depth: 100
});
const firstArgAction = decorateAction([
args => args.slice(0, 1)