-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinterfaces.ts
More file actions
45 lines (38 loc) · 1.11 KB
/
interfaces.ts
File metadata and controls
45 lines (38 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
export interface CodeViewProps {
/**
* Adds an `aria-label` to the component. Use this label when there is not enough context around the code snippet to describe its purpose or content.
*/
ariaLabel?: string;
/**
* Adds `aria-labelledby` to the component. Use this property to reference the ID of an existing element that provides a descriptive label for the code snippet.
*/
ariaLabelledby?: string;
/**
* The code content to be displayed.
*/
content: string;
/**
* Controls the display of line numbers.
*
* Defaults to `false`.
*/
lineNumbers?: boolean;
/**
* Controls lines wrap when overflowing on the right side.
*
* Defaults to `false`.
*/
lineWrapping?: boolean;
/**
* An optional slot to display a button to enable users to perform actions, such as copy or download the code snippet.
*
*/
actions?: React.ReactNode;
/**
* A function to perform custom syntax highlighting.
*
*/
highlight?: (code: string) => React.ReactNode;
}