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 16export type A = string & number; 17 18export interface Person { 19 name: string; 20 age: number; 21} 22 23export interface Employee { 24 employeeId: string; 25 department: string; 26} 27 28export type PersonEmployee = Person & Employee; 29 30class Logger { 31 log(message: string) { 32 console.log(message); 33 } 34 } 35 36class Validator { 37 validate(data: any) { 38 return typeof data === 'number'; 39 } 40} 41 42export type LoggerValidator = Logger & Validator; 43 44type Status = 'active' | 'inactive'; 45type User = { 46 id: number; 47 name: string; 48}; 49 50export type ActiveUser = User & { status: 'active' }; 51