-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpersona.interface.ts
More file actions
42 lines (32 loc) · 1.23 KB
/
persona.interface.ts
File metadata and controls
42 lines (32 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
import type { Account } from './account.interface';
export type PersonaType = 'contributor' | 'maintainer' | 'board-member' | 'executive-director';
export const VALID_PERSONAS: ReadonlySet<string> = new Set<string>(['contributor', 'maintainer', 'board-member', 'executive-director']);
export const BOARD_SCOPED_PERSONAS: ReadonlySet<PersonaType> = new Set(['board-member', 'executive-director']);
export function isBoardScopedPersona(persona: PersonaType): boolean {
return BOARD_SCOPED_PERSONAS.has(persona);
}
export const PROJECT_SCOPED_PERSONAS: ReadonlySet<PersonaType> = new Set(['maintainer', 'contributor']);
export function isProjectScopedPersona(persona: PersonaType): boolean {
return PROJECT_SCOPED_PERSONAS.has(persona);
}
export interface PersistedPersonaState {
primary: PersonaType;
all: PersonaType[];
organizations?: Account[];
userSelected?: boolean;
}
export interface DevPersonaPreset {
label: string;
value: string;
personas: PersonaType[];
/** Determines lens behavior. */
primary: PersonaType;
}
export interface PersonaOption {
value: PersonaType;
label: string;
description?: string;
icon?: string;
}