๐ ๋ฆฌํฉํ ๋ง ์ค๋ช
export interface PageProperties {
role?: {
id: string;
type: "multi_select";
multi_select: MultiSelectOption[];
};
exposure?: {
id: string;
type: "checkbox";
checkbox: boolean;
};
writer?: {
id: string;
type: "select";
select: SelectOption | null;
};
status?: {
id: string;
type: "status";
status: SelectOption | null;
};
views?: {
id: string;
type: "number";
number: number | null;
};
name?: {
id: string;
type: "title";
title: { type: "text"; text: { content: string; link: null } }[];
};
}
Noition์์ ๋ฐ์์ค๋ ๋ฐ์ดํฐ๋ฅผ ํ๋ก์ ํธ ๋ด type์ ์ ์ํ๊ณ ์ฌ์ฉํ ์ ์๊ฒ ๋ง๋ค์ด๋ interface ์
๋๋ค.
์ interface์์ ๊ฐ ํค๋ฅผ undefined๊ฐ ๊ฐ๋ฅํ๊ฒ ์ค์ ํด๋์๋๋ฐ ์ค์ ๋ก ์ฌ์ฉํ๊ธฐ์ ์ด๋ ค์์ด ์์ด,
(property) properties: Record<string, DatabasePropertyConfigResponse> ์ด ํ์
์ ํ์ฅ ๊ฐ๋ฅํ๊ฒ ์ฌ์ฉํ๋ ค๋ฉด ์ด๋ป๊ฒ ํด๋ฉด ์ข์์ง์ ๋ํด ์ด์ ๋จ๊น๋๋ค.
โ
TODO
๐ ETC
๐ ๋ฆฌํฉํ ๋ง ์ค๋ช
Noition์์ ๋ฐ์์ค๋ ๋ฐ์ดํฐ๋ฅผ ํ๋ก์ ํธ ๋ด type์ ์ ์ํ๊ณ ์ฌ์ฉํ ์ ์๊ฒ ๋ง๋ค์ด๋ interface ์ ๋๋ค.
์ interface์์ ๊ฐ ํค๋ฅผ undefined๊ฐ ๊ฐ๋ฅํ๊ฒ ์ค์ ํด๋์๋๋ฐ ์ค์ ๋ก ์ฌ์ฉํ๊ธฐ์ ์ด๋ ค์์ด ์์ด,
(property) properties: Record<string, DatabasePropertyConfigResponse> ์ด ํ์ ์ ํ์ฅ ๊ฐ๋ฅํ๊ฒ ์ฌ์ฉํ๋ ค๋ฉด ์ด๋ป๊ฒ ํด๋ฉด ์ข์์ง์ ๋ํด ์ด์ ๋จ๊น๋๋ค.
โ TODO
๐ ETC