Currently, at the time the spec uses Input as a parameter eg: const spec: CommandSpec =.... the Input interface is expected to conform to a particular shape (that of CommandInput), but, the IDE does not seem to manage to back-track that to the point where we are defining the Input interface, and provide hints to the user as to the allowed shape.
For example, if thing.spec.ts exists in an application using Waterfall CLI, and it has:
import { project } from '@sparksuite/core';
import { CommandSpec } from 'waterfall-cli';
import path from 'path';
export interface Input {
flags: {
verbose?: boolean;
'no-push'?: boolean;
};
data?: string;
}
.
.
.
there is no hinting provided by VSCode IDE regarding data being supported as either a string | number | string[] | number[], nor that data is an accepted key.
Later, we have a usage of Input where it is declared to be extending another interface.
eg: export type CommandSpec<Input extends CommandInput = EmptyCommandInput> = .....
I'm kind of expecting this is due to the use of a 'roots to leaves' kind of approach, and not being able to infer within the definition of the Input interface that it's meant to extend CommandInput's shape, and therefore be able to use CommandInput's shape as a basis for hints.
But, is there another way to do it, so that we do get hints?
Currently, at the time the spec uses Input as a parameter eg: const spec: CommandSpec =.... the Input interface is expected to conform to a particular shape (that of CommandInput), but, the IDE does not seem to manage to back-track that to the point where we are defining the Input interface, and provide hints to the user as to the allowed shape.
For example, if
thing.spec.tsexists in an application using Waterfall CLI, and it has:there is no hinting provided by VSCode IDE regarding
databeing supported as either astring | number | string[] | number[], nor thatdatais an accepted key.Later, we have a usage of
Inputwhere it is declared to be extending another interface.eg:
export type CommandSpec<Input extends CommandInput = EmptyCommandInput> = .....I'm kind of expecting this is due to the use of a 'roots to leaves' kind of approach, and not being able to infer within the definition of the
Inputinterface that it's meant to extendCommandInput's shape, and therefore be able to useCommandInput's shape as a basis for hints.But, is there another way to do it, so that we do get hints?