@conte-ltd/trpc-shield
Version:
tRPC permissions as another layer of abstraction!
20 lines (19 loc) • 501 B
TypeScript
import { IRules, IOptions } from './types';
/**
*
* @param ruleTree
* @param options
*
* Generates middleware from given rules.
*
*/
export declare function generateMiddlewareFromRuleTree<TContext extends Record<string, unknown>>(ruleTree: IRules<TContext>, options: IOptions<TContext>): ({ next, ctx, type, path, input, rawInput, }: {
next: Function;
ctx: TContext;
type: string;
path: string;
input: {
[name: string]: any;
};
rawInput: unknown;
}) => any;