import { previewTemplate } from "./index"; /** * Copyright (c) 2020-present NAVER Corp. * egjs projects are licensed under the MIT license */ export interface CodeSandboxValue { template?: string; scripts?: Record; files: FilesParam; dependencies?: Record; devDependencies?: Record; userDependencies?: string[]; } export type CodeSandboxTemplate = (userDependencies?: string[], files?: FilesParam) => CodeSandboxValue; export type FilesParam = Record; export interface CodeFileTab { tab: string; index?: number; template?: string; values?: Record; } export interface ObjectType { indent?: number; endIndent?: number; joinSeparator?: string; separator?: string; endSeparator?: string; } export interface OptionsType extends ObjectType { template?: (name: string, index: number) => any[], prefix?: string, suffix?: string, } export interface PropsOptions { indent?: number; wrap?: string; prefix?: string; } /** * @typedef */ export interface PreviewParameter { /** * The name of the tab to appear in the preview panel */ tab?: string; /** * Code to appear in the corresponding tab of the preview panel. */ template?: string | ((props: Record, globals: Record) => any) | ReturnType; /** * Description of the corresponding template code */ description?: string; /** * Custom args or knobs that can be used in the preview template. * @deprecated */ knobs?: Record; /** * Custom args or knobs that can be used in the preview template. */ args?: Record; /** * Whether to display the copy button */ copy?: boolean; /** * Language to highlight its code ("html", "css", "jsx", "tsx", "ts", "js") */ language?: string; /** * Language presets to link to codesandbox * @see {@link https://github.com/naver/storybook-addon-preview/blob/master/README.md} */ codesandbox?: CodeSandboxValue | ((previewMap: Record) => CodeSandboxValue); /** * Whether to share line numbers when tab names are the same */ continue?: boolean; /** * Formatting type for that code if you want formatting * Only "html" is supported as built-in support. * If you want to use custom formatter, use `previewFormatter` config in manager.js * @see {@link https://github.com/naver/storybook-addon-preview/blob/master/README.md} */ format?: string | boolean; } export interface ParsedPreviewParameter extends PreviewParameter { text: string; }