Thuta Learning
TypeScript
AdvancedProgrammingအလယ်အလတ်

Generics

TypeScriptသင်ခန်းစာ 1930 မိနစ်

ဒီခန်းပြီးရင် ဘာတတ်သွားမလဲ

  • <T> လို type parameter ကို ကြေညာပြီး argument တွေကနေ TypeScript ကို infer လုပ်ခိုင်းနိုင်ဖို့
  • any က ဖျက်ပစ်လိုက်တဲ့ type information ကို generic က ဘာကြောင့် ထိန်းထားနိုင်လဲ ရှင်းပြနိုင်ဖို့
  • K extends keyof T အပါအဝင် extends နဲ့ type parameter ကို ကန့်သတ်နိုင်ဖို့
  • Generic မလိုအပ်တဲ့နေရာမှာ ရိုးရိုး type က ပိုရှင်းတယ်ဆိုတာ သိမြင်နိုင်ဖို့

ရိုးရိုးလေး ရှင်းပြမယ်

Generics ကို ရိုးရိုးလေး ပြောရရင်

Generic ဆိုတာ ကွက်လပ်တစ်ခု ပါနေတဲ့ function ဒါမှမဟုတ် type တစ်ခုပါ။ Number အတွက် version တစ်ခု၊ string အတွက် version နောက်တစ်ခု ခွဲရေးမယ့်အစား placeholder တစ်ခု (များသောအားဖြင့် T လို့ ခေါ်ပါတယ်) ပါတဲ့ version တစ်ခုတည်း ရေးလိုက်ပြီး ခေါ်သုံးတဲ့သူရဲ့ value တွေက အဲဒီ ကွက်လပ်ကို ဖြည့်ပေးပါတယ်။ Placeholder က value မဟုတ်ဘဲ type ဖြစ်တဲ့အတွက် code run တဲ့အချိန်မှာ ပျောက်သွားပါတယ်။

Label ကပ်ထားတဲ့ သေတ္တာတစ်လုံးကို စဉ်းစားကြည့်ရအောင်။ 'ဘာထည့်ထည့် ရတယ်' လို့ ရေးထားတဲ့ သေတ္တာက အသုံးမဝင်ပါဘူး၊ ဖွင့်လိုက်တဲ့အခါ အထဲမှာ ဘာရှိလဲ မသိရလို့ပါ။ Generic သေတ္တာကတော့ 'သင်ထည့်တဲ့ အမျိုးအစားအတိုင်း ပြန်ရမယ်' လို့ ကတိပေးထားပါတယ်၊ ဒါကြောင့် စာအုပ်ထည့်ခဲ့ရင် စာအုပ်ပဲ ပြန်ရပါတယ်။ အဲဒီ 'အမျိုးအစား တူတူ' ဆိုတဲ့ ကတိက generics ရဲ့ အဓိက ရည်ရွယ်ချက်ပါပဲ။

Problem → Why → Solution

ပြဿနာ: helper တစ်ခု၊ type အများကြီး

List တစ်ခုရဲ့ ပထမဆုံး item ကို ပြန်ပေးတဲ့ helper တစ်ခု လိုလာတယ် ဆိုပါစို့။ Number အတွက် ရေးပြီးသွားတော့ profile page က string အတွက် လိုလာပြန်တယ်၊ order page ကတော့ Order object တွေအတွက် လိုလာပြန်တယ်။ Function ကို သုံးခါ copy ကူးရတာ ပင်ပန်းလို့ any ကို ကောက်သုံးလိုက်ပါတယ်။ Code က compile ဖြစ်ပါတယ်၊ ဒါပေမဲ့ ခေါ်သူတိုင်း any ပဲ ပြန်ရပါတော့တယ် — property နာမည် စာလုံးပေါင်းမှားလည်း၊ မရှိတဲ့ method ကို ခေါ်လည်း app crash ဖြစ်တဲ့အထိ compiler က ဘာမှ မပြောပါဘူး။

first-item-any.ts
function firstItem(items: any[]): any {
  return items[0];
}

const price = firstItem([9.99, 4.5]);
console.log(price.toUpperCase()); // compiles, then crashes at runtime

const name = firstItem(["Ada", "Linus"]);
console.log(name.lenght); // typo compiles too and prints undefined

any က ဘာကြောင့် အဖြေ မဟုတ်တာလဲ

