index.d.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. import { loadAllPresets } from '@storybook/core-common';
  2. export { getPreviewBodyTemplate, getPreviewHeadTemplate } from '@storybook/core-common';
  3. import { CLIOptions, LoadOptions, BuilderOptions } from '@storybook/types';
  4. import { EventType } from '@storybook/telemetry';
  5. type BuildStaticStandaloneOptions = CLIOptions & LoadOptions & BuilderOptions & {
  6. outputDir: string;
  7. };
  8. declare function buildStaticStandalone(options: BuildStaticStandaloneOptions): Promise<void>;
  9. declare function buildDevStandalone(options: CLIOptions & LoadOptions & BuilderOptions): Promise<{
  10. port: number;
  11. address: string;
  12. networkAddress: string;
  13. }>;
  14. type TelemetryOptions = {
  15. cliOptions: CLIOptions;
  16. presetOptions?: Parameters<typeof loadAllPresets>[0];
  17. printError?: (err: any) => void;
  18. skipPrompt?: boolean;
  19. };
  20. type ErrorLevel = 'none' | 'error' | 'full';
  21. declare function getErrorLevel({ cliOptions, presetOptions, skipPrompt, }: TelemetryOptions): Promise<ErrorLevel>;
  22. declare function sendTelemetryError(_error: unknown, eventType: EventType, options: TelemetryOptions): Promise<void>;
  23. declare function withTelemetry<T>(eventType: EventType, options: TelemetryOptions, run: () => Promise<T>): Promise<T | undefined>;
  24. declare function build(options?: any, frameworkOptions?: any): Promise<void | {
  25. port: number;
  26. address: string;
  27. networkAddress: string;
  28. }>;
  29. export { BuildStaticStandaloneOptions, build, buildDevStandalone, buildStaticStandalone, getErrorLevel, sendTelemetryError, withTelemetry };