@cas-smartdesign/element-preview 0.2.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,29 @@
1
+ export type SourceBase = {
2
+ content: string;
3
+ };
4
+ export type Source = SourceBase & {
5
+ type: "source";
6
+ label: string;
7
+ language: "html" | "typescript" | "css" | "raw";
8
+ };
9
+ export type CssSource = SourceBase & {
10
+ type: "css";
11
+ label?: string;
12
+ };
13
+ export type TypeScriptSource = SourceBase & {
14
+ type: "typescript";
15
+ label?: string;
16
+ initialize?: (preview: HTMLElement) => void;
17
+ };
18
+ export type ExampleDescription = {
19
+ mainContent: string;
20
+ css?: string | CssSource;
21
+ initializer?: TypeScriptSource;
22
+ description?: string;
23
+ additionalSources?: Source[];
24
+ };
25
+ export declare function initialize(root: HTMLElement, sources: ExampleDescription, index: number): Promise<void>;
26
+ export declare function loadPrefixedStylesheet(prefix: string, css: string): void;
27
+ export declare function initializeExamplesForModules(modules: Record<string, {
28
+ default: ExampleDescription;
29
+ }>, root?: HTMLElement): Promise<void>;