any ဆိုတာ 'ငါ မှတ်ထားမယ့် ဘယ် type မဆို' လို့ အဓိပ္ပာယ် မရပါဘူး၊ 'စစ်ဆေးတာ ရပ်လိုက်' လို့ပဲ အဓိပ္ပာယ်ရပါတယ်။ Function က သူ့ input ဟာ number array ဖြစ်တယ်ဆိုတာ သိပါတယ်၊ ဒါပေမဲ့ return လုပ်တဲ့နေရာမှာ အဲဒီ အသိကို လွှင့်ပစ်လိုက်ပါတယ်။ Generic ကတော့ အဲဒီ အသိကို ထိန်းထားပေးပါတယ် — return type ကို argument ရဲ့ element type နဲ့ ချိတ်ထားတဲ့အတွက် number array ထည့်ရင် number ပြန်ရပြီး အပေါ်က bug နှစ်ခုလုံးကို compiler က ဖမ်းပေးနိုင်ပါတယ်။

Core concept: type parameter က type ကို သယ်ဆောင်ပေးတယ်

Type parameter ကို function နာမည်ရဲ့ နောက်မှာ angle bracket နဲ့ ကြေညာပါတယ်: function firstItem<T>(items: T[]): T | undefined။ ဒါကို 'type T တစ်ခုခုအတွက် ဒီ function က T array ကို လက်ခံပြီး T ဒါမှမဟုတ် undefined ကို ပြန်ပေးတယ်' လို့ ဖတ်ပါ။ T ဆိုတာ type တွေအတွက် variable တစ်ခုပါ။ ခေါ်တိုင်း concrete T တစ်ခုကို ရွေးပြီး signature ထဲမှာ T ပေါ်တဲ့ နေရာတိုင်းကို အဲဒီ type တူတူနဲ့ အစားထိုးပါတယ်။

များသောအားဖြင့် type ကို ကိုယ်တိုင် ရေးစရာ မလိုပါဘူး။ firstItem([1, 2, 3]) လို့ ခေါ်လိုက်ရင် TypeScript က number[] ကို မြင်ပြီး T = number လို့ infer လုပ်တဲ့အတွက် ရလဒ်က number | undefined ဖြစ်ပါတယ်။ Array အလွတ်လို infer လုပ်စရာ ဘာမှ မရှိတဲ့အခါ firstItem<string>([]) လို type ကို တိုက်ရိုက် ပေးလို့ ရပါတယ်။ Return type ထဲက | undefined က ရိုးသားပါတယ် — array အလွတ်မှာ ပထမ element မရှိပါဘူး၊ index access က အဲဒါကို သင့်ကိုယ်စား မစစ်ပေးပါဘူး။

Constraint မရှိတဲ့ T က ဘာမဆို ဖြစ်နိုင်တဲ့အတွက် function ထဲမှာ type အားလုံးအတွက် အလုပ်လုပ်တဲ့ အရာတွေကိုပဲ လုပ်ခွင့်ရပါတယ်။ Property တစ်ခုကို သုံးချင်ရင် extends နဲ့ constraint ထည့်ပါ: <T extends { length: number }> ဆိုတာ 'number length ရှိသရွေ့ ဘယ် T မဆို' လို့ အဓိပ္ပာယ်ရပါတယ်။ String, array နဲ့ သင့်ကိုယ်ပိုင် object တွေ ကိုက်ညီပေမဲ့ number မကိုက်ညီပါဘူး။ အသုံးအဝင်ဆုံး constraint က parameter နှစ်ခုကို တွဲပေးတာပါ: <T, K extends keyof T> က K ဟာ T ရဲ့ key တစ်ခု ဖြစ်ရမယ်လို့ ပြောပြီး return type T[K] က အဲဒီ property ရဲ့ type အတိအကျ ဖြစ်ပါတယ်။

Declarationအဓိပ္ပာယ်
<T>ဘယ် type မဆို၊ type အားလုံးမှာ မှန်တဲ့ operation တွေပဲ လုပ်ခွင့်ရှိ
<T extends { id: string }>string id ပါတဲ့ ဘယ် type မဆို
<T, K extends keyof T>K က T ရဲ့ key ဖြစ်ရမယ်၊ T[K] က အဲဒီ value ရဲ့ type
<T = string>T ကို မပေးထား၊ infer လည်း မလုပ်နိုင်တဲ့အခါ သုံးမယ့် default

