Description
I've been trying to work out how some of these things are intended to be used and having trouble.
Why are all fields possibly undefined?
eg (doc comments removed:
export interface Container {
reason?: string;
name?: string;
exitCode?: number;
// ...
Is the expectation that we should be putting in guard clauses for every API response, including ones that don't return an error, for things that the APIs are expected to return?
How do we use .config.* properties?
Some code naively ported from V2:
const ecs = new ECS({});
const clusters = await ecs.listClusters({});
if (!clusters.clusterArns) {
throw new CLIError(
`Could not find any ECS clusters in ${ecs.config.region}`
);
}
ecs.config.region
above is typed as Provider<string> | (string & Provider<string>)
(which rightfully produces a warning with eslint about embedding it in a template string). Looking at Provider
, it looks like it's a promise wrapper. Are we supposed to check via typeof
to see if it's a function or a string, and await
it if it's a function?
Where are the SDK docs?
I've been relying on intellisense & manually reading the type definitions, but it'd be nice if AWS hosted a typedoc of the various packages.