Initial import

This commit is contained in:
how2ice
2026-04-21 03:33:23 +09:00
commit 9e4b70f1f1
495 changed files with 94680 additions and 0 deletions

16
src/types/component-plugin.ts Executable file
View File

@@ -0,0 +1,16 @@
export type PropsPlugin<TProps> = (props: TProps) => TProps;
export type ComponentPlugin<TInput, TProps = TInput> = (input: TInput) => TProps;
export type ComponentPluginFactory<
TArgs extends unknown[] = [],
TInput = unknown,
TProps = TInput,
> = (...args: TArgs) => ComponentPlugin<TInput, TProps>;
export function plugins<TProps>(
props: TProps,
pluginList: ReadonlyArray<PropsPlugin<TProps>>,
): TProps {
return pluginList.reduce((currentProps, plugin) => plugin(currentProps), props);
}