import { AnnotatedStoryFn, Args, ComponentAnnotations, DecoratorFunction, LoaderFunction, StoryAnnotations, StoryContext as GenericStoryContext, StrictArgs, ProjectAnnotations } from 'storybook/internal/types'; import * as AngularCore from '@angular/core'; import { AngularRenderer } from './types'; export type { Args, ArgTypes, Parameters, StrictArgs } from 'storybook/internal/types'; export type { Parameters as AngularParameters } from './types'; export type { AngularRenderer }; /** * Metadata to configure the stories for a component. * * @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export) */ export type Meta = ComponentAnnotations>; /** * Story function that represents a CSFv2 component example. * * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports) */ export type StoryFn = AnnotatedStoryFn>; /** * Story object that represents a CSFv3 component example. * * @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports) */ export type StoryObj = StoryAnnotations>; export type Decorator = DecoratorFunction; export type Loader = LoaderFunction; export type StoryContext = GenericStoryContext; export type Preview = ProjectAnnotations; /** * Utility type that transforms InputSignal and EventEmitter types */ type TransformComponentType = TransformInputSignalType>>; // @ts-ignore type AngularInputSignal = AngularCore.InputSignal; // @ts-ignore type AngularInputSignalWithTransform = AngularCore.InputSignalWithTransform; // @ts-ignore type AngularOutputEmitterRef = AngularCore.OutputEmitterRef; type AngularHasInputSignal = typeof AngularCore extends { input: infer U; } ? true : false; type AngularHasOutputSignal = typeof AngularCore extends { output: infer U; } ? true : false; type InputSignal = AngularHasInputSignal extends true ? AngularInputSignal : never; type InputSignalWithTransform = AngularHasInputSignal extends true ? AngularInputSignalWithTransform : never; type OutputEmitterRef = AngularHasOutputSignal extends true ? AngularOutputEmitterRef : never; type TransformInputSignalType = { [K in keyof T]: T[K] extends InputSignal ? E : T[K] extends InputSignalWithTransform ? U : T[K]; }; type TransformOutputSignalType = { [K in keyof T]: T[K] extends OutputEmitterRef ? (e: E) => void : T[K]; }; type TransformEventType = { [K in keyof T]: T[K] extends AngularCore.EventEmitter ? (e: E) => void : T[K]; };