Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript override interface property

type Modify<T, R> = Omit<T, keyof R> & R;

interface OriginalInterface {
  a: string;
  b: boolean;
  c: number;
}

type ModifiedType  = Modify<OriginalInterface , {
  a: number;
  b: number;
}>

// ModifiedType = { a: number; b: number; c: number; }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #typescript #override #interface #property
ADD COMMENT
Topic
Name
8+3 =