ngx-dev-toolbar 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -8,3 +8,12 @@ export * from './tools/feature-flags-tool/feature-flags.models';
8
8
  export * from './tools/feature-flags-tool/feature-flags.service';
9
9
  export * from './tools/language-tool/language.models';
10
10
  export * from './tools/language-tool/language.service';
11
+ export * from './tools/network-mocker-tool/network-mocker-tool.component';
12
+ export * from './tools/network-mocker-tool/network-mocker.models';
13
+ export * from './tools/network-mocker-tool/network-mocker.service';
14
+ export * from './tools/app-features-tool/app-features.models';
15
+ export * from './tools/app-features-tool/app-features.service';
16
+ export * from './tools/app-features-tool/app-features-tool.component';
17
+ export * from './tools/permissions-tool/permissions.models';
18
+ export * from './tools/permissions-tool/permissions.service';
19
+ export * from './tools/permissions-tool/permissions-tool.component';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngx-dev-toolbar",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "keywords": [
5
5
  "devtools",
6
6
  "development-toolbar",
@@ -33,4 +33,4 @@
33
33
  "dependencies": {
34
34
  "tslib": "^2.3.0"
35
35
  }
36
- }
36
+ }
@@ -0,0 +1,102 @@
1
+ import { Observable } from 'rxjs';
2
+ import { DevToolbarAppFeature, ForcedAppFeaturesState } from './app-features.models';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Internal service for managing app features state and forced overrides.
6
+ *
7
+ * This service handles:
8
+ * - Feature configuration storage
9
+ * - Forced feature state management
10
+ * - localStorage persistence
11
+ * - State validation and cleanup
12
+ *
13
+ * @internal This service is for internal toolbar use only. Consumers should use DevToolbarAppFeaturesService.
14
+ */
15
+ export declare class DevToolbarInternalAppFeaturesService {
16
+ private readonly STORAGE_KEY;
17
+ private storageService;
18
+ private appFeaturesSubject;
19
+ private forcedFeaturesSubject;
20
+ private readonly forcedFeatures$;
21
+ /**
22
+ * Observable stream of all features with merged forced state
23
+ */
24
+ features$: Observable<DevToolbarAppFeature[]>;
25
+ /**
26
+ * Signal containing current features with merged forced state
27
+ */
28
+ features: import("@angular/core").Signal<DevToolbarAppFeature[]>;
29
+ constructor();
30
+ /**
31
+ * Set available app features for the application.
32
+ * Validates features, trims whitespace, and triggers validation of forced state.
33
+ *
34
+ * @param features - Array of app features to configure
35
+ * @throws Error if duplicate feature IDs or empty IDs are detected
36
+ */
37
+ setAppFeatures(features: DevToolbarAppFeature[]): void;
38
+ /**
39
+ * Get observable stream of app features (natural state, no forced state merged)
40
+ */
41
+ getAppFeatures(): Observable<DevToolbarAppFeature[]>;
42
+ /**
43
+ * Get observable stream of features that have forced overrides
44
+ */
45
+ getForcedFeatures(): Observable<DevToolbarAppFeature[]>;
46
+ /**
47
+ * Force a feature to enabled or disabled state.
48
+ * Persists the forced state to localStorage.
49
+ *
50
+ * @param featureId - ID of the feature to force
51
+ * @param isEnabled - Whether to force feature to enabled (true) or disabled (false)
52
+ */
53
+ setFeature(featureId: string, isEnabled: boolean): void;
54
+ /**
55
+ * Remove forced override for a feature, returning it to natural state.
56
+ * Persists the change to localStorage.
57
+ *
58
+ * @param featureId - ID of the feature to unforce
59
+ */
60
+ removeFeatureOverride(featureId: string): void;
61
+ /**
62
+ * Apply a preset forced state (for preset integration).
63
+ * Validates and cleans invalid feature IDs before applying.
64
+ *
65
+ * @param state - Forced features state from preset
66
+ */
67
+ applyForcedState(state: ForcedAppFeaturesState): void;
68
+ /**
69
+ * Get current forced state as a snapshot (defensive copy).
70
+ * Useful for preset exports and debugging.
71
+ *
72
+ * @returns Current forced features state
73
+ */
74
+ getCurrentForcedState(): ForcedAppFeaturesState;
75
+ /**
76
+ * Merge natural app features with forced state.
77
+ *
78
+ * @param appFeatures - Natural feature configuration
79
+ * @param forcedState - Forced overrides from localStorage/toolbar
80
+ * @returns Features with merged forced state
81
+ */
82
+ private mergeForcedState;
83
+ /**
84
+ * Load forced features state from localStorage on initialization.
85
+ * Handles missing or corrupted data gracefully.
86
+ */
87
+ private loadForcedFeatures;
88
+ /**
89
+ * Persist forced features state to localStorage.
90
+ * Handles quota exceeded errors gracefully.
91
+ *
92
+ * @param state - Forced state to persist
93
+ */
94
+ private saveForcedFeatures;
95
+ /**
96
+ * Validate forced feature IDs against configured features and clean up invalid ones.
97
+ * Called after setAppFeatures() to ensure forced state references valid features.
98
+ */
99
+ private validateAndCleanForcedState;
100
+ static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarInternalAppFeaturesService, never>;
101
+ static ɵprov: i0.ɵɵInjectableDeclaration<DevToolbarInternalAppFeaturesService>;
102
+ }
@@ -0,0 +1,61 @@
1
+ import { DevToolbarWindowOptions } from '../../components/toolbar-tool/toolbar-tool.models';
2
+ import { AppFeatureFilter, DevToolbarAppFeature } from './app-features.models';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * Component for managing app features in the dev toolbar.
6
+ *
7
+ * Provides UI for:
8
+ * - Searching features by name and description
9
+ * - Filtering features by state (all/forced/enabled/disabled)
10
+ * - Forcing features to enabled/disabled state via 3-state dropdown
11
+ * - Viewing feature descriptions and current state
12
+ *
13
+ * @example
14
+ * ```html
15
+ * <ndt-app-features-tool />
16
+ * ```
17
+ */
18
+ export declare class DevToolbarAppFeaturesToolComponent {
19
+ private readonly appFeaturesService;
20
+ protected readonly activeFilter: import("@angular/core").WritableSignal<AppFeatureFilter>;
21
+ protected readonly searchQuery: import("@angular/core").WritableSignal<string>;
22
+ protected readonly features: import("@angular/core").Signal<DevToolbarAppFeature[]>;
23
+ protected readonly hasNoFeatures: import("@angular/core").Signal<boolean>;
24
+ protected readonly filteredFeatures: import("@angular/core").Signal<DevToolbarAppFeature[]>;
25
+ protected readonly hasNoFilteredFeatures: import("@angular/core").Signal<boolean>;
26
+ protected readonly options: DevToolbarWindowOptions;
27
+ protected readonly filterOptions: {
28
+ value: string;
29
+ label: string;
30
+ }[];
31
+ protected readonly featureValueOptions: {
32
+ value: string;
33
+ label: string;
34
+ }[];
35
+ /**
36
+ * Handle filter dropdown change.
37
+ * Updates the active filter to show all/forced/enabled/disabled features.
38
+ */
39
+ onFilterChange(value: string | undefined): void;
40
+ /**
41
+ * Handle feature value change from 3-state dropdown.
42
+ * - 'not-forced' (empty string): Remove forced override
43
+ * - 'on': Force feature to enabled
44
+ * - 'off': Force feature to disabled
45
+ */
46
+ onFeatureChange(featureId: string, value: string): void;
47
+ /**
48
+ * Handle search input change.
49
+ * Updates the search query to filter features by name/description.
50
+ */
51
+ onSearchChange(query: string): void;
52
+ /**
53
+ * Get the dropdown value for a feature's current state.
54
+ * - Returns empty string if not forced (natural state)
55
+ * - Returns 'on' if forced to enabled
56
+ * - Returns 'off' if forced to disabled
57
+ */
58
+ protected getFeatureValue(feature: DevToolbarAppFeature): string;
59
+ static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarAppFeaturesToolComponent, never>;
60
+ static ɵcmp: i0.ɵɵComponentDeclaration<DevToolbarAppFeaturesToolComponent, "ndt-app-features-tool", never, {}, {}, never, never, true, never>;
61
+ }
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Represents a product-level application feature that can be enabled/disabled
3
+ * based on license tier, deployment configuration, or environment flags.
4
+ *
5
+ * @example
6
+ * ```typescript
7
+ * const feature: DevToolbarAppFeature = {
8
+ * id: 'advanced-analytics',
9
+ * name: 'Advanced Analytics Dashboard',
10
+ * description: 'Access advanced reporting and data visualization tools',
11
+ * isEnabled: false, // Not available in current tier
12
+ * isForced: false // Natural state, not overridden
13
+ * };
14
+ * ```
15
+ */
16
+ export interface DevToolbarAppFeature {
17
+ /**
18
+ * Unique identifier for the feature
19
+ * @example 'advanced-analytics', 'multi-user-support', 'white-label-branding'
20
+ */
21
+ id: string;
22
+ /**
23
+ * Display name shown in the toolbar UI
24
+ * @example 'Advanced Analytics Dashboard', 'Multi-User Support'
25
+ */
26
+ name: string;
27
+ /**
28
+ * Optional description explaining the feature's purpose and capabilities
29
+ * Displayed below the feature name in the UI
30
+ * @example 'Access advanced reporting and data visualization tools'
31
+ */
32
+ description?: string;
33
+ /**
34
+ * Current enabled state of the feature
35
+ * - true: Feature is available to the user (may be natural state or forced)
36
+ * - false: Feature is not available (may be natural state or forced)
37
+ */
38
+ isEnabled: boolean;
39
+ /**
40
+ * Whether the feature state is forced via the dev toolbar
41
+ * - true: State is overridden by developer, ignoring natural application state
42
+ * - false: State reflects the natural application configuration
43
+ */
44
+ isForced: boolean;
45
+ }
46
+ /**
47
+ * Filter options for displaying features in the toolbar UI.
48
+ *
49
+ * - `'all'`: Show all configured features
50
+ * - `'forced'`: Show only features with isForced = true
51
+ * - `'enabled'`: Show only features with isEnabled = true (regardless of forced state)
52
+ * - `'disabled'`: Show only features with isEnabled = false (regardless of forced state)
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * // Show only forced overrides
57
+ * const filter: AppFeatureFilter = 'forced';
58
+ *
59
+ * // Show all enabled features (natural or forced)
60
+ * const filter: AppFeatureFilter = 'enabled';
61
+ * ```
62
+ */
63
+ export type AppFeatureFilter = 'all' | 'forced' | 'enabled' | 'disabled';
64
+ /**
65
+ * Internal storage format for persisted forced feature overrides in localStorage.
66
+ *
67
+ * **Storage Rules**:
68
+ * - Feature ID MUST NOT appear in both `enabled` and `disabled` arrays simultaneously
69
+ * - If feature forced to enabled, ID MUST be in `enabled` array and NOT in `disabled` array
70
+ * - If feature forced to disabled, ID MUST be in `disabled` array and NOT in `enabled` array
71
+ * - If feature not forced, ID MUST NOT be in either array
72
+ *
73
+ * **localStorage Key**: `AngularDevTools.app-features`
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * // Testing Enterprise tier (force premium features enabled)
78
+ * const enterpriseState: ForcedAppFeaturesState = {
79
+ * enabled: ['analytics', 'multi-user', 'white-label', 'sso-integration'],
80
+ * disabled: []
81
+ * };
82
+ *
83
+ * // Testing Basic tier (force premium features disabled)
84
+ * const basicState: ForcedAppFeaturesState = {
85
+ * enabled: [],
86
+ * disabled: ['analytics', 'multi-user', 'white-label', 'sso-integration']
87
+ * };
88
+ *
89
+ * // Mixed scenario
90
+ * const mixedState: ForcedAppFeaturesState = {
91
+ * enabled: ['analytics'], // Test analytics feature
92
+ * disabled: ['white-label'] // Ensure branding is off
93
+ * };
94
+ * ```
95
+ */
96
+ export interface ForcedAppFeaturesState {
97
+ /**
98
+ * Array of feature IDs forced to enabled state
99
+ * Features in this array will have isEnabled = true regardless of natural state
100
+ * @example ['advanced-analytics', 'white-label-branding']
101
+ */
102
+ enabled: string[];
103
+ /**
104
+ * Array of feature IDs forced to disabled state
105
+ * Features in this array will have isEnabled = false regardless of natural state
106
+ * @example ['basic-support', 'community-forums']
107
+ */
108
+ disabled: string[];
109
+ }
@@ -0,0 +1,151 @@
1
+ import { Observable } from 'rxjs';
2
+ import { DevToolsService } from '../../models/dev-tools.interface';
3
+ import { DevToolbarAppFeature, ForcedAppFeaturesState } from './app-features.models';
4
+ import * as i0 from "@angular/core";
5
+ /**
6
+ * Public service for managing app features in the dev toolbar.
7
+ *
8
+ * This service implements the DevToolsService interface and provides methods for:
9
+ * - Configuring available product features
10
+ * - Retrieving forced feature overrides
11
+ * - Applying preset feature configurations
12
+ * - Exporting current forced state for presets
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * import { DevToolbarAppFeaturesService } from 'ngx-dev-toolbar';
17
+ *
18
+ * @Component({...})
19
+ * export class AppComponent implements OnInit {
20
+ * private appFeaturesService = inject(DevToolbarAppFeaturesService);
21
+ *
22
+ * ngOnInit() {
23
+ * // Configure available features based on current tier
24
+ * const features: DevToolbarAppFeature[] = [
25
+ * { id: 'analytics', name: 'Analytics Dashboard', isEnabled: true, isForced: false },
26
+ * { id: 'multi-user', name: 'Multi-User Support', isEnabled: false, isForced: false }
27
+ * ];
28
+ * this.appFeaturesService.setAvailableOptions(features);
29
+ *
30
+ * // Subscribe to forced overrides
31
+ * this.appFeaturesService.getForcedValues().subscribe(forcedFeatures => {
32
+ * forcedFeatures.forEach(feature => {
33
+ * // Apply forced feature state to application logic
34
+ * this.applyFeatureState(feature.id, feature.isEnabled);
35
+ * });
36
+ * });
37
+ * }
38
+ * }
39
+ * ```
40
+ */
41
+ export declare class DevToolbarAppFeaturesService implements DevToolsService<DevToolbarAppFeature> {
42
+ private internalService;
43
+ /**
44
+ * Set available app features for the application.
45
+ *
46
+ * Configures the list of product features that can be toggled in the dev toolbar.
47
+ * Features should represent product-level capabilities like license tiers,
48
+ * deployment configurations, or environment flags.
49
+ *
50
+ * @param features - Array of app features to display in the toolbar
51
+ * @throws Error if duplicate feature IDs or empty IDs are detected
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const features: DevToolbarAppFeature[] = [
56
+ * {
57
+ * id: 'advanced-analytics',
58
+ * name: 'Advanced Analytics Dashboard',
59
+ * description: 'Access premium reporting and data visualization',
60
+ * isEnabled: false, // Not available in current tier
61
+ * isForced: false
62
+ * },
63
+ * {
64
+ * id: 'multi-user-support',
65
+ * name: 'Multi-User Collaboration',
66
+ * description: 'Enable team features and user management',
67
+ * isEnabled: true, // Available in current tier
68
+ * isForced: false
69
+ * }
70
+ * ];
71
+ * this.appFeaturesService.setAvailableOptions(features);
72
+ * ```
73
+ */
74
+ setAvailableOptions(features: DevToolbarAppFeature[]): void;
75
+ /**
76
+ * Get observable stream of features that have forced overrides.
77
+ *
78
+ * Emits an array of features that have been forced via the dev toolbar.
79
+ * Only features with `isForced = true` are included in the emissions.
80
+ * Use this to react to feature override changes and update application behavior.
81
+ *
82
+ * @returns Observable that emits array of forced features whenever state changes
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * this.appFeaturesService.getForcedValues()
87
+ * .pipe(takeUntilDestroyed())
88
+ * .subscribe(forcedFeatures => {
89
+ * forcedFeatures.forEach(feature => {
90
+ * if (feature.isEnabled) {
91
+ * this.enableFeature(feature.id);
92
+ * } else {
93
+ * this.disableFeature(feature.id);
94
+ * }
95
+ * });
96
+ * });
97
+ * ```
98
+ */
99
+ getForcedValues(): Observable<DevToolbarAppFeature[]>;
100
+ /**
101
+ * Apply a preset feature configuration (for preset tool integration).
102
+ *
103
+ * Accepts a forced features state object and applies it to the current configuration.
104
+ * Invalid feature IDs (not in configured features) are filtered out with a warning.
105
+ *
106
+ * @param state - Forced features state containing enabled/disabled arrays
107
+ *
108
+ * @example
109
+ * ```typescript
110
+ * // Apply "Enterprise Tier" preset
111
+ * const enterprisePreset: ForcedAppFeaturesState = {
112
+ * enabled: ['analytics', 'multi-user', 'white-label', 'sso'],
113
+ * disabled: []
114
+ * };
115
+ * this.appFeaturesService.applyPresetFeatures(enterprisePreset);
116
+ *
117
+ * // Apply "Basic Tier" preset
118
+ * const basicPreset: ForcedAppFeaturesState = {
119
+ * enabled: [],
120
+ * disabled: ['analytics', 'multi-user', 'white-label', 'sso']
121
+ * };
122
+ * this.appFeaturesService.applyPresetFeatures(basicPreset);
123
+ * ```
124
+ */
125
+ applyPresetFeatures(state: ForcedAppFeaturesState): void;
126
+ /**
127
+ * Get current forced feature state as a snapshot (for preset export).
128
+ *
129
+ * Returns the current forced features state with enabled/disabled arrays.
130
+ * Useful for exporting toolbar state to save as a preset or for debugging.
131
+ * Returns a defensive copy - mutations will not affect internal state.
132
+ *
133
+ * @returns Current forced features state
134
+ *
135
+ * @example
136
+ * ```typescript
137
+ * // Export current toolbar state to save as preset
138
+ * const currentState = this.appFeaturesService.getCurrentForcedState();
139
+ * this.presetsService.savePreset('my-config', {
140
+ * appFeatures: currentState,
141
+ * // ... other tool states
142
+ * });
143
+ *
144
+ * console.log(currentState);
145
+ * // { enabled: ['analytics'], disabled: ['white-label'] }
146
+ * ```
147
+ */
148
+ getCurrentForcedState(): ForcedAppFeaturesState;
149
+ static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarAppFeaturesService, never>;
150
+ static ɵprov: i0.ɵɵInjectableDeclaration<DevToolbarAppFeaturesService>;
151
+ }
@@ -0,0 +1,23 @@
1
+ import { DevToolbarWindowOptions } from '../../components/toolbar-tool/toolbar-tool.models';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DevToolbarNetworkMockerToolComponent {
4
+ private readonly networkMockerService;
5
+ protected readonly newMockUrl: import("@angular/core").WritableSignal<string>;
6
+ protected readonly newMockMethod: import("@angular/core").WritableSignal<string>;
7
+ protected readonly newMockStatus: import("@angular/core").WritableSignal<string>;
8
+ protected readonly newMockResponse: import("@angular/core").WritableSignal<string>;
9
+ protected readonly mockRequests: import("@angular/core").Signal<import("./network-mocker.models").MockRequest[]>;
10
+ protected readonly isMockingEnabled: import("@angular/core").Signal<boolean>;
11
+ protected readonly hasNoMocks: import("@angular/core").Signal<boolean>;
12
+ protected readonly options: DevToolbarWindowOptions;
13
+ protected readonly httpMethods: {
14
+ value: string;
15
+ label: string;
16
+ }[];
17
+ protected onAddMock(): void;
18
+ protected onToggleMocking(): void;
19
+ protected onToggleMock(mockId: string): void;
20
+ protected onRemoveMock(mockId: string): void;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarNetworkMockerToolComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<DevToolbarNetworkMockerToolComponent, "ndt-network-mocker-tool", never, {}, {}, never, never, true, never>;
23
+ }
@@ -0,0 +1,16 @@
1
+ export interface MockRequest {
2
+ id: string;
3
+ url: string;
4
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
5
+ status: number;
6
+ response: any;
7
+ isActive: boolean;
8
+ createdAt: Date;
9
+ }
10
+ export interface MockRequestConfig {
11
+ url: string;
12
+ method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
13
+ status?: number;
14
+ response?: any;
15
+ delay?: number;
16
+ }
@@ -0,0 +1,16 @@
1
+ import { MockRequest, MockRequestConfig } from './network-mocker.models';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DevToolbarNetworkMockerService {
4
+ private readonly mockRequests;
5
+ private readonly isMockingEnabled;
6
+ getMockRequests(): import("@angular/core").Signal<MockRequest[]>;
7
+ getIsMockingEnabled(): import("@angular/core").Signal<boolean>;
8
+ addMockRequest(config: MockRequestConfig): void;
9
+ removeMockRequest(id: string): void;
10
+ toggleMockRequest(id: string): void;
11
+ enableMocking(): void;
12
+ disableMocking(): void;
13
+ clearAllMocks(): void;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarNetworkMockerService, never>;
15
+ static ɵprov: i0.ɵɵInjectableDeclaration<DevToolbarNetworkMockerService>;
16
+ }
@@ -0,0 +1,34 @@
1
+ import { Observable } from 'rxjs';
2
+ import { DevToolbarPermission, ForcedPermissionsState } from './permissions.models';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DevToolbarInternalPermissionsService {
5
+ private readonly STORAGE_KEY;
6
+ private storageService;
7
+ private appPermissions$;
8
+ private forcedStateSubject;
9
+ private readonly forcedState$;
10
+ permissions$: Observable<DevToolbarPermission[]>;
11
+ permissions: import("@angular/core").Signal<DevToolbarPermission[]>;
12
+ constructor();
13
+ setAppPermissions(permissions: DevToolbarPermission[]): void;
14
+ setPermission(id: string, granted: boolean): void;
15
+ removePermissionOverride(id: string): void;
16
+ getForcedPermissions(): Observable<DevToolbarPermission[]>;
17
+ /**
18
+ * Apply a preset permissions state, replacing the current forced state.
19
+ * Useful for automated testing or restoring saved configurations.
20
+ * @param state The preset forced permissions state to apply
21
+ */
22
+ applyPresetPermissions(state: ForcedPermissionsState): void;
23
+ /**
24
+ * Get the current forced permissions state.
25
+ * Returns a deep copy to prevent external mutations.
26
+ * @returns Current forced permissions state
27
+ */
28
+ getCurrentForcedState(): ForcedPermissionsState;
29
+ private loadForcedState;
30
+ private isValidForcedState;
31
+ private validateAndCleanForcedState;
32
+ static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarInternalPermissionsService, never>;
33
+ static ɵprov: i0.ɵɵInjectableDeclaration<DevToolbarInternalPermissionsService>;
34
+ }
@@ -0,0 +1,27 @@
1
+ import { DevToolbarWindowOptions } from '../../components/toolbar-tool/toolbar-tool.models';
2
+ import { DevToolbarPermission, PermissionFilter } from './permissions.models';
3
+ import * as i0 from "@angular/core";
4
+ export declare class DevToolbarPermissionsToolComponent {
5
+ private readonly permissionsService;
6
+ protected readonly activeFilter: import("@angular/core").WritableSignal<PermissionFilter>;
7
+ protected readonly searchQuery: import("@angular/core").WritableSignal<string>;
8
+ protected readonly permissions: import("@angular/core").Signal<DevToolbarPermission[]>;
9
+ protected readonly hasNoPermissions: import("@angular/core").Signal<boolean>;
10
+ protected readonly filteredPermissions: import("@angular/core").Signal<DevToolbarPermission[]>;
11
+ protected readonly hasNoFilteredPermissions: import("@angular/core").Signal<boolean>;
12
+ protected readonly options: DevToolbarWindowOptions;
13
+ protected readonly filterOptions: {
14
+ value: string;
15
+ label: string;
16
+ }[];
17
+ protected readonly permissionValueOptions: {
18
+ value: string;
19
+ label: string;
20
+ }[];
21
+ onFilterChange(value: string | undefined): void;
22
+ onPermissionChange(id: string, value: string): void;
23
+ onSearchChange(query: string): void;
24
+ protected getPermissionValue(permission: DevToolbarPermission): string;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarPermissionsToolComponent, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<DevToolbarPermissionsToolComponent, "ndt-permissions-tool", never, {}, {}, never, never, true, never>;
27
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Represents a permission in the developer toolbar.
3
+ * Used to configure and override application permissions for testing.
4
+ */
5
+ export interface DevToolbarPermission {
6
+ /** Unique identifier for the permission */
7
+ id: string;
8
+ /** Human-readable name displayed in the UI */
9
+ name: string;
10
+ /** Optional description explaining the permission's purpose */
11
+ description?: string;
12
+ /** Whether the permission is currently granted */
13
+ isGranted: boolean;
14
+ /** Whether the permission's value has been overridden through the toolbar */
15
+ isForced: boolean;
16
+ }
17
+ /**
18
+ * Internal state representing forced permission overrides.
19
+ * Persisted to localStorage for session continuity.
20
+ */
21
+ export interface ForcedPermissionsState {
22
+ /** Array of permission IDs that are forced to granted */
23
+ granted: string[];
24
+ /** Array of permission IDs that are forced to denied */
25
+ denied: string[];
26
+ }
27
+ /**
28
+ * Filter options for displaying permissions in the tool.
29
+ */
30
+ export type PermissionFilter = 'all' | 'forced' | 'granted' | 'denied';
31
+ /**
32
+ * Permission value options for the dropdown control.
33
+ */
34
+ export type PermissionValue = 'not-forced' | 'granted' | 'denied';