title: how to set value to property [name , age] using the type Proxied<Cat>
body: <p>I was trying to figure out how to assign values to the [age, name] property using set (), but it shows me an error that you can see below.</p>
  
  <p>If there is a way to correct the error, I will appreciate it.</p>
  
  <p><strong>index.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>interface Proxy&lt;T&gt;{
    get(): T;
    set(value: T): void;
  }
  
  type Proxied&lt;T&gt; = {
    [P in keyof T]: Proxy&lt;T[P]&gt;;
  }
  
  interface Cat{
    age: number;
    name: string;
  }
  
  
  type PC = Proxied&lt;Cat&gt;;
  
  const doc: PC = null;
  
  doc.age.set(1);
  console.log(doc.age.get())
  
  </code></pre>
  
  <p><strong>error</strong></p>
  
  <pre class="lang-sh prettyprint-override"><code>C:\Users\c\Desktop\typetify\src\typetify.ts:3
    set(value: T): void;
      ^
  TypeError: Cannot read property 'age' of null
      at Object.&lt;anonymous&gt; (C:\Users\c\Desktop\typetify\src\typetify.ts:3:5)
      at Module._compile (internal/modules/cjs/loader.js:1176:30)
      at Module.m._compile (C:\Users\c\Desktop\typetify\node_modules\ts-node\src\index.ts:858:23)    
      at Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
      at Object.require.extensions.&lt;computed&gt; [as .ts] (C:\Users\c\Desktop\typetify\node_modules\ts-node\src\index.ts:861:12)
      at Module.load (internal/modules/cjs/loader.js:1040:32)
      at Function.Module._load (internal/modules/cjs/loader.js:929:14)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
      at main (C:\Users\c\Desktop\typetify\node_modules\ts-node\src\bin.ts:227:14)
      at Object.&lt;anonymous&gt; (C:\Users\c\Desktop\typetify\node_modules\ts-node\src\bin.ts:513:3)      
  [nodemon] app crashed - waiting for file changes before starting...
  </code></pre>