• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022-2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16
17export type Class1<T> = {
18    new(...args: Object[]): T;
19}
20
21export type Nullable<T> = {
22    [K in keyof T]: T[K] | null;
23};
24
25export type Person = {
26    name: string;
27    age: number;
28    address: string;
29};
30
31export type ReadonlyPerson = {
32    readonly [K in keyof Person]: Person[K];
33};
34
35export type ArrayElementMap<T extends any[], U> = {
36    [K in keyof T]: U;
37};
38export type NumberArray = [1, 2, 3];
39export type StringArray = ArrayElementMap<NumberArray, string>;
40export type Book = {
41    title: string;
42    author: string;
43    year: number;
44    price: number;
45};
46export type SelectedKeys = 'title' | 'author';
47export type PartialBook = {
48    [K in SelectedKeys]: Book[K];
49};
50
51export class Class2<T> {
52    a : Person;
53}
54
55export type a = Person;