I would like to extract and use "body" from "sampleType" below.
export type NOT_CONTENT = "";
export type sampleType =
| {
id: number;
friends: {
id: number;
icon: string;
birthday: string;
gender: string;
created_at: string;
updated_at: string;
};
message: {
body:
| {
type: "text";
text_message: {
text: string;
};
}
| {
type: "action";
action_message: {
text: string;
};
}
| {
type: "";
};
id: number;
};
unread_status: boolean;
}
| NOT_CONTENT;
I tried the pick below, but it doesn't work.
Pick<sampleType, "body">
What methods are there? Please teach me..