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/components/icons/bolt-icon.component.d.ts +6 -0
- package/components/icons/filter-icon.component.d.ts +6 -0
- package/components/icons/icon.component.d.ts +1 -1
- package/components/icons/icon.models.d.ts +1 -1
- package/components/icons/lock-icon.component.d.ts +6 -0
- package/components/select/select.component.d.ts +1 -1
- package/components/window/window.component.d.ts +1 -1
- package/dev-toolbar-state.service.d.ts +1 -1
- package/fesm2022/ngx-dev-toolbar.mjs +1656 -125
- package/fesm2022/ngx-dev-toolbar.mjs.map +1 -1
- package/index.d.ts +9 -0
- package/package.json +2 -2
- package/tools/app-features-tool/app-features-internal.service.d.ts +102 -0
- package/tools/app-features-tool/app-features-tool.component.d.ts +61 -0
- package/tools/app-features-tool/app-features.models.d.ts +109 -0
- package/tools/app-features-tool/app-features.service.d.ts +151 -0
- package/tools/network-mocker-tool/network-mocker-tool.component.d.ts +23 -0
- package/tools/network-mocker-tool/network-mocker.models.d.ts +16 -0
- package/tools/network-mocker-tool/network-mocker.service.d.ts +16 -0
- package/tools/permissions-tool/permissions-internal.service.d.ts +34 -0
- package/tools/permissions-tool/permissions-tool.component.d.ts +27 -0
- package/tools/permissions-tool/permissions.models.d.ts +34 -0
- package/tools/permissions-tool/permissions.service.d.ts +87 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { DevToolsService } from '../../models/dev-tools.interface';
|
|
3
|
+
import { DevToolbarPermission, ForcedPermissionsState } from './permissions.models';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Public service for integrating the Permissions Tool with your application.
|
|
7
|
+
* Use this service to:
|
|
8
|
+
* 1. Register your application's permissions with setAvailableOptions()
|
|
9
|
+
* 2. Listen for toolbar permission overrides with getForcedValues()
|
|
10
|
+
* 3. Apply preset permission states for testing with applyPreset()
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* constructor(private permissionsService: DevToolbarPermissionsService) {
|
|
15
|
+
* // Register permissions
|
|
16
|
+
* this.permissionsService.setAvailableOptions([
|
|
17
|
+
* { id: 'can-edit', name: 'Can Edit', isGranted: false, isForced: false }
|
|
18
|
+
* ]);
|
|
19
|
+
*
|
|
20
|
+
* // Listen for overrides
|
|
21
|
+
* this.permissionsService.getForcedValues().subscribe(forcedPermissions => {
|
|
22
|
+
* // Update your app's permission state
|
|
23
|
+
* });
|
|
24
|
+
* }
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class DevToolbarPermissionsService implements DevToolsService<DevToolbarPermission> {
|
|
28
|
+
private internalService;
|
|
29
|
+
/**
|
|
30
|
+
* Sets the available permissions that will be displayed in the toolbar tool.
|
|
31
|
+
* Call this in your app initialization to register permissions.
|
|
32
|
+
*
|
|
33
|
+
* @param permissions Array of permissions to display in the toolbar
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* this.permissionsService.setAvailableOptions([
|
|
38
|
+
* {
|
|
39
|
+
* id: 'can-edit-posts',
|
|
40
|
+
* name: 'Edit Posts',
|
|
41
|
+
* description: 'Can edit blog posts',
|
|
42
|
+
* isGranted: false,
|
|
43
|
+
* isForced: false
|
|
44
|
+
* }
|
|
45
|
+
* ]);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
setAvailableOptions(permissions: DevToolbarPermission[]): void;
|
|
49
|
+
/**
|
|
50
|
+
* Gets an observable of permissions that were forced/overridden through the toolbar.
|
|
51
|
+
* Subscribe to this to update your application's permission state.
|
|
52
|
+
*
|
|
53
|
+
* @returns Observable emitting array of forced permissions whenever changes occur
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* this.permissionsService.getForcedValues().subscribe(forcedPermissions => {
|
|
58
|
+
* forcedPermissions.forEach(permission => {
|
|
59
|
+
* this.updatePermission(permission.id, permission.isGranted);
|
|
60
|
+
* });
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
getForcedValues(): Observable<DevToolbarPermission[]>;
|
|
65
|
+
/**
|
|
66
|
+
* Apply a preset permission state. Useful for automated testing scenarios.
|
|
67
|
+
*
|
|
68
|
+
* @param state The forced permissions state to apply
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* this.permissionsService.applyPreset({
|
|
73
|
+
* granted: ['can-edit-posts'],
|
|
74
|
+
* denied: ['can-delete-posts']
|
|
75
|
+
* });
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
applyPreset(state: ForcedPermissionsState): void;
|
|
79
|
+
/**
|
|
80
|
+
* Get the current forced permission state.
|
|
81
|
+
*
|
|
82
|
+
* @returns Current forced permissions state
|
|
83
|
+
*/
|
|
84
|
+
getCurrentState(): ForcedPermissionsState;
|
|
85
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<DevToolbarPermissionsService, never>;
|
|
86
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<DevToolbarPermissionsService>;
|
|
87
|
+
}
|