跳到主要内容
版本:2.0

导入.Net程序集

  • 部分较基础的命名空间默认已加载到上下文中
    • System
    • System.IO
  • 其他命名空间需要在插件信息文件中手动声明后才可导入

使用函数

declare function importNamespace(name: string): AssemblyObject;

declare type AssemblyObject = {
[key: string]: AssemblyObject | any;
};

直接导入

提示

支持 ES6 的解构赋值语法

System.IO.File.WriteAllTexts(
'path/to/file/1.txt',
'hello world'
);

const { IO: File } = System;
File.WriteAllTexts(
'path/to/file/1.txt',
'hello world'
);