0

我需要帮助来创建https://github.com/keithamus/R.js的声明文件

我不知道如何解决 R('item') 问题。我需要将 .d.ts 文件作为外部 commonjs 模块才能像这样使用:

import R = require("/i18n/R");
R('item'); // my problem
R.setLocale("en");
4

1 回答 1

0
declare module "R" {
  interface R {
    (name: string): void;
    setLocale(locale: string): void;
  }
  var RModule: R;
  export = RModule;
}
于 2015-06-03T20:08:19.590 回答