permix
Version:
Permix is a lightweight, framework-agnostic, type-safe permissions management library for JavaScript applications on the client and server sides.
19 lines (18 loc) • 720 B
TypeScript
import type { Component, Snippet } from 'svelte';
import type { DataAtPath, Definition, Permix, RulesPaths } from '../core/index.mjs';
export interface CheckProps<D extends Definition, P extends RulesPaths<D>> {
path: P;
data?: DataAtPath<D, P>[0];
reverse?: boolean;
children: Snippet;
otherwise?: Snippet;
}
export interface PermixComponents<D extends Definition> {
Check: Component<CheckProps<D, RulesPaths<D>>>;
}
/**
* Creates type-safe Permix components for Svelte bound to your instance.
*
* @link https://permix.letstri.dev/docs/integrations/svelte
*/
export declare function createComponents<D extends Definition>(permix: Pick<Permix<D>, 'getRules' | 'check'>): PermixComponents<D>;