Skip to content

Type Alias: EmitHandlerProps<E>

ts
type EmitHandlerProps<E> = {
  [K in keyof E as `on${Capitalize<string & K>}`]?: PropType<
    EmitFunctions<E>[K] | undefined
  >;
} & {
  [K in keyof E as K extends `${infer Prefix}:${infer Suffix}`
    ? `on${Capitalize<Prefix>}:${Suffix}`
    : never]?: PropType<EmitFunctions<E>[K] | undefined>;
};

Type helper that generates emit handler prop types from emit validators. Creates both camelCase and kebab-case variants for each emit.

Type Parameters

Type Parameter
E extends EmitValidators