Namespace

  • To group multiple related type into the same category which is a namespace

interface TestType {
  b:number;
}

declare namespace Test {
  interface Type{
    a:string;
  }
  type B = TestType; 
}
 const test1 :Test.B = {b:1};
 const test2: Test.Type = {a:1};

Last updated

Was this helpful?