UNPKG

@userfrosting/sprinkle-admin

Version:
39 lines (38 loc) 1.41 kB
import { ApiErrorResponse } from '@userfrosting/sprinkle-core/interfaces'; import { PermissionInterface } from '@userfrosting/sprinkle-account/interfaces'; /** * API used to fetch a match between all available permissions and the role's * permissions, in a single component * * This API is tied to the `PermissionsSprunje` and `RolePermissionsSprunje` API, * accessed at the GET `/api/permissions` and * `/api/roles/r/{slug}/permissions` endpoints. * * This composable accept a {roleSlug} to select the permissions of a specific * role. */ export declare function useRolePermissionsApi(): { error: import('vue').Ref<ApiErrorResponse | null | undefined, ApiErrorResponse | null | undefined>; loading: import('vue').Ref<boolean, boolean>; fetch: (roleSlug: string) => Promise<void>; selected: import('vue').Ref<number[], number[]>; permissions: import('vue').Ref<{ id: number; slug: string; name: string; conditions: string; description: string; created_at: Date | string; updated_at: Date | string; deleted_at: Date | string | null; }[], PermissionInterface[] | { id: number; slug: string; name: string; conditions: string; description: string; created_at: Date | string; updated_at: Date | string; deleted_at: Date | string | null; }[]>; };