import { ComputedRef } from 'vue'; import * as defaultCompiler from 'vue/compiler-sfc'; import { editor } from 'monaco-editor-core'; import { version as languageToolsVersion } from '@vue/language-service/package.json'; import { Ref } from 'vue'; import { SFCAsyncStyleCompileOptions } from 'vue/compiler-sfc'; import { SFCScriptCompileOptions } from 'vue/compiler-sfc'; import { SFCTemplateCompileOptions } from 'vue/compiler-sfc'; import { ToRefs } from 'vue'; import { UnwrapRef } from 'vue'; export declare function compileFile(store: Store, { filename, code, compiled }: File_2): Promise<(string | Error)[]>; declare type EditorMode = 'js' | 'css' | 'ssr'; declare class File_2 { filename: string; code: string; hidden: boolean; compiled: { js: string; css: string; ssr: string; clientMap: string; ssrMap: string; }; editorViewState: editor.ICodeEditorViewState | null; constructor(filename: string, code?: string, hidden?: boolean); get language(): "css" | "vue" | "typescript" | "html" | "javascript"; } export { File_2 as File } export declare interface ImportMap { imports?: Record; scopes?: Record>; } export { languageToolsVersion } export declare function mergeImportMap(a: ImportMap, b: ImportMap): ImportMap; declare type OutputModes = 'preview' | 'ssr output' | EditorMode; export declare interface ReplStore extends UnwrapRef { activeFile: File_2; /** Loading compiler */ loading: boolean; init(): void; setActive(filename: string): void; addFile(filename: string | File_2): void; deleteFile(filename: string): void; renameFile(oldFilename: string, newFilename: string): void; getImportMap(): ImportMap; setImportMap(map: ImportMap, merge?: boolean): void; getTsConfig(): Record; serialize(): string; /** * Deserializes the given string to restore the REPL store state. * @param serializedState - The serialized state string. * @param checkBuiltinImportMap - Whether to check the built-in import map. Default to true */ deserialize(serializedState: string, checkBuiltinImportMap?: boolean): void; getFiles(): Record; setFiles(newFiles: Record, mainFile?: string): Promise; /** Custom online resources */ resourceLinks?: ResourceLinkConfigs; } declare type ResourceLinkConfigs = { esModuleShims?: string; vueCompilerUrl?: (version: string) => string; typescriptLib?: (version: string) => string; pkgLatestVersionUrl?: (pkgName: string) => string; pkgDirUrl?: (pkgName: string, pkgVersion: string, pkgPath: string) => string; pkgFileTextUrl?: (pkgName: string, pkgVersion: string | undefined, pkgPath: string) => string; }; export declare interface SFCOptions { script?: Partial; style?: Partial; template?: Partial; } export declare type Store = Pick; export declare type StoreState = ToRefs<{ files: Record; activeFilename: string; mainFile: string; template: { welcomeSFC?: string; newSFC?: string; }; builtinImportMap: ImportMap; errors: (string | Error)[]; showOutput: boolean; outputMode: OutputModes; sfcOptions: SFCOptions; ssrOutput: { html: string; context: unknown; }; /** `@vue/compiler-sfc` */ compiler: typeof defaultCompiler; vueVersion: string | null; locale: string | undefined; typescriptVersion: string; /** \{ dependencyName: version \} */ dependencyVersion: Record; reloadLanguageTools?: (() => void) | undefined; /** Custom online resources */ resourceLinks?: ResourceLinkConfigs; }>; export declare function useStore({ files, activeFilename, // set later mainFile, template, builtinImportMap, // set later errors, showOutput, outputMode, sfcOptions, compiler, vueVersion, locale, typescriptVersion, dependencyVersion, reloadLanguageTools, resourceLinks, }?: Partial, serializedState?: string): ReplStore; export declare function useVueImportMap(defaults?: { runtimeDev?: string | (() => string); runtimeProd?: string | (() => string); serverRenderer?: string | (() => string); vueVersion?: string | null; }): { productionMode: Ref; importMap: ComputedRef; vueVersion: Ref; defaultVersion: string; }; export { }