Commit 4b92030e authored by nanahira's avatar nanahira

fix before event

parent 0d10f5ab
...@@ -85,7 +85,11 @@ export interface CommonEventNameAndPrepend<T extends keyof any> { ...@@ -85,7 +85,11 @@ export interface CommonEventNameAndPrepend<T extends keyof any> {
export type EventName = keyof EventMap; export type EventName = keyof EventMap;
export type EventNameAndPrepend = CommonEventNameAndPrepend<EventName>; export type EventNameAndPrepend = CommonEventNameAndPrepend<EventName>;
export type BeforeEventName = keyof BeforeEventMap; type OmitSubstring<
S extends string,
T extends string,
> = S extends `${infer L}${T}${infer R}` ? `${L}${R}` : never;
type BeforeEventName = OmitSubstring<EventName & string, 'before-'>;
export type BeforeEventNameAndPrepend = export type BeforeEventNameAndPrepend =
CommonEventNameAndPrepend<BeforeEventName>; CommonEventNameAndPrepend<BeforeEventName>;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment