Commit d87cd402 authored by nanahira's avatar nanahira

fix before event

parent fde8183d
......@@ -115,7 +115,11 @@ export interface CommonEventNameAndPrepend<T extends keyof any> {
export type EventName = keyof EventMap;
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;
export type BeforeEventName = OmitSubstring<EventName & string, 'before-'>;
export type BeforeEventNameAndPrepend = CommonEventNameAndPrepend<BeforeEventName>;
export type ContextFunction<T> = (ctx: Context) => T;
......
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