Skip to content

Commit 4666fec

Browse files
committed
Add tests for string intersection type handling and fix tsconfig
1 parent 3d00ef8 commit 4666fec

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0
3+
import * as React from 'react';
4+
5+
export namespace CodeEditorProps {
6+
// This simulates the pattern used in the code editor where we want:
7+
// 1. Autocomplete for known language literals
8+
// 2. Allow custom string values
9+
export type Language = 'javascript' | 'html' | 'ruby' | 'python' | 'java' | (string & { _?: undefined });
10+
}
11+
12+
export interface CodeEditorProps {
13+
/**
14+
* Specifies the programming language.
15+
*/
16+
language: CodeEditorProps.Language;
17+
}
18+
19+
export default function CodeEditor({ language }: CodeEditorProps) {
20+
return <div data-language={language}>Code Editor</div>;
21+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"include": ["./**/*.tsx"]
4+
}

0 commit comments

Comments
 (0)