Generics က function တွေအတွက်ချည်း မဟုတ်ပါဘူး။ Type, interface နဲ့ class တွေလည်း parameter ယူနိုင်ပါတယ်: Array<T>, Promise<T>, Map<K, V> တို့ဟာ standard library ထဲက generic type တွေ ဖြစ်ပြီး type ApiResponse<T> = { data: T; error: string | null } လို ရေးလိုက်ရင် endpoint တိုင်းက shape တစ်ခုတည်းကို မျှသုံးနိုင်ပါတယ်။ Type အားလုံးလိုပဲ T ကလည်း compile time မှာ ဖျက်ခံရတဲ့အတွက် function ထဲမှာ typeof T ဒါမှမဟုတ် new T() လို့ ရေးလို့ မရပါဘူး။

Generic ကို ကွက်လပ်ဖြည့် contract လို မြင်ကြည့်ပါ
  1. ကွက်လပ် ကြေညာ: <T>
  2. T ကို parameter နဲ့ return မှာ သုံး
  3. ခေါ်သူရဲ့ argument က T ကို ဖြည့်
  4. T တိုင်း အဲဒီ type တူတူ ဖြစ်သွား

Signature ထဲမှာ T က တစ်ကြိမ်တည်းပဲ ပေါ်ရင် ဘာကိုမှ ချိတ်မပေးပါဘူး၊ ရိုးရိုး type (ဒါမှမဟုတ် unknown) က ပိုရှင်းလေ့ရှိပါတယ်။

အထွေထွေ ပုံစံ

typescript
function name<T>(param: T[]): T | undefined { ... }

function name<T extends Shape>(param: T): T { ... }

function name<T, K extends keyof T>(obj: T, key: K): T[K] { ... }

type Wrapper<T> = { value: T };

Type parameter တွေကို angle bracket ထဲမှာ ကြေညာပြီး parameter နဲ့ return type မှာ သုံးပါ။ Function body က T ရဲ့ property တစ်ခုခုကို အားကိုးဖို့ လိုတဲ့အခါမှ extends ကို ထည့်ပါ။

Worked example: array type တိုင်းအတွက် helper တစ်ခု

အောက်က function ကို တစ်ကြိမ်တည်း ရေးထားပြီး element type မတူတဲ့ သုံးမျိုးနဲ့ ခေါ်ထားပါတယ်။ Comment တွေကို သတိထားကြည့်ပါ — ခေါ်တိုင်း TypeScript က T ကို ဘာလို့ infer လုပ်လဲ ပြထားပါတယ်။ နောက်ဆုံး line က ရလဒ်ဟာ တကယ်ပဲ number ဖြစ်ကြောင်း သက်သေပြပါတယ်၊ optional chaining နဲ့ စစ်ပြီးနောက် number method ကို ခေါ်ခွင့်ရလို့ပါ။

generics.ts
function getFirstElement<T>(arr: T[]): T | undefined {
  return arr[0];
}

const firstNumber = getFirstElement([1, 2, 3]); // T = number
const firstString = getFirstElement(["a", "b", "c"]); // T = string
const fromEmpty = getFirstElement<boolean>([]); // T = boolean (explicit)

console.log(firstNumber, firstString, fromEmpty);
console.log(firstNumber?.toFixed(1));

