TypeScript의 다른 여러 인터페이스에서 인터페이스를 상속 할 수 있습니까?

에밀 칸 테로

안녕하세요 각도 커뮤니티,

세 개의 인터페이스를 다른 인터페이스 안에 중첩시킬 수 있습니까? 내 코드가 내 문장보다 더 설명 할 것이라고 생각하십시오. IAdmin2 인터페이스의 일부가되도록 IProject1 & IProject2 & IProject3 인터페이스를 구현하려고합니다.

미리 감사드립니다

 import {IBusiness} from "./business";
 import {ITechnology} from "./technology";
 export interface IAdmin2 {
     id: number;
     business_id: number;
     technology_ids: number[];
     trigram: string;
     position: string;
     years_experience: number;
     notification: boolean;
     availability: any;
     form_admin2_file: File;
     business: IBusiness;
     technologies: ITechnology[];
     admin2Translations: any;
     translations: any;
    delete: any;
    data: any;
  ** Include interface Iproject1**
  ** Include interface Iproject2**
  ** Include interface Iproject3**
 }


 import {ITechnology} from "./technology";
 import {IProjectFile} from "./project-file";
 export interface IProject1 {
     id: number;
    name: string;
    start_date: any;
    technologies: ITechnology[];
    description: string;
    sector_id: number;
    end_date: any;
    team_size: number;
}

 import {ITechnology} from "./technology";
 import {IProjectFile} from "./project-file";
 export interface IProject2 {
     id: number;
    name: string;
    start_date: any;
    technologies: ITechnology[];
    description: string;
    sector_id: number;
    end_date: any;
    team_size: number;
}

 import {ITechnology} from "./technology";
 import {IProjectFile} from "./project-file";
 export interface IProject3 {
     id: number;
    name: string;
    start_date: any;
    technologies: ITechnology[];
    description: string;
    sector_id: number;
    end_date: any;
    team_size: number;
}

TypeScript에서는 하나 이상의 기본 인터페이스에서 인터페이스를 상속 할 수 있습니다.

interface IProject1 {
}

interface IProject2 {
}

interface IProject3 {
}

interface IAdmin2 extends IProject1, IProject2, IProject3 {
}

결과적으로의 IAdmin2구현도 IProject1, IProject2을 구현해야합니다 IProject3. 인터페이스의 공식 문서를 확인할 수도 있습니다 .

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

다른 속성 (TypeScript)의 값에 따라 인터페이스 속성의 선택 여부를 변경할 수있는 방법이 있습니까?

TypeScript 인덱스 서명을 사용하여 다른 인터페이스를 지정할 수 있습니까?

Java에서 다중 상속이없는 이유는 있지만 여러 인터페이스를 구현할 수 있습니까?

GraphQL을 사용하여 다른 인터페이스에 인터페이스를 구현할 수 있습니까?

인터페이스를 사용하여 다른 프로젝트의 ViewModel간에 이동할 수 있습니까?

TypeScript 인터페이스에서 한 속성의 키를 다른 속성의 값으로 제한 할 수 있습니까?

TypeScript 인터페이스를 상속받은 인터페이스로 식별할 수 있습니까?

인터페이스에서 상속 된 메서드가 인터페이스에있는 다른 유형을 반환 할 수 있습니까?

TypeScript 인터페이스를 다른 인터페이스로 확산 할 수 있습니까?

GraphQL 입력 유형이 다른 유형 또는 인터페이스에서 상속 할 수 있습니까?

typescript에서 반응 상태 속성에 대한 인터페이스를 구현할 수 있습니까?

클래스가 하나의 속성으로 인터페이스를 구현하는 방법은 다른 인터페이스도 구현할 수 있습니까?

인터페이스가 Java에서 여러 인터페이스를 확장 할 수 있습니까?

Visual Studio 코드 맵에서 두 인터페이스의 상속 관계를 표시 할 수 있습니까?

다른 인터페이스에서 인터페이스를 동적으로 생성할 수 있습니까?

여러 가상 인터페이스를 통해 여러 WiFi 네트워크에 연결할 수 없습니다.

다른 패키지의 Java 인터페이스를 내 코드에서 리팩토링 할 수 있습니까?

다른 .d.ts 파일에서 내 보낸 유형을 사용하여 typescript 인터페이스를 어떻게 보강 할 수 있습니까?

UITabBarController의 이상한 인터페이스 버그 UIScrollView. 다른 사람이 재현 할 수 있습니까?

Typescript는 일반 인터페이스 속성에서 올바른 유형을 추론 할 수 없습니다.

C ++의 인터페이스에서 상속 할 수있는 이유

각도 / 타입 스크립트에서 다른 함수를 사용하여 인터페이스 속성에 값을 할당 하시겠습니까?

웹팩 로더를 사용하여 파일에서 Typescript 인터페이스를 생성 할 수 있습니까?

연결된 인터페이스로 서로 연결된 2 개의 라우터가 다른 네트워크에 속할 수 있습니까?

다른 인터페이스를 구현하는 구성 요소에 대한 인터페이스의 필드를 입력할 수 있습니까?

인터페이스 내에서 인터페이스를 정의 할 수 있습니까?

인터페이스 [Golang]에서 여러 인수를 전달할 수 있는 방법이 있습니까?

상속 체인에서 해당 인터페이스를 여러 번 구현하면서 어떻게 인터페이스를 명시적으로 구현할 수 있습니까?

람다는 대상 기능 인터페이스의 멤버에 액세스 할 수 있습니까?

TOP 리스트

뜨겁다태그

보관