Answers for "typescript pick type from interface"

3

typescript type interface

//INTERFACE	                                TYPE
interface Animal {	                        type Animal = {
    name: string;	                            name: string;
}	                                        }
interface Bear extends Animal {	            type Bear = Animal & { 
    honey: boolean;	                            honey: Boolean;
}	                                        }

const bear = getBear();	                    const bear = getBear();
bear.name;	                                bear.name;
bear.honey;	                                bear.honey;
Posted by: Guest on April-24-2021
0

typescript pick type from interface

interface Todo {  title: string;  description: string;  completed: boolean;}
type TodoPreview = Pick<Todo, "title" | "completed">;
const todo: TodoPreview = {  title: "Clean room",  completed: false,};
todo; const todo: TodoPreviewTry
Posted by: Guest on May-19-2021

Code answers related to "typescript pick type from interface"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language