2024-07-23 16:50:12 +00:00
|
|
|
/*!
|
|
|
|
|
* @license
|
|
|
|
|
* Copyright Google LLC All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
|
|
|
* found in the LICENSE file at https://angular.dev/license
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import {Type} from '@angular/core';
|
2025-08-15 13:07:02 +00:00
|
|
|
import {SafeHtml} from '@angular/platform-browser';
|
2024-07-23 16:50:12 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Map of the examples, values are functions which returns the promise of the component type, which will be displayed as preview in the ExampleViewer component
|
|
|
|
|
*/
|
|
|
|
|
export interface CodeExamplesMap {
|
|
|
|
|
[id: string]: () => Promise<Type<unknown>>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Snippet {
|
|
|
|
|
/** Title of the code snippet */
|
|
|
|
|
title?: string;
|
|
|
|
|
/** Name of the file. */
|
|
|
|
|
name: string;
|
|
|
|
|
/** Content of code snippet */
|
2025-08-15 13:07:02 +00:00
|
|
|
sanitizedContent: SafeHtml;
|
2024-07-23 16:50:12 +00:00
|
|
|
/** Text in following format `start-end`. Start and end are numbers, based on them provided range of lines will be displayed in collapsed mode */
|
|
|
|
|
visibleLinesRange?: string;
|
2025-10-26 08:47:42 +00:00
|
|
|
|
|
|
|
|
shell?: boolean;
|
2024-07-23 16:50:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ExampleMetadata {
|
|
|
|
|
/** Numeric id of example, used to generate unique link to the example */
|
|
|
|
|
id: number;
|
|
|
|
|
/** Title of the example. */
|
|
|
|
|
title?: string;
|
|
|
|
|
/** Path to the preview component */
|
|
|
|
|
path?: string;
|
|
|
|
|
/** List of files which are part of the example. */
|
|
|
|
|
files: Snippet[];
|
|
|
|
|
/** True when ExampleViewer should have preview */
|
|
|
|
|
preview: boolean;
|
2025-09-03 00:36:17 +00:00
|
|
|
/** Whether to hide code example by default. */
|
|
|
|
|
hideCode: boolean;
|
2024-07-23 16:50:12 +00:00
|
|
|
}
|