@decaf-ts/ui-decorators 0.17.1 → 0.17.4

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.
Files changed (127) hide show
  1. package/dist/ui-decorators.cjs +1 -1
  2. package/dist/ui-decorators.cjs.map +1 -1
  3. package/dist/ui-decorators.js.map +1 -1
  4. package/lib/cjs/graph/constants.cjs +1 -1
  5. package/lib/cjs/graph/constants.cjs.map +1 -1
  6. package/lib/cjs/graph/decorators.cjs +3 -3
  7. package/lib/cjs/graph/decorators.cjs.map +1 -1
  8. package/lib/cjs/graph/index.cjs +1 -1
  9. package/lib/cjs/graph/index.cjs.map +1 -1
  10. package/lib/cjs/graph/overrides/Rendering.cjs +1 -1
  11. package/lib/cjs/graph/overrides/Rendering.cjs.map +1 -1
  12. package/lib/cjs/graph/overrides/index.cjs +1 -1
  13. package/lib/cjs/graph/overrides/index.cjs.map +1 -1
  14. package/lib/cjs/graph/overrides/overrides.cjs +1 -1
  15. package/lib/cjs/graph/overrides/overrides.cjs.map +1 -1
  16. package/lib/cjs/graph/reader.cjs +89 -6
  17. package/lib/cjs/graph/reader.cjs.map +1 -1
  18. package/lib/cjs/graph/snapshot.cjs +1 -1
  19. package/lib/cjs/graph/snapshot.cjs.map +1 -1
  20. package/lib/cjs/graph/types.cjs +1 -1
  21. package/lib/cjs/graph/types.cjs.map +1 -1
  22. package/lib/cjs/index.cjs +4 -4
  23. package/lib/cjs/index.cjs.map +1 -1
  24. package/lib/cjs/model/Renderable.cjs +1 -1
  25. package/lib/cjs/model/Renderable.cjs.map +1 -1
  26. package/lib/cjs/model/decorators.cjs +1 -1
  27. package/lib/cjs/model/decorators.cjs.map +1 -1
  28. package/lib/cjs/model/index.cjs +1 -1
  29. package/lib/cjs/model/index.cjs.map +1 -1
  30. package/lib/cjs/model/model.cjs +1 -1
  31. package/lib/cjs/model/model.cjs.map +1 -1
  32. package/lib/cjs/model/overrides.cjs +1 -1
  33. package/lib/cjs/model/overrides.cjs.map +1 -1
  34. package/lib/cjs/overrides/ModelBuilderExtensions.cjs +1 -1
  35. package/lib/cjs/overrides/ModelBuilderExtensions.cjs.map +1 -1
  36. package/lib/cjs/overrides/index.cjs +1 -1
  37. package/lib/cjs/overrides/index.cjs.map +1 -1
  38. package/lib/cjs/ui/DecafComponent.cjs +1 -1
  39. package/lib/cjs/ui/DecafComponent.cjs.map +1 -1
  40. package/lib/cjs/ui/DecafEventHandler.cjs +1 -1
  41. package/lib/cjs/ui/DecafEventHandler.cjs.map +1 -1
  42. package/lib/cjs/ui/DecafTranslateService.cjs +1 -1
  43. package/lib/cjs/ui/DecafTranslateService.cjs.map +1 -1
  44. package/lib/cjs/ui/Rendering.cjs +1 -1
  45. package/lib/cjs/ui/Rendering.cjs.map +1 -1
  46. package/lib/cjs/ui/UIValidator.cjs +1 -1
  47. package/lib/cjs/ui/UIValidator.cjs.map +1 -1
  48. package/lib/cjs/ui/constants.cjs +1 -1
  49. package/lib/cjs/ui/constants.cjs.map +1 -1
  50. package/lib/cjs/ui/decorators.cjs +3 -22
  51. package/lib/cjs/ui/decorators.cjs.map +1 -1
  52. package/lib/cjs/ui/errors.cjs +1 -1
  53. package/lib/cjs/ui/errors.cjs.map +1 -1
  54. package/lib/cjs/ui/index.cjs +2 -2
  55. package/lib/cjs/ui/index.cjs.map +1 -1
  56. package/lib/cjs/ui/interfaces/IDecafModal.cjs +4 -0
  57. package/lib/cjs/ui/interfaces/IDecafModal.cjs.map +1 -0
  58. package/lib/cjs/ui/interfaces/IDecafRouter.cjs +4 -0
  59. package/lib/cjs/ui/interfaces/IDecafRouter.cjs.map +1 -0
  60. package/lib/cjs/ui/interfaces/IDecafSpinner.cjs +4 -0
  61. package/lib/cjs/ui/interfaces/IDecafSpinner.cjs.map +1 -0
  62. package/lib/cjs/ui/interfaces/IDecafToast.cjs +4 -0
  63. package/lib/cjs/ui/interfaces/IDecafToast.cjs.map +1 -0
  64. package/lib/cjs/ui/interfaces/index.cjs +22 -0
  65. package/lib/cjs/ui/interfaces/index.cjs.map +1 -0
  66. package/lib/cjs/ui/overrides.cjs +1 -1
  67. package/lib/cjs/ui/overrides.cjs.map +1 -1
  68. package/lib/cjs/ui/types.cjs +1 -1
  69. package/lib/cjs/ui/types.cjs.map +1 -1
  70. package/lib/cjs/ui/utils.cjs +1 -1
  71. package/lib/cjs/ui/utils.cjs.map +1 -1
  72. package/lib/cjs/ui/validator.cjs +1 -1
  73. package/lib/cjs/ui/validator.cjs.map +1 -1
  74. package/lib/esm/graph/decorators.js +2 -2
  75. package/lib/esm/graph/decorators.js.map +1 -1
  76. package/lib/esm/graph/reader.js +88 -5
  77. package/lib/esm/graph/reader.js.map +1 -1
  78. package/lib/esm/index.js +3 -3
  79. package/lib/esm/index.js.map +1 -1
  80. package/lib/esm/model/decorators.js.map +1 -1
  81. package/lib/esm/ui/DecafComponent.js.map +1 -1
  82. package/lib/esm/ui/Rendering.js.map +1 -1
  83. package/lib/esm/ui/decorators.js +2 -21
  84. package/lib/esm/ui/decorators.js.map +1 -1
  85. package/lib/esm/ui/index.js +1 -1
  86. package/lib/esm/ui/index.js.map +1 -1
  87. package/lib/esm/ui/interfaces/IDecafModal.js +10 -0
  88. package/lib/esm/ui/interfaces/IDecafModal.js.map +1 -0
  89. package/lib/esm/ui/interfaces/IDecafRouter.js +2 -0
  90. package/lib/esm/ui/interfaces/IDecafRouter.js.map +1 -0
  91. package/lib/esm/ui/interfaces/IDecafSpinner.js +2 -0
  92. package/lib/esm/ui/interfaces/IDecafSpinner.js.map +1 -0
  93. package/lib/esm/ui/interfaces/IDecafToast.js +2 -0
  94. package/lib/esm/ui/interfaces/IDecafToast.js.map +1 -0
  95. package/lib/esm/ui/interfaces/index.js +5 -0
  96. package/lib/esm/ui/interfaces/index.js.map +1 -0
  97. package/lib/types/graph/constants.d.cts +47 -0
  98. package/lib/types/graph/constants.d.mts +47 -0
  99. package/lib/types/index.d.cts +3 -3
  100. package/lib/types/index.d.mts +3 -3
  101. package/lib/types/model/decorators.d.cts +1 -1
  102. package/lib/types/model/decorators.d.mts +1 -1
  103. package/lib/types/ui/Rendering.d.cts +10 -1
  104. package/lib/types/ui/Rendering.d.mts +10 -1
  105. package/lib/types/ui/decorators.d.cts +7 -6
  106. package/lib/types/ui/decorators.d.mts +7 -6
  107. package/lib/types/ui/index.d.cts +1 -1
  108. package/lib/types/ui/index.d.mts +1 -1
  109. package/lib/types/ui/interfaces/IDecafModal.d.cts +186 -0
  110. package/lib/types/ui/interfaces/IDecafModal.d.mts +186 -0
  111. package/lib/types/ui/interfaces/IDecafRouter.d.cts +108 -0
  112. package/lib/types/ui/interfaces/IDecafRouter.d.mts +108 -0
  113. package/lib/types/ui/interfaces/IDecafSpinner.d.cts +69 -0
  114. package/lib/types/ui/interfaces/IDecafSpinner.d.mts +69 -0
  115. package/lib/types/ui/interfaces/IDecafToast.d.cts +63 -0
  116. package/lib/types/ui/interfaces/IDecafToast.d.mts +63 -0
  117. package/lib/types/ui/interfaces/index.d.cts +4 -0
  118. package/lib/types/ui/interfaces/index.d.mts +4 -0
  119. package/lib/types/ui/types.d.cts +94 -0
  120. package/lib/types/ui/types.d.mts +94 -0
  121. package/package.json +1 -1
  122. package/lib/cjs/ui/interfaces.cjs +0 -4
  123. package/lib/cjs/ui/interfaces.cjs.map +0 -1
  124. package/lib/esm/ui/interfaces.js +0 -10
  125. package/lib/esm/ui/interfaces.js.map +0 -1
  126. package/lib/types/ui/interfaces.d.cts +0 -64
  127. package/lib/types/ui/interfaces.d.mts +0 -64
