/**
 * Generic item type with an ID
 */
export interface ItemWithId {
    id: string;
    [key: string]: any;
}
/**
 * Generic configuration rule structure
 */
export interface ConfigRule<TItem extends ItemWithId = ItemWithId> {
    departments: string[];
    allowToView?: TItem[];
    defaultView?: TItem[];
    allowToWrite?: TItem[];
    defaultWrite?: string;
    restrictWriteToMatchingDepartments?: boolean;
}
/**
 * Generic configuration data structure
 */
export interface ConfigWithRules<TRule extends ConfigRule = ConfigRule> {
    rules?: TRule[];
    [key: string]: any;
}
/**
 * Options for useConfigRules hook
 */
export interface UseConfigRulesOptions<TConfig, TRule extends ConfigRule> {
    /**
     * The configuration data containing rules
     */
    config: TConfig | null;
    /**
     * Function to extract rules array from config
     * @example (config) => config.rules
     */
    getRules: (config: TConfig) => TRule[] | undefined;
    /**
     * Current department ID to filter rules by
     * If not provided, no rule will be matched
     */
    currentDepartmentId?: string;
    /**
     * Enable debug logging
     * @default false
     */
    debug?: boolean;
}
/**
 * Permissions extracted from a rule
 */
export interface Permissions<TItem extends ItemWithId = ItemWithId> {
    /**
     * Items the user can view (read-only access)
     */
    canView: TItem[];
    /**
     * Items the user can create/edit/delete (full write access)
     */
    canWrite: TItem[];
    /**
     * Items shown by default (if empty, all canView items are shown)
     */
    defaultView: TItem[];
    /**
     * Default item ID for creation (must be in canWrite list)
     */
    defaultWrite?: string;
    /**
     * If true, user can only edit items created in their current department
     */
    restrictWrite: boolean;
}
/**
 * Result returned by useConfigRules hook
 */
export interface UseConfigRulesResult<TRule extends ConfigRule, TItem extends ItemWithId = ItemWithId> {
    /**
     * The active rule matching the current department
     */
    activeRule: TRule | null;
    /**
     * Extracted and validated permissions from the active rule
     */
    permissions: Permissions<TItem>;
}
//# sourceMappingURL=types.d.ts.map