import {Store} from "vuex"; import {Ability} from "@casl/ability"; interface ItemsMenu extends Array {} /** * Upgrade du @nuxt/types pour TypeScript */ declare module '@nuxt/types' { interface Context { $ability(): Ability, $rest: AnyJson } } interface ItemMenu { title: string, icon?: string, to?: string, children?: ItemsMenu, isExternalLink?: boolean, } interface AbilitiesType { action: 'display' | 'read' | 'manage', subject: string, /** an array of fields to which user has (or not) access */ fields?: string[] /** an object of conditions which restricts the rule scope */ conditions?: any /** indicates whether rule allows or forbids something */ inverted?: boolean /** message which explains why rule is forbidden */ reason?: string } interface accessState { bearer: string, accessId: number, name: string, givenName: string, roles: Array, abilities: Array, isAdminAccess: boolean, isAdmin: boolean, isAdministratifManager: boolean, isPedagogicManager: boolean, isFinancialManager: boolean, isCaMember: boolean, isStudent: boolean, isTeacher: boolean, isMember: boolean, isOther: boolean, hasLateralMenu: boolean, hasConfigurationMenu: boolean, hasAccessesMenu: boolean, hasFamilyMenu: boolean } interface AccessStore extends Store<{profile:{access:accessState}}> {} interface organizationState { id: number, name: string, product?: string, modules?: Array, hasChildren?: boolean, networks: Array, website?: string, subDomain?: string, parents: Array, } interface OrganizationStore extends Store<{profile:{organization:organizationState}}> {} interface AnyJson extends Record {} interface AnyStore extends Store {}