@deot/docs-playground 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,202 @@
1
+ import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
3
+ import { DefineComponent } from 'vue';
4
+ import type { HLJSApi } from 'highlight.js';
5
+ import type { ImportMap } from '@vue/repl';
6
+ import { Language } from '@deot/docs-locale';
7
+ import type { LanguageFn } from 'highlight.js';
8
+ import { Portal } from '@deot/vc';
9
+ import { PublicProps } from 'vue';
10
+ import type { SandboxProps } from '@vue/repl';
11
+ import type { StoreState } from '@vue/repl';
12
+
13
+ declare const __VLS_export: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
14
+ language: string;
15
+ filename: string;
16
+ copyLabel: string;
17
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
18
+
19
+ declare const __VLS_export_2: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
20
+ change: (value: string) => any;
21
+ "update:modelValue": (value: string) => any;
22
+ navigate: (to: string) => any;
23
+ "update:files": (files: PlaygroundFiles) => any;
24
+ "update:entry": (entry: string) => any;
25
+ "update:viewport": (viewport: PlaygroundViewport) => any;
26
+ }, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
27
+ onChange?: ((value: string) => any) | undefined;
28
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
29
+ onNavigate?: ((to: string) => any) | undefined;
30
+ "onUpdate:files"?: ((files: PlaygroundFiles) => any) | undefined;
31
+ "onUpdate:entry"?: ((entry: string) => any) | undefined;
32
+ "onUpdate:viewport"?: ((viewport: PlaygroundViewport) => any) | undefined;
33
+ }>, {
34
+ files: PlaygroundFiles;
35
+ entry: string;
36
+ views: readonly string[];
37
+ modelValue: string;
38
+ options: PlaygroundOptions;
39
+ styleless: boolean;
40
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
41
+
42
+ declare type __VLS_Props = {
43
+ code: string;
44
+ filename?: string;
45
+ language?: string;
46
+ copyLabel?: string;
47
+ locale?: Language;
48
+ };
49
+
50
+ declare type __VLS_Props_2 = {
51
+ modelValue?: string;
52
+ files?: PlaygroundFiles;
53
+ entry?: string;
54
+ views?: readonly string[];
55
+ viewport?: PlaygroundViewport;
56
+ viewportOptions?: readonly unknown[];
57
+ styleless?: boolean;
58
+ options?: PlaygroundOptions;
59
+ previewOptions?: PlaygroundPreviewOptions;
60
+ locale?: Language;
61
+ };
62
+
63
+ export declare const applyPlaygroundImportMapOverride: (alias: string, url: string) => {
64
+ [x: string]: string;
65
+ };
66
+
67
+ export declare const applyPlaygroundStyleOverride: (alias: string, url: string) => {
68
+ [x: string]: string;
69
+ };
70
+
71
+ export declare const clearPlaygroundMaps: () => void;
72
+
73
+ export declare const CodePreview: typeof __VLS_export;
74
+
75
+ export declare const createBuiltinImports: (cdnURL?: string) => Record<string, string>;
76
+
77
+ export declare const createBuiltinStyles: (cdnURL?: string) => Record<string, string>;
78
+
79
+ export declare const createRuntimePreviewOptions: (cdnURL?: string) => NonNullable<SandboxProps["previewOptions"]>;
80
+
81
+ export declare const DEFAULT_CDN_URL = "https://cdn.jsdelivr.net/npm";
82
+
83
+ export declare const Editor: Portal<DefineComponent< {
84
+ value?: string;
85
+ files?: PlaygroundFiles;
86
+ entry?: string;
87
+ onChange?: (value: string) => void;
88
+ onFilesChange?: EditorFilesChange;
89
+ onActiveChange?: (filename: string) => void;
90
+ getCodeErrors?: () => Array<string | Error>;
91
+ locale?: Language;
92
+ }, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{
93
+ value?: string;
94
+ files?: PlaygroundFiles;
95
+ entry?: string;
96
+ onChange?: (value: string) => void;
97
+ onFilesChange?: EditorFilesChange;
98
+ onActiveChange?: (filename: string) => void;
99
+ getCodeErrors?: () => Array<string | Error>;
100
+ locale?: Language;
101
+ }> & Readonly<{}>, {
102
+ files: PlaygroundFiles;
103
+ entry: string;
104
+ value: string;
105
+ onChange: (value: string) => void;
106
+ onFilesChange: EditorFilesChange;
107
+ onActiveChange: (filename: string) => void;
108
+ getCodeErrors: () => Array<string | Error>;
109
+ }, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>>;
110
+
111
+ export declare type EditorFilesChange = (files: PlaygroundFiles, entry: string, action: EditorFilesChangeAction) => void;
112
+
113
+ export declare type EditorFilesChangeAction = {
114
+ type: 'update';
115
+ filename: string;
116
+ } | {
117
+ type: 'create';
118
+ filename: string;
119
+ } | {
120
+ type: 'rename';
121
+ filename: string;
122
+ previousFilename: string;
123
+ } | {
124
+ type: 'delete';
125
+ filename: string;
126
+ } | {
127
+ type: 'entry';
128
+ filename: string;
129
+ };
130
+
131
+ export declare const getPlaygroundImportMapOverrides: () => {
132
+ [x: string]: string;
133
+ };
134
+
135
+ export declare const getPlaygroundSiteModules: () => {
136
+ [x: string]: string;
137
+ };
138
+
139
+ export declare const getPlaygroundSiteStyles: () => {
140
+ [x: string]: string;
141
+ };
142
+
143
+ export declare const getPlaygroundStyleOverrides: () => {
144
+ [x: string]: string;
145
+ };
146
+
147
+ export declare const highlightCode: (code: string, filename: string) => string;
148
+
149
+ export declare const highlightCodeByLanguage: (code: string, language: string) => string;
150
+
151
+ export declare const isSafePlaygroundHref: (href: string) => boolean;
152
+
153
+ export declare const normalizeCdnURL: (cdnURL?: string) => string;
154
+
155
+ export declare const Playground: typeof __VLS_export_2;
156
+
157
+ export declare type PlaygroundFiles = Record<string, string>;
158
+
159
+ export declare interface PlaygroundFilesProps {
160
+ files: PlaygroundFiles;
161
+ entry: string;
162
+ }
163
+
164
+ export declare type PlaygroundOptions = Omit<Partial<StoreState>, 'builtinImportMap' | 'files' | 'activeFilename' | 'mainFile' | 'template'> & {
165
+ cdnURL?: string;
166
+ builtinImportMap?: ImportMap;
167
+ };
168
+
169
+ export declare type PlaygroundPreviewOptions = SandboxProps['previewOptions'];
170
+
171
+ export declare type PlaygroundView = 'runtime' | 'files';
172
+
173
+ export declare type PlaygroundViewport = 'auto' | number | [width: number, height: number];
174
+
175
+ export declare interface PlaygroundViewsProps {
176
+ views: PlaygroundView[];
177
+ activeView: PlaygroundView;
178
+ }
179
+
180
+ export declare const registerVueHighlight: (api?: HLJSApi) => HLJSApi;
181
+
182
+ export declare const removePlaygroundImportMapOverride: (alias: string) => {
183
+ [x: string]: string;
184
+ };
185
+
186
+ export declare const removePlaygroundStyleOverride: (alias: string) => {
187
+ [x: string]: string;
188
+ };
189
+
190
+ export declare const resolveHighlightLanguage: (filename: string) => "xml" | "javascript" | "typescript" | "css" | "scss" | "vue" | "json" | "plaintext";
191
+
192
+ export declare const setPlaygroundImportMapOverrides: (value?: Record<string, string>) => void;
193
+
194
+ export declare const setPlaygroundSiteModules: (value?: Record<string, string>) => void;
195
+
196
+ export declare const setPlaygroundSiteStyles: (value?: Record<string, string>) => void;
197
+
198
+ export declare const setPlaygroundStyleOverrides: (value?: Record<string, string>) => void;
199
+
200
+ export declare const vueHighlight: LanguageFn;
201
+
202
+ export { }