Skip to content

Commit

Permalink
fix(types): remove generic from Handler type
Browse files Browse the repository at this point in the history
- Closes #52
  • Loading branch information
lukeed committed Jan 6, 2022
1 parent a03a5b9 commit f75579a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ type Arrayable<T> = T | T[];
declare function sade(usage: string, isSingle?: boolean): sade.Sade;

declare namespace sade {
export type Handler = (...args: any[]) => any;
export type Value = number | string | boolean | null;
export type Handler<T extends readonly Value[] = Value[]> = (...args: [...T, mri.Argv]) => any;

export interface LazyOutput<T extends any[]> {
export interface LazyOutput {
name: string;
handler: Handler<T>;
handler: Handler;
args: string[];
}

Expand All @@ -21,12 +21,12 @@ declare namespace sade {
}): Sade;

option(flag: string, description?: string, value?: Value): Sade;
action<T extends Value[]>(handler: Handler<T>): Sade;
action(handler: Handler): Sade;
describe(text: Arrayable<string>): Sade;
alias(...names: string[]): Sade;
example(usage: string): Sade;

parse<T extends Value[]>(arr: string[], opts: { lazy: true } & mri.Options): LazyOutput<T>;
parse(arr: string[], opts: { lazy: true } & mri.Options): LazyOutput;
parse(arr: string[], opts?: { lazy?: boolean } & mri.Options): void;

version(value: string): Sade;
Expand Down

0 comments on commit f75579a

Please sign in to comment.