IMPROVE types of addon-centered for angular

This commit is contained in:
Norbert de Langen 2019-07-10 00:32:23 +02:00
parent f4479514cc
commit c87d5ae89e
3 changed files with 11 additions and 4 deletions

View File

@ -1,3 +1,5 @@
import { StoryFn } from "@storybook/addons";
export interface ICollection {
[p: string]: any;
}
@ -11,11 +13,13 @@ export interface NgModuleMetadata {
}
export interface IStory {
props?: ICollection;
moduleMetadata?: Partial<NgModuleMetadata>;
component?: any;
props?: ICollection;
propsMeta?: ICollection;
moduleMetadata?: NgModuleMetadata;
template?: string;
styles?: string[];
}
declare module '@storybook/addon-centered/angular' {
export function centered(story: IStory): IStory;
export function centered(story: StoryFn<IStory>): IStory;
}

View File

@ -23,6 +23,7 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "5.2.0-alpha.38",
"core-js": "^3.0.1",
"global": "^4.3.2",
"util-deprecate": "^1.0.2"

View File

@ -1,3 +1,5 @@
import { StoryFn } from '@storybook/addons';
import { IStory } from '../angular.d';
import styles from './styles';
function getComponentSelector(component: any) {
@ -43,7 +45,7 @@ function getModuleMetadata(metadata: any) {
return moduleMetadata;
}
export default function(metadataFn: any) {
export default function(metadataFn: StoryFn<IStory>) {
const metadata = metadataFn();
return {