i'm quite new typescript , trying script little cli app.
i want use npm~command-line-args definition not available typings
thought how hard create own. turns out harder expected.
so goal export module exposes single function , maybe small type declaration.
i tried far:
declare module 'command-line-args' { export interface clioptiondefinition { name: string, alias?: string, type: booleanconstructor|stringconstructor|numberconstructor, multiple?: boolean, defaultoption?: } export = function commandlineargs <r> ( optiondefinitions: clioptiondefinition[] ) {}; }
but getting error:
error ts1183: implementation cannot declared in ambient contexts.
does:
export function commandlineargs <r> ( optiondefinitions: clioptiondefinition[] );
work way expect? (omit =
, , {}
.) if intending provide implementation of commandlineargs
, want export non-ambient (remove declare
etc.), preferably external, module (or, alternatively, namespace).