mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Updates new functions in @storybook/addon-actions (#27627)
* Updates new functions in @storybook/addon-actions * Fix about reviewed contents.
This commit is contained in:
+9
-3
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user