diff --git a/addons/addon-contexts/src/@types/index.ts b/addons/addon-contexts/src/@types/index.ts index a50fb20c2730..0af97c176d4f 100644 --- a/addons/addon-contexts/src/@types/index.ts +++ b/addons/addon-contexts/src/@types/index.ts @@ -51,19 +51,19 @@ export declare type PropsMapUpdaterType = ( // helper types export declare type AggregateComponents = ( - h: (...arg: any[]) => T -) => (...arg: [ComponentType[], GenericProps, AddonOptions, number]) => AnyFunctionReturns; + h: AnyFunctionReturns +) => (...args: [ComponentType[], GenericProps, AddonOptions, number]) => AnyFunctionReturns; export declare type AggregateContexts = ( - h: (...arg: any[]) => T -) => (...arg: [ContextNode[], Exclude]) => AnyFunctionReturns; + h: AnyFunctionReturns +) => (...args: [ContextNode[], Exclude]) => AnyFunctionReturns; export declare type MergeSettings = ( ...args: [Partial, Partial] ) => ContextNode; export declare type GetContextNodes = (settings: WrapperSettings) => ContextNode[]; export declare type Memorize = ( - fn: (...arg: U) => T, - resolver: (...arg: U) => unknown -) => (...arg: U) => T; + fn: (...args: U) => T, + resolver: (...args: U) => unknown +) => (...args: U) => T; export declare type UseChannel = ( event: string, eventHandler: AnyFunctionReturns, @@ -71,7 +71,7 @@ export declare type UseChannel = ( ) => void; // Component types -export declare type Wrapper = (...arg: [Function, unknown, WrapperSettings]) => ReactNode; +export declare type Wrapper = (...args: [Function, unknown, WrapperSettings]) => unknown; export declare type TAddonManager = FCNoChildren<{ channel: Channel; }>; @@ -83,7 +83,7 @@ export declare type TAddonWrapper = FC<{ export declare type TMenuController = FCNoChildren< Omit< ContextNode & { - setSelect: (...arg: StringTuple) => void; + setSelect: (...args: StringTuple) => void; }, 'components' > diff --git a/addons/addon-contexts/src/index.ts b/addons/addon-contexts/src/index.ts index be871b81a36b..bc96b8510073 100644 --- a/addons/addon-contexts/src/index.ts +++ b/addons/addon-contexts/src/index.ts @@ -2,11 +2,11 @@ import { createElement as h } from 'react'; import addons, { makeDecorator } from '@storybook/addons'; import { ReactWrapper } from './containers/ReactWrapper'; import { ID, PARAM } from './libs/constants'; -import { getNodes } from './libs/helpers'; +import { getContextNodes } from './libs/helpers'; import { WithContexts, Wrapper } from './@types'; const wrapper: Wrapper = (getStory, context, settings) => { - const nodes = getNodes(settings); + const nodes = getContextNodes(settings); return h(ReactWrapper, { nodes, channel: addons.getChannel(), diff --git a/addons/addon-contexts/src/libs/helpers.ts b/addons/addon-contexts/src/libs/helpers.ts index 9d5583ea1d14..809c771ad5d5 100644 --- a/addons/addon-contexts/src/libs/helpers.ts +++ b/addons/addon-contexts/src/libs/helpers.ts @@ -104,4 +104,4 @@ export const aggregateContexts: AggregateContexts = (h) => (nodes, propsMap) => ) .reduce((acc, agg) => agg(() => acc), next()); -export const getNodes = _memorize(_getContextNodes, ({ parameters }) => parameters); +export const getContextNodes = _memorize(_getContextNodes, ({ parameters }) => parameters);