导出函数作为模块的“根”?

时间:2016-01-22 04:08:15

标签: javascript typescript

编写TypeScript定义时,如何声明定义定义函数而不是类型?这样函数就会被导出为模块本身......

定义

declare module "rmdir" {
    interface IRmDirCallback {
        (err: any, dirs: Array<string>, files: Array<string>): any;
    }

    function rmdir(dir: string, options: any, callback: IRmDirCallback): void;

    export = rmdir;
}

export = rmdir.rmdir;

使用示例

/// <reference path="rmdir.d.ts"/>

import rmdir = require("rmdir");

rmdir("test", { }, (err: any, dirs: Array<string>, files: Array<string>) => { });

因此,当我导入rmdir时,我不想要拨打rmdir.rmdir(...)

1 个答案:

答案 0 :(得分:1)

使用with src as (select to_date(' 1-jan-2016','dd-mon-yyyy') col_d, -98 col1, 25 col2, 15 col3 from dual union all select to_date('19-jan-2016','dd-mon-yyyy') col_d, 25 col1, -79 col2, 20 col3 from dual union all select to_date('25-dec-2015','dd-mon-yyyy') col_d, -12 col1, 24 col2, 89 col3 from dual) select min(least(col1,col2,col3)) least, min(col_d) keep (DENSE_RANK FIRST ORDER BY least(col1,col2,col3) ) col_d from src; 。这是完整的代码:

export =