import { ComponentOptionsMixin } from 'vue'; import { ComponentProvideOptions } from 'vue'; import { DefineComponent } from 'vue'; import type { HLJSApi } from 'highlight.js'; import type { ImportMap } from '@vue/repl'; import { Language } from '@deot/docs-locale'; import type { LanguageFn } from 'highlight.js'; import { Portal } from '@deot/vc'; import { PublicProps } from 'vue'; import type { Ref } from 'vue'; import type { SandboxProps } from '@vue/repl'; import type { StoreState } from '@vue/repl'; import { vue } from 'vue'; declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, { language: string; filename: string; copyLabel: string; }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>; declare const __VLS_export_2: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, { change: (value: string) => any; "update:modelValue": (value: string) => any; navigate: (to: string) => any; "update:files": (files: PlaygroundFiles) => any; "update:entry": (entry: string) => any; "update:viewport": (viewport: PlaygroundViewport) => any; }, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{ onChange?: ((value: string) => any) | undefined; "onUpdate:modelValue"?: ((value: string) => any) | undefined; onNavigate?: ((to: string) => any) | undefined; "onUpdate:files"?: ((files: PlaygroundFiles) => any) | undefined; "onUpdate:entry"?: ((entry: string) => any) | undefined; "onUpdate:viewport"?: ((viewport: PlaygroundViewport) => any) | undefined; }>, { title: string; files: PlaygroundFiles; views: readonly string[]; entry: string; modelValue: string; options: PlaygroundOptions; previewInset: PlaygroundPreviewInset; previewScroller: PlaygroundPreviewScroller; styleless: boolean; id: string; }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>; declare type __VLS_Props = { code: string; filename?: string; language?: string; copyLabel?: string; locale?: Language; }; declare type __VLS_Props_2 = { modelValue?: string; files?: PlaygroundFiles; entry?: string; views?: readonly string[]; viewport?: PlaygroundViewport; viewportOptions?: readonly unknown[]; styleless?: boolean; options?: PlaygroundOptions; previewInset?: PlaygroundPreviewInset; expandable?: PlaygroundExpandable; title?: string; id?: string; previewScroller?: PlaygroundPreviewScroller; previewOptions?: PlaygroundPreviewOptions; locale?: Language; }; export declare const applyPlaygroundImportMapOverride: (alias: string, url: string) => { [x: string]: string; }; export declare const applyPlaygroundStyleOverride: (alias: string, url: string) => { [x: string]: string; }; export declare const clearPlaygroundMaps: () => void; export declare const CodePreview: typeof __VLS_export; export declare const createBuiltinImports: (cdnURL?: string) => Record; export declare const createBuiltinStyles: (cdnURL?: string) => Record; declare interface CreateRuntimePreviewOptions { previewScroller?: boolean; } export declare const createRuntimePreviewOptions: (cdnURL?: string, options?: CreateRuntimePreviewOptions) => NonNullable; export declare const DEFAULT_CDN_URL = "https://cdn.jsdelivr.net/npm"; export declare const Editor: Portal void; onFilesChange?: EditorFilesChange; onActiveChange?: (filename: string) => void; getCodeErrors?: () => Array; locale?: Language; }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{ value?: string; files?: PlaygroundFiles; entry?: string; onChange?: (value: string) => void; onFilesChange?: EditorFilesChange; onActiveChange?: (filename: string) => void; getCodeErrors?: () => Array; locale?: Language; }> & Readonly<{}>, { files: PlaygroundFiles; entry: string; value: string; onChange: (value: string) => void; onFilesChange: EditorFilesChange; onActiveChange: (filename: string) => void; getCodeErrors: () => Array; }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>>; export declare type EditorFilesChange = (files: PlaygroundFiles, entry: string, action: EditorFilesChangeAction) => void; export declare type EditorFilesChangeAction = { type: 'update'; filename: string; } | { type: 'create'; filename: string; } | { type: 'rename'; filename: string; previousFilename: string; } | { type: 'delete'; filename: string; } | { type: 'entry'; filename: string; }; export declare const getPlaygroundImportMapOverrides: () => { [x: string]: string; }; export declare const getPlaygroundSiteModules: () => { [x: string]: string; }; export declare const getPlaygroundSiteStyles: () => { [x: string]: string; }; export declare const getPlaygroundStyleOverrides: () => { [x: string]: string; }; export declare const highlightCode: (code: string, filename: string) => string; export declare const highlightCodeByLanguage: (code: string, language: string) => string; export declare const isSafePlaygroundHref: (href: string) => boolean; export declare const normalizeCdnURL: (cdnURL?: string) => string; export declare const Playground: typeof __VLS_export_2; export declare type PlaygroundExpandable = true | number; export declare type PlaygroundFiles = Record; export declare interface PlaygroundFilesProps { files: PlaygroundFiles; entry: string; } export declare type PlaygroundOptions = Omit, 'builtinImportMap' | 'files' | 'activeFilename' | 'mainFile' | 'template'> & { cdnURL?: string; builtinImportMap?: ImportMap; }; export declare type PlaygroundPreviewInset = number | [vertical: number, horizontal: number]; export declare type PlaygroundPreviewOptions = SandboxProps['previewOptions']; export declare type PlaygroundPreviewScroller = boolean; export declare interface PlaygroundRunOptions { visible?: Ref | (() => boolean); } export declare class PlaygroundService { private readonly target; private readonly vue; private readonly session; private sequence; private disposed; private manual?; private readonly requests; private readonly owners; constructor(target: Window, vue: PreviewVue); enable(height: number): Promise; disable(): void; run(height: number): (visible: boolean) => Promise; run(height: number, handler: (...args: Args) => Result): (...args: Args) => Promise | undefined>; run(height: number, options: PlaygroundRunOptions, handler: (...args: Args) => Result): (...args: Args) => Promise | undefined>; run(height: number, options: PlaygroundRunOptions & { visible: Ref; }): () => Promise; dispose(): void; private validateHeight; private post; private createRequest; } export declare type PlaygroundView = 'runtime' | 'files'; export declare type PlaygroundViewport = 'auto' | number | [width: number, height: number]; export declare interface PlaygroundViewsProps { views: PlaygroundView[]; activeView: PlaygroundView; } export declare interface PlaygroundWindow extends Window { $docsPlayground: PlaygroundService; } export declare const PREVIEW_SCROLL_CONTENT_CLASS = "docs-playground-preview-scroll__content"; export declare const PREVIEW_SCROLL_HTML_CLASS = "docs-playground-preview-scroll"; export declare const PREVIEW_SCROLLER_USE_CODE: string; declare type PreviewVue = Pick; export declare const registerVueHighlight: (api?: HLJSApi) => HLJSApi; export declare const removePlaygroundImportMapOverride: (alias: string) => { [x: string]: string; }; export declare const removePlaygroundStyleOverride: (alias: string) => { [x: string]: string; }; export declare const resolveHighlightLanguage: (filename: string) => "xml" | "javascript" | "typescript" | "css" | "scss" | "vue" | "json" | "plaintext"; export declare const resolvePlaygroundTitleId: (title: string, explicitId?: string, isOccupied?: (id: string) => boolean) => string; export declare const setPlaygroundImportMapOverrides: (value?: Record) => void; export declare const setPlaygroundSiteModules: (value?: Record) => void; export declare const setPlaygroundSiteStyles: (value?: Record) => void; export declare const setPlaygroundStyleOverrides: (value?: Record) => void; export declare const slugifyPlaygroundTitle: (title: string) => string; export declare const vueHighlight: LanguageFn; export { }