์ธํฐํ์ด์ค ์๊ธฐ, ์คํ ๊ตฌ๋ฌธ, ๋์ผํ ์ ํ์ ์ธํฐํ์ด์ค, ๋์ผํ ์ ํ์ ์ ํ
๋์ผํ ์ ํ์ ๋ชจ๋ ํค๊ฐ์๋ ์ธํฐํ์ด์ค / ์ ํ์ ์์ฑํ๊ธฐ ์ํด ์๊ธฐ๋ฅผ ์ถ๊ฐ ํ ์ ์์ต๋๋ค.
์ค ์๋ฅผ ์ค์ด๊ณ ๊ฐ๋
์ฑ์๋ ๋์์ด๋ฉ๋๋ค.
export interface AllStrings {
prop1: string;
prop2: string;
}
๊ฐ์ ๊ฒ์
export interface AllStrings<type: string> {
prop1,prop2;
}
๋ด ์ ์์ ๋ค์ ์ง์นจ์ ์ถฉ์กฑํฉ๋๋ค.
๋ ์ด๋:
type AllStrings = Record<"prop1" | "prop2", string>
๊ฐ์ฅ ์ ์ฉํ ๋๊ธ
๋ ์ด๋: