示例工程 18-iife-module-pattern

18-iife-module-pattern/03-namespace-output/legacy/ui.ts

typescript · 0.2 KB

运行:18 · namespace-output

点击「运行示例」后,左侧显示源码、右侧显示运行结果;console 输出会实时回传。

// 用 namespace 写的库(脚本模式编译)
namespace LegacyUI {
  export const version = '1.0.0';
 
  export function boot(): string {
    return `boot:${version}`;
  }
 
  export namespace Theme {
    export const name = 'light';
  }
}