trpc-shield
Version:
tRPC permissions as another layer of abstraction!
20 lines (19 loc) • 471 B
TypeScript
import { IOptions, IRules } 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>): (opts: {
next: Function;
ctx: TContext;
type: string;
path: string;
input: {
[name: string]: any;
};
getRawInput: () => unknown;
}) => any;