Code ကို တစ်ပိုင်းချင်း ရှင်းပြမယ်

  1. Declare Tfunction getFirstElement<T>(arr: T[]): T | undefined {

    <T> က type parameter ကို မိတ်ဆက်ပေးပါတယ်။ Parameter က T array ဖြစ်ပြီး ရလဒ်က T ဒါမှမဟုတ် undefined ဖြစ်တဲ့အတွက် input နဲ့ output ချိတ်ဆက်သွားပါတယ်။

  2. Infer from a valueconst firstNumber = getFirstElement([1, 2, 3]); // T = number

    TypeScript က number[] ကို မြင်ပြီး T ကို number နဲ့ ဖြည့်ပါတယ်။ ခေါ်တဲ့နေရာမှာ angle bracket ရေးစရာ မလိုပါဘူး။

  3. Explicit type argumentconst fromEmpty = getFirstElement<boolean>([]); // T = boolean (explicit)

    Array အလွတ်က TypeScript ကို infer လုပ်စရာ ဘာမှ မပေးတဲ့အတွက် boolean ကို တိုက်ရိုက် ပေးထားပါတယ်။ Runtime မှာ undefined ပြန်လာပြီး အဲဒါကို return type က ကြိုသတိပေးထားပြီးသားပါ။

  4. Use the typed resultconsole.log(firstNumber?.toFixed(1));

    ရလဒ်က number | undefined ဖြစ်လို့ toFixed ကို မခေါ်ခင် ?. လိုပါတယ်။ any နဲ့ဆိုရင် သတိပေးချက် တစ်ခုမှ မရပါဘူး၊ ဒီမှာတော့ ဘယ် method တွေ ရှိလဲဆိုတာ compiler က အတိအကျ သိပါတယ်။

You should see
1 a undefined
1.0

Constraint: T ဆီက အနည်းဆုံး shape ကို တောင်းခြင်း

Function body က T အကြောင်း တစ်ခုခုကို သိဖို့ လိုလာတဲ့အခါ constraint ထည့်ရပါတယ်။ အောက်က longest က length ကို နှိုင်းယှဉ်ဖို့ လိုပြီး getProperty ကတော့ key ကို object ရဲ့ တကယ်ရှိတဲ့ property နာမည်တွေထဲကပဲ လက်ခံချင်ပါတယ်။

constraints.ts
function longest<T extends { length: number }>(a: T, b: T): T {
  return a.length >= b.length ? a : b;
}

function getProperty<T, K extends keyof T>(obj: T, key: K): T[K] {
  return obj[key];
}

const user = { id: 7, name: "Ada" };
const id = getProperty(user, "id"); // number
const name = getProperty(user, "name"); // string

console.log(longest([1, 2], [3]), longest("TypeScript", "Go"), id, name);
// getProperty(user, "email"); // error: "email" is not a key of user
// longest(10, 20); // error: number has no length property

Constraint ကို ခေါ်တဲ့နေရာမှာ စစ်ပါတယ်။ Number တွေမှာ length မရှိလို့ longest(10, 20) က fail ဖြစ်ပြီး "email" က keyof typeof user ထဲမှာ မပါလို့ getProperty(user, "email") က fail ဖြစ်ပါတယ်။ Function ထဲမှာတော့ a.length ကို ရေးခွင့်ရစေတာ constraint ပါပဲ၊ constraint မရှိရင် T က number ဖြစ်နိုင်တဲ့အတွက် compiler က property access ကို ငြင်းပါလိမ့်မယ်။

လက်တွေ့ project တွေမှာ

လက်တွေ့ project တွေမှာ generics ကို ဘယ်မှာ တွေ့ရလဲ

ကိုယ်တိုင် တစ်ခုမှ မရေးရသေးခင်ကတည်းက generics ကို နေ့တိုင်း သုံးနေပြီးသားပါ။ Promise<User> က async function တစ်ခု ပြန်ပေးတဲ့ type ဖြစ်ပြီး Array<T> နဲ့ Map<K, V> တို့က generic collection တွေ၊ React ရဲ့ useState<T> ကလည်း state ကို type ပါအောင် ထိန်းပေးပါတယ်။ ကိုယ်ပိုင် generic ရေးတာက application ရဲ့ ဆက်စပ်နေရာတွေမှာ အကျိုးရှိပါတယ် — logic တစ်ခုတည်းက data shape အများကြီးကို ကိုင်တွယ်ရတဲ့ နေရာတွေပါ။

  • API response wrapper: type ApiResponse<T> = { data: T; error: string | null } က endpoint တိုင်းကို envelope တစ်မျိုးတည်း ပေးပြီး payload တစ်ခုချင်းစီရဲ့ type ကိုလည်း ထိန်းထားပေးပါတယ်။ JSON ကို runtime မှာ စစ်တာကတော့ သီးခြား အလုပ်ပါ (lesson 22)။
  • Repository နဲ့ cache: class Repository<T extends { id: string }> တစ်ခုက user, order, product တွေကို implementation တစ်ခုတည်းနဲ့ သိမ်း၊ ရှာ၊ ဖျက်နိုင်ပြီး constraint က item တိုင်းမှာ ရှာဖို့ id ရှိကြောင်း အာမခံပေးပါတယ်။
  • groupBy, uniqueBy, pick လို utility function တွေကို type parameter နဲ့ တစ်ကြိမ်ရေးပြီး codebase တစ်ခုလုံးမှာ ပြန်သုံးလို့ ရပါတယ်၊ ကိုင်တွယ်တဲ့ item တွေရဲ့ type လည်း မပျောက်ပါဘူး။

အမှားများ

Generics နဲ့ ဖြစ်လေ့ရှိတဲ့ အမှားများ

Generic ဖြစ်သင့်တဲ့နေရာမှာ any ဒါမှမဟုတ် unknown[] သုံးခြင်း

function first(items: unknown[]): unknown က type-safe ဖြစ်ပေမဲ့ အသုံးမဝင်ပါဘူး — ခေါ်သူက ရလဒ်ကို cast လုပ်ရပါတယ်။ Output က input နဲ့ type တူရမယ်ဆိုရင် အဲဒီ ဆက်သွယ်ချက်အတွက် type parameter လိုပါတယ်။

ဘာကိုမှ မချိတ်တဲ့ type parameter ထည့်ခြင်း

function log<T>(value: T): void က T ကို တစ်ကြိမ်ပဲ သုံးတဲ့အတွက် (value: unknown) နဲ့ အတူတူပါပဲ။ parse<T>(json: string): T လို return မှာပဲ ပါတဲ့ generic က ပိုဆိုးပါတယ် — လုံခြုံပုံပေါ်ပေမဲ့ တကယ်တော့ ဖုံးထားတဲ့ type assertion ပါ၊ JSON က T ဖြစ်မဖြစ် ဘယ်သူမှ မစစ်ပါဘူး။

Constraint မေ့ပြီး cast နဲ့ ဖာထေးခြင်း

Body က Property 'length' does not exist on type 'T' လို့ ပြောတဲ့အခါ အဖြေက <T extends { length: number }> ပါ၊ (a as any).length မဟုတ်ပါဘူး။ Constraint က လိုအပ်ချက်ကို မှတ်တမ်းတင်ပေးပြီး ခေါ်သူတွေကိုလည်း မှန်ကန်တဲ့ value ပဲ ပေးအောင် တွန်းအားပေးပါတယ်။

Best Practices

Best practices

  • Inference ကို အလုပ်လုပ်ခိုင်းပါ၊ infer လုပ်စရာ မရှိတဲ့အခါမှ type argument ကို တိုက်ရိုက် ရေးပါ။
  • Parameter အများကြီး ရှိရင် အခန်းကဏ္ဍအလိုက် နာမည်ပေးပါ: TItem, TKey, TResult တို့က T, U, V ထက် ဖတ်ရ ပိုလွယ်ပါတယ်။
  • Function ကို ပြန်သုံးလို့ရနေအောင် body က တကယ်လိုတဲ့ အပေါ့ဆုံး constraint ကိုပဲ သုံးပါ။
  • Type parameter က တစ်ကြိမ်ပဲ ပေါ်မယ်ဆိုရင် ရိုးရိုး parameter type ကို ရွေးပါ။

Mini challenge

Mini challenge: pluck နဲ့ findById

Record list တစ်ခုအတွက် generic helper လေး နှစ်ခု ရေးပါ။ pluck က array နဲ့ key တစ်ခုကို ယူပြီး အဲဒီ key ရဲ့ value တွေကို type အတိအကျနဲ့ ပြန်ပေးပါတယ်။ findById က id နဲ့ item ကို ရှာပေးပါတယ်၊ ဒါပေမဲ့ item တွေမှာ number id တကယ်ရှိတဲ့ array ကိုပဲ လက်ခံရပါမယ်။

  • pluck<T, K extends keyof T>(items: T[], key: K) က T[K][] ကို ပြန်ပေးရမယ်
  • findById က id: number ပါတဲ့ item တွေကိုပဲ လက်ခံပြီး T | undefined ကို ပြန်ပေးရမယ်
  • Products array နဲ့ နှစ်ခုလုံးကို ခေါ်ပြီး ရလဒ်ကို print ထုတ်ပါ
  • Compile မဖြစ်သင့်တဲ့ call တစ်ခုကို comment အဖြစ် ထည့်ပြီး ဘာကြောင့်လဲ ရှင်းပြပါ
pluck.ts
type Product = { id: number; name: string; price: number };

const products: Product[] = [
  { id: 1, name: "Keyboard", price: 49 },
  { id: 2, name: "Mouse", price: 19 },
];

// TODO: declare the type parameters and the return type
function pluck(items, key) {
  // TODO: return the value of `key` for every item
}

// TODO: constrain T so that every item must have id: number
function findById(items, id: number) {
  // TODO: return the matching item or undefined
}

// TODO: print pluck(products, "name") and the price of product 2

ရလဒ်: pluck က [ 'Keyboard', 'Mouse' ] ကို print ထုတ်ပြီး သူ့ type က string[] ဖြစ်ပါတယ်။ findById(products, 2)?.price က 19 ကို print ထုတ်ပြီး pluck(products, "colour") က compile မဖြစ်ပါဘူး။

အရိပ်အမြွက် ကြည့်ရန်

Signature ကနေ စပါ: K extends keyof T က key ကို လုံခြုံစေပြီး T[K] က value type ကို ပေးပါတယ်။ findById အတွက် T extends { id: number } ဆိုရင် လုံလောက်ပါတယ်၊ Array.prototype.find က T | undefined ကို ပြန်ပေးပြီးသားပါ။

အဖြေ ကြည့်ရန်
pluck.ts
type Product = { id: number; name: string; price: number };

const products: Product[] = [
  { id: 1, name: "Keyboard", price: 49 },
  { id: 2, name: "Mouse", price: 19 },
];

function pluck<T, K extends keyof T>(items: T[], key: K): T[K][] {
  return items.map((item) => item[key]);
}

function findById<T extends { id: number }>(items: T[], id: number): T | undefined {
  return items.find((item) => item.id === id);
}

const names = pluck(products, "name"); // string[]
const prices = pluck(products, "price"); // number[]
console.log(names, prices);
console.log(findById(products, 2)?.price);
console.log(findById(products, 99));
// pluck(products, "colour"); // error: "colour" is not a key of Product

Quick Quiz 1 / 3

function getFirstElement<T>(arr: T[]): T | undefined ရှိတယ် ဆိုပါစို့။ const x = getFirstElement([true, false]) မှာ x ရဲ့ type က ဘာလဲ?

Quick Quiz 2 / 3

ဒါက ဘာကြောင့် compile မဖြစ်တာလဲ? function longest<T>(a: T, b: T) { return a.length >= b.length ? a : b; }

Quick Quiz 3 / 3

ပေးလိုက်တဲ့ key နဲ့ ပြန်ရတဲ့ type ကြား ဆက်သွယ်ချက်ကို အကောင်းဆုံး ထိန်းထားတဲ့ signature က ဘယ်ဟာလဲ?

မှတ်ထားရမယ့် အချက်များ

  • <T> လို type parameter က ခေါ်တိုင်း ဖြည့်ပေးရတဲ့ type placeholder ဖြစ်ပြီး များသောအားဖြင့် inference က ဖြည့်ပေးပါတယ်။
  • Generics က input နဲ့ output type ကြား ဆက်သွယ်ချက်ကို ထိန်းထားပါတယ်၊ any နဲ့ unknown က အဲဒါကို လွှင့်ပစ်ပါတယ်။
  • Body က shape တစ်ခုကို အားကိုးဖို့ လိုရင် extends နဲ့ constraint ထည့်ပါ (ဥပမာ K extends keyof T)။
  • T က တစ်ကြိမ်တည်း ဒါမှမဟုတ် return type မှာပဲ ပေါ်ရင် အဲဒီ generic က မလိုအပ်တာ ဒါမှမဟုတ် မလုံခြုံတာ ဖြစ်နိုင်ပါတယ်။

TypeScript Handbook — TypeScript

နောက်ဆုံးပြင်ဆင်ရက်

Progress ကို ဤ browser (ဤစက်) တွင်သာ သိမ်းထားပါသည်။ အခြားစက်များနှင့် sync မလုပ်ပါ။

ဤသင်ခန်းစာတွင် အမှားတွေ့ပါက အကြောင်းကြားရန်သင့် email app ကို ဤသင်ခန်းစာလိပ်စာ ဖြည့်ပြီးသားဖြင့် ဖွင့်ပေးပါမည် — သင်ကိုယ်တိုင် ပို့မှသာ ပို့မည်ဖြစ်သည်။

Generics | Thuta Learning