We compute types everywhere in Punchcard which can result in some gnarly type signatures that are quite difficult to read.
This happens because we use type aliases instead of using interfaces.
//before
export type ReadOnly<PKey extends keyof A, SKey extends keyof A | undefined, A extends Attributes> = Omit<Client<PKey, SKey, A>, 'put' | 'putBatch' | 'delete' | 'update'>;
// now
export interface ReadOnly<PKey extends keyof A, SKey extends keyof A | undefined, A extends Attributes> extends Omit<Client<PKey, SKey, A>, 'put' | 'putBatch' | 'delete' | 'update'> {}
A type alias has no identifier at compile time. It is simply an alias/pointer to another type. This results in ugly names, especially when using computations like Omit:
Interfaces are the opposite - they give names to things for the TS compiler. This change uses this feature to provide more helpful names to Punchcard types:
// type reported now
Kinesis.Stream.ReadWrite<T>
// before
Omit<Client<T>, 'putRecord' | 'putRecords' | 'sink'>
Breaking Change: Moved the Firehose Validator construct under its own Construct.
We compute types everywhere in Punchcard which can result in some gnarly type signatures that are quite difficult to read.
This happens because we use type aliases instead of using interfaces.
A type alias has no identifier at compile time. It is simply an alias/pointer to another type. This results in ugly names, especially when using computations like Omit:
Interfaces are the opposite - they give names to things for the TS compiler. This change uses this feature to provide more helpful names to Punchcard types:
Breaking Change: Moved the Firehose Validator construct under its own Construct.