We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
An_index_signature_parameter_type_must_be_string_or_number_1023: with this Feature, I can't make this code work:
export class Events<ED extends EventsDef, EventName extends keyof ED = keyof ED> { private eventMap = new Map<EventName, Event<ED[EventName]>>(); constructor() { new Proxy(this, { get: (target, p) => { if (p in target) { return target[p]; } else { this.getEvent(p as EventName); } } }) } private getEvent(eventName: EventName) { return this.eventMap.get(eventName) || this.generateEvent(eventName); } private generateEvent(eventName: EventName) { let event = new Event<ED[EventName]>(); this.eventMap.set(eventName, event); return event; } // error here readonly [eventName: EventName]: Event<ED[EventName]>; }
The text was updated successfully, but these errors were encountered:
Ref #26797
Sorry, something went wrong.
No branches or pull requests
An_index_signature_parameter_type_must_be_string_or_number_1023:
with this Feature, I can't make this code work:
The text was updated successfully, but these errors were encountered: