export interface CgiConfiguration {
name: string,
value?: string
}
export interface CgiConfigurationsMap {
[configurationName: string]: CgiConfiguration
}
const createCGI = <T extends CgiConfigurationsMap>(configurations: T) => configurations
const CGI = createCGI({
bindCardPreCheck: {
name: ''
}
})
CGI.bindCardPreCheck.value = 'xxx'
Check out a TypeScript demo here
CGI.bindCardPreCheck.b = 'xxx'
this line results in an error:
Property 'b' does not exist on type '{ a: string; }'.
How can we address this issue?