@@ -0,0 +1,186 @@
1
+ /**
2
+ * @description Interface for modal presentation and lifecycle control in Decaf UI.
3
+ * @summary Describes the public contract for modal configuration, presentation,
4
+ * dismissal, and event handling used by the modal component layer.
5
+ *
6
+ * @module ui/interfaces/IDecafModal
7
+ * @memberOf module:ui-decorators
8
+ */
9
+ import { Model } from "@decaf-ts/decorator-validation";
10
+ import { DecafComponent } from "../DecafComponent.d.mts";
11
+ export interface IDecafModal extends DecafComponent<Model> {
12
+ /**
13
+ * @description Reference to the modal instance controller.
14
+ * @summary Exposes the dismiss capability used to close the modal programmatically.
15
+ */
16
+ modal?: any;
17
+ /**
18
+ * @description Title displayed in the modal header.
19
+ * @summary Optional header text rendered above the modal content.
20
+ */
21
+ title?: string;
22
+ /**
23
+ * @description Controls whether the modal is open.
24
+ * @summary Signals the current presentation state of the modal.
25
+ */
26
+ isOpen: boolean;
27
+ /**
28
+ * @description Optional tag used to identify the modal instance.
29
+ * @summary Provides a stable identifier that can be used by rendering and lookup logic.
30
+ */
31
+ tag?: string;
32
+ /**
33
+ * @description Additional modal configuration options.
34
+ * @summary Stores custom configuration passed into modal creation and presentation.
35
+ */
36
+ options?: Record<string, unknown>;
37
+ /**
38
+ * @description Global configuration values available to the modal.
39
+ * @summary Holds shared runtime data that can be consumed by modal content and handlers.
40
+ */
41
+ globals?: Record<string, unknown>;
42
+ /**
43
+ * @description Inline content rendered inside the modal body.
44
+ * @summary Accepts HTML text or DOM content to be sanitized and displayed.
45
+ */
46
+ inlineContent?: string | any;
47
+ /**
48
+ * @description Position of the inline content within the modal.
49
+ * @summary Determines whether inline content appears before or after the main body.
50
+ */
51
+ inlineContentPosition: "top" | "bottom";
52
+ /**
53
+ * @description Enables fullscreen presentation for the modal.
54
+ * @summary Controls whether the modal occupies the entire viewport.
55
+ */
56
+ fullscreen: boolean;
57
+ /**
58
+ * @description Enables expandable presentation for the modal.
59
+ * @summary Signals whether the modal can be expanded by the user.
60
+ */
61
+ expandable: boolean;
62
+ /**
63
+ * @description Controls border rendering for the modal content.
64
+ * @summary Enables or disables visual borders according to the component styling rules.
65
+ */
66
+ borders: boolean;
67
+ /**
68
+ * @description Enables lightbox presentation for the modal.
69
+ * @summary Controls whether the modal is displayed with a lightbox-style overlay.
70
+ */
71
+ lightBox: boolean;
72
+ /**
73
+ * @description Controls the transparency of the modal header.
74
+ * @summary Indicates whether the modal header should be rendered with a transparent background.
75
+ */
76
+ headerTransparent: boolean;
77
+ /**
78
+ * @description Sets the background color of the modal header.
79
+ * @summary Stores the header color token used to style the modal header region.
80
+ */
81
+ headerBackground: string;
82
+ /**
83
+ * @description Controls the visibility of the modal header.
84
+ * @summary Indicates whether the header section should be rendered.
85
+ */
86
+ showHeader: boolean;
87
+ /**
88
+ * @description Controls the visibility of the modal close button.
89
+ * @summary Indicates whether the close action should be shown in the header.
90
+ */
91
+ showCloseButton: boolean;
92
+ /**
93
+ * @description Emits modal dismiss details.
94
+ * @summary Notifies consumers when the modal is about to be dismissed.
95
+ */
96
+ willDismissEvent: {
97
+ emit(value: unknown): void;
98
+ };
99
+ /**
100
+ * @description Indicates whether the modal content is expanded.
101
+ * @summary Tracks the current expanded or collapsed state of the modal body.
102
+ */
103
+ expanded: boolean;
104
+ /**
105
+ * @description Defines the icon color used by the modal.
106
+ * @summary Stores the color token used for modal icons and actions.
107
+ */
108
+ iconColor: string;
109
+ /**
110
+ * @description Initializes the modal component state.
111
+ * @summary Prepares the modal before presentation and applies inline content sanitization.
112
+ *
113
+ * @return {Promise<void>} Resolves when initialization completes.
114
+ */
115
+ ngOnInit(): Promise<void>;
116
+ /**
117
+ * @description Prepares the modal with the provided options.
118
+ * @summary Merges defaults, applies global runtime settings, and registers custom handlers.
119
+ *
120
+ * @param {Record<string, unknown>} [options={}] Additional modal initialization options.
121
+ * @return {Promise<void>} Resolves when preparation completes.
122
+ */
123
+ prepare(options?: Record<string, unknown>): Promise<void>;
124
+ /**
125
+ * @description Sanitizes and normalizes inline content.
126
+ * @summary Converts DOM content to HTML text when needed and prepares it for safe rendering.
127
+ *
128
+ * @return {void} Does not return a value.
129
+ */
130
+ parseInlineContent(): void;
131
+ /**
132
+ * @description Creates and presents the modal.
133
+ * @summary Prepares the modal, presents it, and returns the active modal instance contract.
134
+ *
135
+ * @param {Record<string, unknown>} [props={}] Modal properties used during creation.
136
+ * @return {Promise<any>} Resolves with the modal instance contract.
137
+ */
138
+ create(props?: Record<string, unknown>): Promise<any>;
139
+ /**
140
+ * @description Presents the modal.
141
+ * @summary Sets the modal as visible and triggers any presentation-time updates.
142
+ *
143
+ * @return {Promise<void>} Resolves when the modal is visible.
144
+ */
145
+ present(): Promise<void>;
146
+ /**
147
+ * @description Handles a custom event triggered by the modal.
148
+ * @summary Stops event propagation when needed and routes the event to confirm or cancel actions.
149
+ *
150
+ * @param {any} event Event payload emitted by the modal.
151
+ * @return {Promise<void>} Resolves when event handling completes.
152
+ */
153
+ handleEvent(event: any): Promise<void>;
154
+ /**
155
+ * @description Handles the modal dismiss event.
156
+ * @summary Emits the dismiss payload and returns the overlay detail object to callers.
157
+ *
158
+ * @param {any} event Dismiss event emitted by the modal.
159
+ * @return {Promise<{ data?: unknown }>} Resolves with the dismiss event details.
160
+ */
161
+ handleWillDismiss(event: any): Promise<{
162
+ data?: unknown;
163
+ }>;
164
+ /**
165
+ * @description Toggles the expanded state of the modal.
166
+ * @summary Switches between expanded and collapsed presentation modes.
167
+ *
168
+ * @return {void} Does not return a value.
169
+ */
170
+ handleExpandToggle(): void;
171
+ /**
172
+ * @description Cancels the modal.
173
+ * @summary Dismisses the modal using the cancel role.
174
+ *
175
+ * @return {Promise<void>} Resolves when the modal has been dismissed.
176
+ */
177
+ cancel(): Promise<void>;
178
+ /**
179
+ * @description Confirms the modal.
180
+ * @summary Dismisses the modal using the confirm role and optional event data.
181
+ *
182
+ * @param {any} [event] Optional event payload forwarded to the dismiss action.
183
+ * @return {Promise<void>} Resolves when the modal has been dismissed.
184
+ */
185
+ confirm(event?: any): Promise<void>;
186
+ }
@@ -0,0 +1,108 @@
1
+ /**
2
+ * @description Contract for router helpers used by Decaf UI components.
3
+ * @summary Defines navigation and query-parameter utilities that abstract the
4
+ * underlying routing implementation for UI components and services.
5
+ *
6
+ * @interface IDecafRouter
7
+ * @since 2026-06-19
8
+ * @memberOf module:ui-decorators/ui/interfaces
9
+ */
10
+ export interface IDecafRouter {
11
+ /**
12
+ * @description Parses query parameters from the current route.
13
+ * @summary Extracts specified query parameters from the current route and returns them
14
+ * as an array of key-value pairs. When no params are provided, all query parameters
15
+ * are extracted.
16
+ *
17
+ * @param {string | string[]} [params] - The parameter name(s) to extract from the route
18
+ *
19
+ * @memberOf module:ui-decorators/ui/interfaces
20
+ */
21
+ parseAllQueryParams(params?: string | string[]): Record<string, any>[];
22
+ /**
23
+ * @description Checks if a query parameter exists in the current route.
24
+ * @summary Determines whether a specific query parameter is present in the current
25
+ * route's query parameters.
26
+ *
27
+ * @param {string} param - The name of the query parameter to check
28
+ * @return {boolean} True if the parameter exists, false otherwise
29
+ *
30
+ * @memberOf module:ui-decorators/ui/interfaces
31
+ */
32
+ hasQueryParam(param: string): boolean;
33
+ /**
34
+ * @description Retrieves a specific query parameter from the current route.
35
+ * @summary Extracts a single query parameter from the current route and returns it
36
+ * as a key-value pair, or undefined if not found.
37
+ *
38
+ * @param {string} param - The name of the query parameter to retrieve
39
+ * @return {Record<string, any> | undefined} A key-value object representing the parameter, or undefined if not found
40
+ *
41
+ * @memberOf module:ui-decorators/ui/interfaces
42
+ */
43
+ getQueryParam(param: string): Record<string, any> | undefined;
44
+ /**
45
+ * @description Retrieves the value of a specific query parameter.
46
+ * @summary Extracts only the string value of a single query parameter from the current
47
+ * route, or undefined if not found.
48
+ *
49
+ * @param {string} param - The name of the query parameter to retrieve
50
+ * @return {string | undefined} The value of the parameter, or undefined if not found
51
+ *
52
+ * @memberOf module:ui-decorators/ui/interfaces
53
+ */
54
+ getQueryParamValue(param: string): string | undefined;
55
+ /**
56
+ * @description Retrieves the last segment of the current URL.
57
+ * @summary Extracts the final path segment from the current URL. Falls back to the
58
+ * browser's window location when the Angular Router URL is unavailable.
59
+ *
60
+ * @return {string} The last segment of the current URL path
61
+ *
62
+ * @memberOf module:ui-decorators/ui/interfaces
63
+ */
64
+ getLastUrlSegment(): string;
65
+ /**
66
+ * @description Retrieves the current URL of the application.
67
+ * @summary Returns the current URL path, stripping the leading forward slash.
68
+ * Falls back to the browser's pathname when the Angular Router returns only '/'.
69
+ *
70
+ * @return {string} The current URL without the leading slash
71
+ *
72
+ * @memberOf module:ui-decorators/ui/interfaces
73
+ */
74
+ getCurrentUrl(): string;
75
+ /**
76
+ * @description Retrieves the URL of the previous page.
77
+ * @summary Extracts the URL of the previous page from the router's navigation history,
78
+ * useful for back navigation and tracking the user's navigation path.
79
+ *
80
+ * @return {string} The URL of the previous page
81
+ *
82
+ * @memberOf module:ui-decorators/ui/interfaces
83
+ */
84
+ getPreviousUrl(): string;
85
+ /**
86
+ * @description Navigates back to the previous page.
87
+ * @summary Dispatches a {@link ComponentEventNames.BackButtonClickEvent} custom event
88
+ * and then triggers browser back navigation via Angular's Location service.
89
+ *
90
+ * @return {void}
91
+ *
92
+ * @memberOf module:ui-decorators/ui/interfaces
93
+ */
94
+ backToLastPage(): void;
95
+ /**
96
+ * @description Navigates to a specified page.
97
+ * @summary Triggers navigation to the given page using the Ionic NavController,
98
+ * supporting ROOT, FORWARD, and BACK directions.
99
+ *
100
+ * @param {string} page - The target page path
101
+ * @param {"forward" | "back" | "root"} [direction] - The direction of navigation (default: FORWARD)
102
+ * @param {Record<string, any>} [options] - Additional navigation options
103
+ * @return {Promise<boolean>} Resolves to true if navigation succeeds, false otherwise
104
+ *
105
+ * @memberOf module:ui-decorators/ui/interfaces
106
+ */
107
+ navigate(page: string, direction?: "forward" | "back" | "root", options?: Record<string, any>): Promise<boolean>;
108
+ }
@@ -0,0 +1,108 @@
1
+ /**
2
+ * @description Contract for router helpers used by Decaf UI components.
3
+ * @summary Defines navigation and query-parameter utilities that abstract the
4
+ * underlying routing implementation for UI components and services.
5
+ *
6
+ * @interface IDecafRouter
7
+ * @since 2026-06-19
8
+ * @memberOf module:ui-decorators/ui/interfaces
9
+ */
10
+ export interface IDecafRouter {
11
+ /**
12
+ * @description Parses query parameters from the current route.
13
+ * @summary Extracts specified query parameters from the current route and returns them
14
+ * as an array of key-value pairs. When no params are provided, all query parameters
15
+ * are extracted.
16
+ *
17
+ * @param {string | string[]} [params] - The parameter name(s) to extract from the route
18
+ *
19
+ * @memberOf module:ui-decorators/ui/interfaces
20
+ */
21
+ parseAllQueryParams(params?: string | string[]): Record<string, any>[];
22
+ /**
23
+ * @description Checks if a query parameter exists in the current route.
24
+ * @summary Determines whether a specific query parameter is present in the current
25
+ * route's query parameters.
26
+ *
27
+ * @param {string} param - The name of the query parameter to check
28
+ * @return {boolean} True if the parameter exists, false otherwise
29
+ *
30
+ * @memberOf module:ui-decorators/ui/interfaces
31
+ */
32
+ hasQueryParam(param: string): boolean;
33
+ /**
34
+ * @description Retrieves a specific query parameter from the current route.
35
+ * @summary Extracts a single query parameter from the current route and returns it
36
+ * as a key-value pair, or undefined if not found.
37
+ *
38
+ * @param {string} param - The name of the query parameter to retrieve
39
+ * @return {Record<string, any> | undefined} A key-value object representing the parameter, or undefined if not found
40
+ *
41
+ * @memberOf module:ui-decorators/ui/interfaces
42
+ */
43
+ getQueryParam(param: string): Record<string, any> | undefined;
44
+ /**
45
+ * @description Retrieves the value of a specific query parameter.
46
+ * @summary Extracts only the string value of a single query parameter from the current
47
+ * route, or undefined if not found.
48
+ *
49
+ * @param {string} param - The name of the query parameter to retrieve
50
+ * @return {string | undefined} The value of the parameter, or undefined if not found
51
+ *
52
+ * @memberOf module:ui-decorators/ui/interfaces
53
+ */
54
+ getQueryParamValue(param: string): string | undefined;
55
+ /**
56
+ * @description Retrieves the last segment of the current URL.
57
+ * @summary Extracts the final path segment from the current URL. Falls back to the
58
+ * browser's window location when the Angular Router URL is unavailable.
59
+ *
60
+ * @return {string} The last segment of the current URL path
61
+ *
62
+ * @memberOf module:ui-decorators/ui/interfaces
63
+ */
64
+ getLastUrlSegment(): string;
65
+ /**
66
+ * @description Retrieves the current URL of the application.
67
+ * @summary Returns the current URL path, stripping the leading forward slash.
68
+ * Falls back to the browser's pathname when the Angular Router returns only '/'.
69
+ *
70
+ * @return {string} The current URL without the leading slash
71
+ *
72
+ * @memberOf module:ui-decorators/ui/interfaces
73
+ */
74
+ getCurrentUrl(): string;
75
+ /**
76
+ * @description Retrieves the URL of the previous page.
77
+ * @summary Extracts the URL of the previous page from the router's navigation history,
78
+ * useful for back navigation and tracking the user's navigation path.
79
+ *
80
+ * @return {string} The URL of the previous page
81
+ *
82
+ * @memberOf module:ui-decorators/ui/interfaces
83
+ */
84
+ getPreviousUrl(): string;
85
+ /**
86
+ * @description Navigates back to the previous page.
87
+ * @summary Dispatches a {@link ComponentEventNames.BackButtonClickEvent} custom event
88
+ * and then triggers browser back navigation via Angular's Location service.
89
+ *
90
+ * @return {void}
91
+ *
92
+ * @memberOf module:ui-decorators/ui/interfaces
93
+ */
94
+ backToLastPage(): void;
95
+ /**
96
+ * @description Navigates to a specified page.
97
+ * @summary Triggers navigation to the given page using the Ionic NavController,
98
+ * supporting ROOT, FORWARD, and BACK directions.
99
+ *
100
+ * @param {string} page - The target page path
101
+ * @param {"forward" | "back" | "root"} [direction] - The direction of navigation (default: FORWARD)
102
+ * @param {Record<string, any>} [options] - Additional navigation options
103
+ * @return {Promise<boolean>} Resolves to true if navigation succeeds, false otherwise
104
+ *
105
+ * @memberOf module:ui-decorators/ui/interfaces
106
+ */
107
+ navigate(page: string, direction?: "forward" | "back" | "root", options?: Record<string, any>): Promise<boolean>;
108
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @description Contract for loading overlay management in Decaf applications.
3
+ * @summary Defines the public API for displaying, updating, and dismissing loading overlays
4
+ * with optional progress tracking and message updates.
5
+ *
6
+ * @interface IDecafSpinner
7
+ * @since 2026-06-19
8
+ * @memberOf module:ui-decorators/ui/interfaces
9
+ */
10
+ export interface IDecafSpinner {
11
+ /**
12
+ * @description Checks if a loading overlay is currently visible.
13
+ * @summary Returns true when a loading overlay is active and displayed to the user.
14
+ *
15
+ * @returns {boolean} True if a loading overlay is visible, false otherwise
16
+ * @memberOf module:ui-decorators/ui/interfaces
17
+ */
18
+ isVisible(): boolean;
19
+ /**
20
+ * @description Displays a loading overlay with the specified message and options.
21
+ * @summary Creates and presents a loading overlay. If one is already visible,
22
+ * updates the existing overlay instead of creating a new one.
23
+ *
24
+ * @param {string | Record<string, any>} message - The message to display, or a full options object
25
+ * @param {Record<string, any>} [options] - Optional configuration for the loading overlay
26
+ * @returns {Promise<void>} Resolves when the loading overlay is displayed
27
+ * @memberOf module:ui-decorators/ui/interfaces
28
+ */
29
+ show(message: string | Record<string, any>, options?: Record<string, any>): Promise<void>;
30
+ /**
31
+ * @description Updates the loading overlay message and optionally tracks progress.
32
+ * @summary Modifies the current overlay message. When {@link isProgressUpdate} is a number,
33
+ * displays progress as a percentage. When no overlay exists, creates one with a default duration.
34
+ *
35
+ * @param {string} message - The new message to display
36
+ * @param {boolean | number} [isProgressUpdate=false] - Progress percentage (number) or flag (boolean)
37
+ * @returns {Promise<void>} Resolves when the update is applied
38
+ * @memberOf module:ui-decorators/ui/interfaces
39
+ */
40
+ update(message: string, isProgressUpdate?: boolean | number): Promise<void>;
41
+ /**
42
+ * @description Removes the loading overlay from display.
43
+ * @summary Dismisses the active loading overlay and resets internal progress state.
44
+ * Safe to call even when no overlay is active.
45
+ *
46
+ * @returns {Promise<void>} Resolves when the overlay is dismissed
47
+ * @memberOf module:ui-decorators/ui/interfaces
48
+ */
49
+ remove(): Promise<void>;
50
+ /**
51
+ * @description Merges custom options with the default loading configuration.
52
+ * @summary Combines defaults with user-provided options. The {@link message} parameter
53
+ * takes precedence over any message set in {@link options}.
54
+ *
55
+ * @param {Record<string, any>} [options={}] - Custom loading options to merge
56
+ * @param {string} [message] - Optional message override
57
+ * @returns {Promise<Record<string, any>>} The merged configuration object
58
+ * @memberOf module:ui-decorators/ui/interfaces
59
+ */
60
+ getOptions(options?: Record<string, any>, message?: string): Promise<Record<string, any>>;
61
+ /**
62
+ * @description Retrieves the current loading message.
63
+ * @summary Returns the message currently being displayed in the active loading overlay.
64
+ *
65
+ * @returns {Promise<string>} Resolves to the current loading message
66
+ * @memberOf module:ui-decorators/ui/interfaces
67
+ */
68
+ getMessage(): Promise<string>;
69
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * @description Contract for loading overlay management in Decaf applications.
3
+ * @summary Defines the public API for displaying, updating, and dismissing loading overlays
4
+ * with optional progress tracking and message updates.
5
+ *
6
+ * @interface IDecafSpinner
7
+ * @since 2026-06-19
8
+ * @memberOf module:ui-decorators/ui/interfaces
9
+ */
10
+ export interface IDecafSpinner {
11
+ /**
12
+ * @description Checks if a loading overlay is currently visible.
13
+ * @summary Returns true when a loading overlay is active and displayed to the user.
14
+ *
15
+ * @returns {boolean} True if a loading overlay is visible, false otherwise
16
+ * @memberOf module:ui-decorators/ui/interfaces
17
+ */
18
+ isVisible(): boolean;
19
+ /**
20
+ * @description Displays a loading overlay with the specified message and options.
21
+ * @summary Creates and presents a loading overlay. If one is already visible,
22
+ * updates the existing overlay instead of creating a new one.
23
+ *
24
+ * @param {string | Record<string, any>} message - The message to display, or a full options object
25
+ * @param {Record<string, any>} [options] - Optional configuration for the loading overlay
26
+ * @returns {Promise<void>} Resolves when the loading overlay is displayed
27
+ * @memberOf module:ui-decorators/ui/interfaces
28
+ */
29
+ show(message: string | Record<string, any>, options?: Record<string, any>): Promise<void>;
30
+ /**
31
+ * @description Updates the loading overlay message and optionally tracks progress.
32
+ * @summary Modifies the current overlay message. When {@link isProgressUpdate} is a number,
33
+ * displays progress as a percentage. When no overlay exists, creates one with a default duration.
34
+ *
35
+ * @param {string} message - The new message to display
36
+ * @param {boolean | number} [isProgressUpdate=false] - Progress percentage (number) or flag (boolean)
37
+ * @returns {Promise<void>} Resolves when the update is applied
38
+ * @memberOf module:ui-decorators/ui/interfaces
39
+ */
40
+ update(message: string, isProgressUpdate?: boolean | number): Promise<void>;
41
+ /**
42
+ * @description Removes the loading overlay from display.
43
+ * @summary Dismisses the active loading overlay and resets internal progress state.
44
+ * Safe to call even when no overlay is active.
45
+ *
46
+ * @returns {Promise<void>} Resolves when the overlay is dismissed
47
+ * @memberOf module:ui-decorators/ui/interfaces
48
+ */
49
+ remove(): Promise<void>;
50
+ /**
51
+ * @description Merges custom options with the default loading configuration.
52
+ * @summary Combines defaults with user-provided options. The {@link message} parameter
53
+ * takes precedence over any message set in {@link options}.
54
+ *
55
+ * @param {Record<string, any>} [options={}] - Custom loading options to merge
56
+ * @param {string} [message] - Optional message override
57
+ * @returns {Promise<Record<string, any>>} The merged configuration object
58
+ * @memberOf module:ui-decorators/ui/interfaces
59
+ */
60
+ getOptions(options?: Record<string, any>, message?: string): Promise<Record<string, any>>;
61
+ /**
62
+ * @description Retrieves the current loading message.
63
+ * @summary Returns the message currently being displayed in the active loading overlay.
64
+ *
65
+ * @returns {Promise<string>} Resolves to the current loading message
66
+ * @memberOf module:ui-decorators/ui/interfaces
67
+ */
68
+ getMessage(): Promise<string>;
69
+ }
@@ -0,0 +1,63 @@
1
+ import { DecafToastOptions, DecafToastRole } from "../types.d.cts";
2
+ /**
3
+ * @description Contract for toast notification management in Decaf applications.
4
+ * @summary Defines the public API for displaying toast messages with semantic types
5
+ * (error, success, warning, info), custom options, and dismissal role tracking.
6
+ *
7
+ * @interface IDecafToast
8
+ * @since 2026-06-19
9
+ * @memberOf module:ui-decorators/ui/interfaces
10
+ */
11
+ export interface IDecafToast {
12
+ options: DecafToastOptions;
13
+ /**
14
+ * @description Displays an error toast with danger styling.
15
+ * @summary Presents a toast with the danger color and waits for dismissal,
16
+ * returning the role that caused it.
17
+ *
18
+ * @param {string} message - The error message to display
19
+ * @returns {Promise<DecafToastRole>} Resolves with the dismissal role
20
+ * @memberOf module:ui-decorators/ui/interfaces
21
+ */
22
+ error(message: string): Promise<DecafToastRole>;
23
+ /**
24
+ * @description Creates and presents a toast from a full options object.
25
+ * @summary Convenience wrapper around {@link show} for callers that already
26
+ * have a complete {@link DecafToastOptions} object.
27
+ *
28
+ * @param {DecafToastOptions} options - Full toast configuration options
29
+ * @returns {Promise<object>} Resolves with the created toast element
30
+ * @memberOf module:ui-decorators/ui/interfaces
31
+ */
32
+ create(options: DecafToastOptions): Promise<object>;
33
+ /**
34
+ * @description Displays an informational toast with default styling.
35
+ * @summary Presents a toast without a semantic color, suitable for neutral messages.
36
+ * Additional options can override the defaults.
37
+ *
38
+ * @param {string} message - The informational message to display
39
+ * @param {DecafToastOptions} [options={}] - Optional overrides for toast configuration
40
+ * @returns {Promise<void>} Resolves when the toast is presented
41
+ * @memberOf module:ui-decorators/ui/interfaces
42
+ */
43
+ show(message: string, options?: DecafToastOptions): Promise<void>;
44
+ /**
45
+ * @description Displays a success toast with success styling.
46
+ * @summary Presents a toast with the success color for positive feedback messages.
47
+ *
48
+ * @param {string} message - The success message to display
49
+ * @returns {Promise<void>} Resolves when the toast is presented
50
+ * @memberOf module:ui-decorators/ui/interfaces
51
+ */
52
+ success(message: string): Promise<void>;
53
+ /**
54
+ * @description Displays a warning toast with warning styling.
55
+ * @summary Presents a toast with the warning color and waits for dismissal,
56
+ * returning the role that caused it.
57
+ *
58
+ * @param {string} message - The warning message to display
59
+ * @returns {Promise<DecafToastRole>} Resolves with the dismissal role
60
+ * @memberOf module:ui-decorators/ui/interfaces
61
+ */
62
+ warn(message: string): Promise<DecafToastRole>;
63
+ }
@@ -0,0 +1,63 @@
1
+ import { DecafToastOptions, DecafToastRole } from "../types.d.mts";
2
+ /**
3
+ * @description Contract for toast notification management in Decaf applications.
4
+ * @summary Defines the public API for displaying toast messages with semantic types
5
+ * (error, success, warning, info), custom options, and dismissal role tracking.
6
+ *
7
+ * @interface IDecafToast
8
+ * @since 2026-06-19
9
+ * @memberOf module:ui-decorators/ui/interfaces
10
+ */
11
+ export interface IDecafToast {
12
+ options: DecafToastOptions;
13
+ /**
14
+ * @description Displays an error toast with danger styling.
15
+ * @summary Presents a toast with the danger color and waits for dismissal,
16
+ * returning the role that caused it.
17
+ *
18
+ * @param {string} message - The error message to display
19
+ * @returns {Promise<DecafToastRole>} Resolves with the dismissal role
20
+ * @memberOf module:ui-decorators/ui/interfaces
21
+ */
22
+ error(message: string): Promise<DecafToastRole>;
23
+ /**
24
+ * @description Creates and presents a toast from a full options object.
25
+ * @summary Convenience wrapper around {@link show} for callers that already
26
+ * have a complete {@link DecafToastOptions} object.
27
+ *
28
+ * @param {DecafToastOptions} options - Full toast configuration options
29
+ * @returns {Promise<object>} Resolves with the created toast element
30
+ * @memberOf module:ui-decorators/ui/interfaces
31
+ */
32
+ create(options: DecafToastOptions): Promise<object>;
33
+ /**
34
+ * @description Displays an informational toast with default styling.
35
+ * @summary Presents a toast without a semantic color, suitable for neutral messages.
36
+ * Additional options can override the defaults.
37
+ *
38
+ * @param {string} message - The informational message to display
39
+ * @param {DecafToastOptions} [options={}] - Optional overrides for toast configuration
40
+ * @returns {Promise<void>} Resolves when the toast is presented
41
+ * @memberOf module:ui-decorators/ui/interfaces
42
+ */
43
+ show(message: string, options?: DecafToastOptions): Promise<void>;
44
+ /**
45
+ * @description Displays a success toast with success styling.
46
+ * @summary Presents a toast with the success color for positive feedback messages.
47
+ *
48
+ * @param {string} message - The success message to display
49
+ * @returns {Promise<void>} Resolves when the toast is presented
50
+ * @memberOf module:ui-decorators/ui/interfaces
51
+ */
52
+ success(message: string): Promise<void>;
53
+ /**
54
+ * @description Displays a warning toast with warning styling.
55
+ * @summary Presents a toast with the warning color and waits for dismissal,
56
+ * returning the role that caused it.
57
+ *
58
+ * @param {string} message - The warning message to display
59
+ * @returns {Promise<DecafToastRole>} Resolves with the dismissal role
60
+ * @memberOf module:ui-decorators/ui/interfaces
61
+ */
62
+ warn(message: string): Promise<DecafToastRole>;
63
+ }
@@ -0,0 +1,4 @@
1
+ export * from "./IDecafModal.d.cts";
2
+ export * from "./IDecafToast.d.cts";
3
+ export * from "./IDecafSpinner.d.cts";
4
+ export * from "./IDecafRouter.d.cts";