diff --git a/source/index.ts b/source/index.ts index fe3a74b..269b316 100644 --- a/source/index.ts +++ b/source/index.ts @@ -128,11 +128,10 @@ const cli = meow(` foo(cli.input.at(0), cli.flags); ``` */ -export default function meow(helpMessage: string, options?: Options): Result; -export default function meow(options?: Options): Result; -// TODO: should these be optional? importMeta is always needed +export default function meow(helpMessage: string, options: Options): Result; +export default function meow(options: Options): Result; -export default function meow(helpMessage?: string | Options, options?: Options): Result { +export default function meow(helpMessage: string | Options, options?: Options): Result { if (typeof helpMessage !== 'string') { options = helpMessage; helpMessage = ''; diff --git a/test-d/index.ts b/test-d/index.ts index 271d447..84e41bb 100644 --- a/test-d/index.ts +++ b/test-d/index.ts @@ -5,7 +5,8 @@ import meow from '../source/index.js'; const importMeta = import.meta; -expectType>(meow('Help text')); +expectError(meow('Help text')); +expectError(meow('Help text', {})); expectType>(meow('Help text', {importMeta, hardRejection: false})); expectAssignable<{flags: {foo: number}}>( meow({importMeta: import.meta, flags: {foo: {type: 'number', isRequired: true}}}),