@transcommerce/cwm-shared 1.1.87 → 1.1.90

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 (31) hide show
  1. package/fesm2022/transcommerce-cwm-shared.mjs +1462 -444
  2. package/fesm2022/transcommerce-cwm-shared.mjs.map +1 -1
  3. package/lib/components/external-navigation/external-navigation.component.d.ts +1 -1
  4. package/lib/components/navigate-to-route/navigate-to-route.component.d.ts +1 -1
  5. package/lib/components/page-not-found/page-not-found.component.d.ts +1 -1
  6. package/lib/cwm-shared-standalone.d.ts +19 -0
  7. package/lib/helpers/async-utils.d.ts +31 -3
  8. package/lib/helpers/jwt.d.ts +35 -0
  9. package/lib/helpers/time-span.d.ts +344 -0
  10. package/lib/helpers/utilities.d.ts +301 -0
  11. package/lib/models/slide.d.ts +43 -0
  12. package/lib/models/style/color-style.d.ts +2 -2
  13. package/lib/models/style/coordinates-style.d.ts +21 -2
  14. package/lib/models/style/font-style.d.ts +39 -2
  15. package/lib/models/style/hex-color.d.ts +8 -0
  16. package/lib/models/style/image-style.d.ts +57 -3
  17. package/lib/models/style/justifications.d.ts +8 -0
  18. package/lib/models/style/named-colors.d.ts +8 -0
  19. package/lib/models/style/ng-style-attribute.d.ts +14 -0
  20. package/lib/models/style/on-style.d.ts +2 -2
  21. package/lib/models/style/rgba-color-style.d.ts +42 -2
  22. package/lib/models/style/size-style.d.ts +20 -3
  23. package/lib/models/style/text-style.d.ts +65 -2
  24. package/lib/modules/cwm-shared.module.d.ts +25 -10
  25. package/lib/pipes/safe-html.pipe.d.ts +1 -1
  26. package/lib/services/local-storage.service.d.ts +2 -0
  27. package/package.json +1 -1
  28. package/public-api.d.ts +10 -10
  29. package/lib/helpers/db-keys.d.ts +0 -18
  30. package/lib/helpers/time-span-overflow-error.d.ts +0 -2
  31. package/lib/models/style/ng-style-item.d.ts +0 -3
@@ -1,5 +1,25 @@
1
1
  import { HttpResponse, HttpResponseBase } from '@angular/common/http';
2
2
  import * as i0 from "@angular/core";
3
+ /**
4
+ * A comprehensive utility service providing static helper methods for common operations across the application.
5
+ *
6
+ * This service includes utilities for:
7
+ * - **Cookie Management**: Getting, setting, removing, and checking cookies with proper encoding
8
+ * - **Security**: Scrubbing sensitive data from logs to prevent accidental exposure of PII and credentials
9
+ * - **HTTP Response Handling**: Parsing and extracting meaningful messages from HTTP responses and errors
10
+ * - **Date/Time Formatting**: Converting dates to various human-readable formats and calculating durations
11
+ * - **String Manipulation**: Case conversion, text expansion, trimming, and parsing operations
12
+ * - **Data Processing**: Array operations, deep cloning, searching, and JSON parsing with fallback handling
13
+ * - **Validation**: Type checking, URL validation, and network connectivity checks
14
+ *
15
+ * @example
16
+ * // Using static utility methods
17
+ * const scrubbedLog = Utilities.scrubForLog(sensitiveData);
18
+ * const formattedDate = Utilities.printFriendlyDate(new Date());
19
+ * const errorMessage = Utilities.getHttpResponseMessage(httpError);
20
+ *
21
+ * @injectable
22
+ */
3
23
  export declare class Utilities {
4
24
  static readonly captionAndMessageSeparator = ":";
5
25
  static readonly noNetworkMessageCaption = "No Network";
@@ -8,11 +28,53 @@ export declare class Utilities {
8
28
  static readonly accessDeniedMessageDetail = "";
9
29
  static readonly notFoundMessageCaption = "Not Found";
10
30
  static readonly notFoundMessageDetail = "The target resource cannot be found";
31
+ /**
32
+ * Cookie management utilities providing cross-browser compatible methods for cookie operations.
33
+ * All cookie keys and values are properly URL-encoded/decoded to handle special characters safely.
34
+ *
35
+ * Methods:
36
+ * - getItem: Retrieves a cookie value by name, returns null if not found
37
+ * - setItem: Sets a cookie with optional expiration, path, domain, and secure flags
38
+ * - removeItem: Removes a cookie by setting its expiration to the past
39
+ * - hasItem: Checks if a cookie exists
40
+ * - keys: Returns an array of all cookie names
41
+ */
11
42
  static cookies: {
43
+ /**
44
+ * Retrieves the value of a cookie by its name with proper URL decoding.
45
+ * @param sKey The cookie name to retrieve
46
+ * @returns The decoded cookie value or null if not found
47
+ */
12
48
  getItem: (sKey: string) => string | null;
49
+ /**
50
+ * Sets a cookie with optional expiration, domain, path, and secure flag.
51
+ * @param sKey The cookie name
52
+ * @param sValue The cookie value
53
+ * @param vEnd The expiration (Number for max-age in seconds, String for expires date, Date object, or null for session cookie)
54
+ * @param sPath The path scope for the cookie (defaults to all paths if empty)
55
+ * @param sDomain The domain scope for the cookie (defaults to current domain if empty)
56
+ * @param bSecure Whether to set the Secure flag (cookie only sent over HTTPS)
57
+ * @returns true if the cookie was set successfully, false otherwise
58
+ */
13
59
  setItem: (sKey: string, sValue: string, vEnd: any, sPath: string, sDomain: string, bSecure: unknown) => boolean;
60
+ /**
61
+ * Removes a cookie by setting its expiration to a past date.
62
+ * @param sKey The cookie name to remove
63
+ * @param sPath The path scope (must match the path used when setting the cookie)
64
+ * @param sDomain The domain scope (must match the domain used when setting the cookie)
65
+ * @returns true if the removal was attempted, false if key was invalid
66
+ */
14
67
  removeItem: (sKey: string | number | boolean, sPath: string, sDomain: string) => boolean;
68
+ /**
69
+ * Checks if a cookie with the specified name exists.
70
+ * @param sKey The cookie name to check
71
+ * @returns true if the cookie exists, false otherwise
72
+ */
15
73
  hasItem: (sKey: string | number | boolean) => boolean;
74
+ /**
75
+ * Retrieves all cookie names as an array.
76
+ * @returns An array of all cookie names with proper URL decoding applied
77
+ */
16
78
  keys: () => string[];
17
79
  };
18
80
  /** Scrubs sensitive information from logs, such as email addresses, JWTs, tokens, GUIDs, credit card numbers, SSNs, phone numbers, and common password/username patterns.
@@ -30,49 +92,288 @@ export declare class Utilities {
30
92
  * console.log(scrubbedData);
31
93
  */
32
94
  static scrubForLog(input: any): string;
95
+ /**
96
+ * Extracts all messages from an HTTP response or error, formatting them as key-value pairs.
97
+ * Automatically detects network errors, access denied, and not found responses with special formatting.
98
+ *
99
+ * @param data The HTTP response or error object
100
+ * @returns An array of formatted message strings in the format "Key: Value"
101
+ */
33
102
  static getHttpResponseMessages(data: HttpResponseBase): string[];
103
+ /**
104
+ * Extracts a single consolidated message from an HTTP response or error.
105
+ * Searches in priority order: network message, not found message, error_description, error, then general response messages.
106
+ *
107
+ * @param data The HTTP response or error object
108
+ * @returns A single formatted message string
109
+ */
34
110
  static getHttpResponseMessage(data: HttpResponseBase | any): string;
111
+ /**
112
+ * Searches for a specific message within HTTP response messages.
113
+ * Can search in caption only or in full message text, and can optionally include the caption in the result.
114
+ *
115
+ * @param messageToFind The message or caption text to search for (case-insensitive)
116
+ * @param data The HTTP response or error object
117
+ * @param searchInCaptionOnly If true, only searches in the caption portion (before separator), defaults to true
118
+ * @param includeCaptionInResult If true, includes the caption in the returned result, defaults to false
119
+ * @returns The matching message or null if not found
120
+ */
35
121
  static findHttpResponseMessage(messageToFind: string, data: HttpResponse<any> | any, searchInCaptionOnly?: boolean, includeCaptionInResult?: boolean): any;
122
+ /**
123
+ * Extracts the response body from an HTTP response or error.
124
+ * For successful responses, returns the body property. For error responses, prioritizes error over message and statusText.
125
+ *
126
+ * @param response The HTTP response or error response
127
+ * @returns The response body, error, or null if none available
128
+ */
36
129
  static getResponseBody(response: HttpResponseBase): any;
130
+ /**
131
+ * Checks if the response indicates a network error (status 0).
132
+ * @param response The HTTP response to check
133
+ * @returns true if status is 0 (no network connection), false otherwise
134
+ */
37
135
  static checkNoNetwork(response: HttpResponseBase): boolean;
136
+ /**
137
+ * Checks if the response indicates an access denied error (status 403).
138
+ * @param response The HTTP response to check
139
+ * @returns true if status is 403 (Forbidden), false otherwise
140
+ */
38
141
  static checkAccessDenied(response: HttpResponseBase): boolean;
142
+ /**
143
+ * Checks if the response indicates a not found error (status 404).
144
+ * @param response The HTTP response to check
145
+ * @returns true if status is 404 (Not Found), false otherwise
146
+ */
39
147
  static checkNotFound(response: HttpResponseBase): boolean;
148
+ /**
149
+ * Validates if a URL points to localhost or 127.0.0.1.
150
+ * @param url The URL to check
151
+ * @param base Optional base URL for resolving relative URLs
152
+ * @returns true if the URL hostname is localhost or 127.0.0.1, false otherwise
153
+ */
40
154
  static checkIsLocalHost(url: string, base?: string): boolean;
155
+ /**
156
+ * Parses a query parameter string into a key-value object.
157
+ * Handles standard URL query string format (key=value&key=value).
158
+ *
159
+ * @param paramString The query parameter string (e.g., "id=123&name=test")
160
+ * @returns An object with key-value pairs, or null if paramString is empty
161
+ */
41
162
  static getQueryParamsFromString(paramString: string): {
42
163
  [key: string]: string;
43
164
  } | null;
165
+ /**
166
+ * Splits a string into two parts based on the first occurrence of a separator.
167
+ * Both parts are trimmed of whitespace.
168
+ *
169
+ * @param text The text to split
170
+ * @param separator The separator string to split on
171
+ * @returns An object with firstPart and secondPart (secondPart is null if separator not found)
172
+ */
44
173
  static splitInTwo(text: string, separator: string): {
45
174
  firstPart: string;
46
175
  secondPart: any;
47
176
  };
177
+ /**
178
+ * Safely stringifies an object, filtering out complex types and handling circular references.
179
+ * If direct JSON.stringify fails, creates a sanitized object containing only primitive properties.
180
+ *
181
+ * @param object The object to stringify
182
+ * @returns A JSON string representation of the object, or a sanitized version if stringification fails
183
+ */
48
184
  static safeStringify(object: {
49
185
  [x: string]: any;
50
186
  hasOwnProperty: (arg0: string) => any;
51
187
  }): string;
188
+ /**
189
+ * Safely parses a JSON string with fallback handling.
190
+ * Returns the parsed object if valid JSON, or returns undefined/value if parsing fails.
191
+ *
192
+ * @param value The JSON string to parse
193
+ * @returns The parsed object, 'undefined' if the string is 'undefined', or the original value if parsing fails
194
+ */
52
195
  static JsonTryParse(value: string): any;
196
+ /**
197
+ * Checks if an object has no properties.
198
+ * @param obj The object to check
199
+ * @returns true if the object is empty (no own properties), false otherwise
200
+ */
53
201
  static TestIsObjectEmpty(obj: any): boolean;
202
+ /**
203
+ * Checks if a value is undefined.
204
+ * @param value The value to check
205
+ * @returns true if the value is undefined, false otherwise
206
+ */
54
207
  static TestIsUndefined(value: any): value is undefined;
208
+ /**
209
+ * Checks if a value is a string.
210
+ * @param value The value to check
211
+ * @returns true if the value is a string primitive or String object, false otherwise
212
+ */
55
213
  static TestIsString(value: any): value is string | String;
214
+ /**
215
+ * Capitalizes the first letter of a string while leaving the rest unchanged.
216
+ * @param text The text to capitalize
217
+ * @returns The text with the first character uppercased, or the original text if empty
218
+ */
56
219
  static capitalizeFirstLetter(text: string): string;
220
+ /**
221
+ * Converts a string to title case, capitalizing the first letter of each word.
222
+ * @param text The text to convert to title case
223
+ * @returns The text in title case format
224
+ */
57
225
  static toTitleCase(text: string): string;
226
+ /**
227
+ * Converts a string or array of strings to lowercase.
228
+ * Supports overloaded signatures for both single string and array inputs.
229
+ *
230
+ * @param items A string or array of strings to convert to lowercase
231
+ * @returns The lowercased string or array of lowercased strings
232
+ */
58
233
  static toLowerCase(items: string): any;
59
234
  static toLowerCase(items: string[]): any;
235
+ /**
236
+ * Generates a unique random ID string.
237
+ * @returns A string representation of a random number between 1,000,000 and 9,000,000
238
+ */
60
239
  static uniqueId(): string;
240
+ /**
241
+ * Generates a random integer within a specified range (inclusive).
242
+ * @param min The minimum value (inclusive)
243
+ * @param max The maximum value (inclusive)
244
+ * @returns A random integer between min and max
245
+ */
61
246
  static randomNumber(min: number, max: number): number;
247
+ /**
248
+ * Gets the base URL of the current application.
249
+ * Handles cases where window.location.origin is not available by constructing it from components.
250
+ *
251
+ * @returns The base URL without trailing slash (e.g., "http://localhost:4200")
252
+ */
62
253
  static baseUrl(): string;
254
+ /**
255
+ * Formats a date to display only the date portion in human-readable format.
256
+ * Example output: "Monday, 1st January 2024"
257
+ *
258
+ * @param date The date to format
259
+ * @returns A formatted date string with day of week, day of month with ordinal suffix, month name, and year
260
+ */
63
261
  static printDateOnly(date: Date): string;
262
+ /**
263
+ * Formats a date to display only the time portion in 12-hour format with AM/PM.
264
+ * Example output: "2:30 PM"
265
+ *
266
+ * @param date The date to format
267
+ * @returns A formatted time string in HH:MM AM/PM format
268
+ */
64
269
  static printTimeOnly(date: Date): string;
270
+ /**
271
+ * Combines date and time formatting into a single readable string.
272
+ * Example output: "Monday, 1st January 2024 at 2:30 PM"
273
+ *
274
+ * @param date The date to format
275
+ * @param separator The text to insert between date and time (defaults to 'at')
276
+ * @returns A combined date and time string
277
+ */
65
278
  static printDate(date: Date, separator?: string): string;
279
+ /**
280
+ * Formats a date using friendly relative terminology for recent dates.
281
+ * Returns "Today", "Yesterday", or full date for older dates.
282
+ *
283
+ * @param date The date to format
284
+ * @param separator The text to insert between "Today"/"Yesterday" and time (defaults to '-')
285
+ * @returns A friendly date string (e.g., "Today - 2:30 PM" or full date for older dates)
286
+ */
66
287
  static printFriendlyDate(date: Date, separator?: string): string;
288
+ /**
289
+ * Formats a date to a short format with time.
290
+ * Example output: "03/01/2024 - 2:30 PM"
291
+ *
292
+ * @param date The date to format
293
+ * @param separator The separator between month, day, and year (defaults to '/')
294
+ * @param dateTimeSeparator The separator between date and time (defaults to '-')
295
+ * @returns A formatted short date string with time
296
+ */
67
297
  static printShortDate(date: Date, separator?: string, dateTimeSeparator?: string): string;
298
+ /**
299
+ * Parses various date formats into a Date object.
300
+ * Supports Date objects, ISO strings, and timestamps (milliseconds).
301
+ * Automatically appends 'Z' to date strings without timezone information.
302
+ *
303
+ * @param date The date in various formats (Date, string, or number/timestamp)
304
+ * @returns A Date object, or an empty string if input is null/undefined
305
+ */
68
306
  static parseDate(date: any): "" | Date;
307
+ /**
308
+ * Calculates and formats the duration between two dates.
309
+ * Breaks down the duration into days, hours, minutes, and seconds.
310
+ * Example output: "2 days, 3 hours, 15 minutes and 30 seconds"
311
+ *
312
+ * @param start The start date
313
+ * @param end The end date
314
+ * @returns A human-readable duration string
315
+ */
69
316
  static printDuration(start: Date, end: Date): string;
317
+ /**
318
+ * Calculates the age in years between two dates.
319
+ * Properly accounts for whether the birthday has occurred in the current year.
320
+ *
321
+ * @param birthDate The birth date (can be string, number timestamp, or Date object)
322
+ * @param otherDate The reference date to calculate age from (can be string, number timestamp, or Date object)
323
+ * @returns The age in years as an integer
324
+ */
70
325
  static getAge(birthDate: string | number | Date, otherDate: string | number | Date): number;
326
+ /**
327
+ * Performs a deep clone of an array, recursively copying nested arrays and objects.
328
+ * Primitive types are returned unchanged, and handles circular references safely.
329
+ *
330
+ * @param items The array to clone
331
+ * @returns A deep copy of the array with all nested structures cloned
332
+ */
71
333
  static deepCloneArray<T>(items: T[]): T[];
334
+ /**
335
+ * Searches for a term within an array of values using case-sensitive or case-insensitive matching.
336
+ * Joins all values into a single string and searches for the term within it.
337
+ *
338
+ * @param searchTerm The term to search for
339
+ * @param caseSensitive Whether the search should be case-sensitive (defaults to false)
340
+ * @param values Variable number of values to search within
341
+ * @returns true if the search term is found, false otherwise
342
+ */
72
343
  static searchArray(searchTerm: string, caseSensitive: boolean, ...values: any[]): boolean;
344
+ /**
345
+ * Moves an item within an array from one index to another.
346
+ * Handles negative indices (counts from the end) and automatically extends the array if needed.
347
+ *
348
+ * @param array The array to modify
349
+ * @param oldIndex The current index of the item to move
350
+ * @param newIndex The target index to move the item to
351
+ */
73
352
  static moveArrayItem(array: any[], oldIndex: number, newIndex: number): void;
353
+ /**
354
+ * Expands camelCase text into space-separated words.
355
+ * Handles both camelCase and PascalCase patterns as well as non-alphanumeric characters.
356
+ * Example: "myPropertyName" becomes "my Property Name"
357
+ *
358
+ * @param text The camelCase text to expand
359
+ * @returns The expanded text with spaces between words
360
+ */
74
361
  static expandCamelCase(text: string): string;
362
+ /**
363
+ * Tests whether a URL is absolute (starts with protocol or //).
364
+ * Matches URLs like "http://example.com" or "//example.com"
365
+ *
366
+ * @param url The URL to test
367
+ * @returns true if the URL is absolute, false if it's relative
368
+ */
75
369
  static testIsAbsoluteUrl(url: string): boolean;
370
+ /**
371
+ * Converts a relative URL to an absolute URL by prepending //.
372
+ * If the URL is already absolute, it's returned unchanged.
373
+ *
374
+ * @param url The URL to convert
375
+ * @returns The absolute URL (e.g., "//example.com" for "example.com")
376
+ */
76
377
  static convertToAbsoluteUrl(url: string): string;
77
378
  static ɵfac: i0.ɵɵFactoryDeclaration<Utilities, never>;
78
379
  static ɵprov: i0.ɵɵInjectableDeclaration<Utilities>;
@@ -1,3 +1,6 @@
1
+ import { ImageStyle } from './style/image-style';
2
+ import { ColorStyle } from './style/color-style';
3
+ import { TextStyle } from './style/text-style';
1
4
  export type Slide = {
2
5
  image: string;
3
6
  title: string;
@@ -6,7 +9,15 @@ export type Slide = {
6
9
  textColor: 'red' | 'green' | 'blue' | 'yellow' | 'black' | 'white';
7
10
  backgroundColor: 'red' | 'green' | 'blue' | 'yellow' | 'black' | 'white';
8
11
  };
12
+ export declare class FooterSlide {
13
+ image: ImageStyle;
14
+ title: TextStyle;
15
+ description: TextStyle;
16
+ highlighted: boolean;
17
+ backgroundColor: ColorStyle;
18
+ }
9
19
  export declare const DEFAULT_SLIDE: Slide;
20
+ export declare const DEFAULT_FOOTER_SLIDE: FooterSlide;
10
21
  export declare const SLIDE_SCHEMA: {
11
22
  type: string;
12
23
  title: string;
@@ -52,3 +63,35 @@ export declare const SLIDE_SCHEMA: {
52
63
  };
53
64
  required: string[];
54
65
  };
66
+ export declare const FOOTER_SLIDE_SCHEMA: {
67
+ type: string;
68
+ title: string;
69
+ properties: {
70
+ image: {
71
+ type: string;
72
+ title: string;
73
+ description: string;
74
+ };
75
+ title: {
76
+ type: string;
77
+ title: string;
78
+ description: string;
79
+ };
80
+ description: {
81
+ type: string;
82
+ title: string;
83
+ description: string;
84
+ };
85
+ highlighted: {
86
+ type: string;
87
+ title: string;
88
+ description: string;
89
+ };
90
+ backgroundColor: {
91
+ type: string;
92
+ title: string;
93
+ description: string;
94
+ };
95
+ };
96
+ required: string[];
97
+ };
@@ -2,7 +2,7 @@ import { NamedColors } from './named-colors';
2
2
  import { RgbaColorStyle } from './rgba-color-style';
3
3
  import { HexColor } from './hex-color';
4
4
  import { OnStyle } from './on-style';
5
- import { ngStyleItem } from './ng-style-item';
5
+ import { ngStyleAttribute } from './ng-style-attribute';
6
6
  export type ColorValue = NamedColors | HexColor | RgbaColorStyle;
7
7
  /**
8
8
  * A unified Color class that can represent colors as Named, Hex, or RGBA formats
@@ -11,7 +11,7 @@ export type ColorValue = NamedColors | HexColor | RgbaColorStyle;
11
11
  export declare class ColorStyle implements OnStyle {
12
12
  private _value;
13
13
  constructor(value: ColorValue);
14
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
14
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
15
15
  /**
16
16
  * Gets the original color value
17
17
  */
@@ -1,8 +1,27 @@
1
1
  import { OnStyle } from './on-style';
2
- import { ngStyleItem } from './ng-style-item';
2
+ import { ngStyleAttribute } from './ng-style-attribute';
3
3
  export declare class CoordinatesStyle implements OnStyle {
4
4
  top: number | string | any | undefined;
5
5
  left: number | string | any | undefined;
6
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
6
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
7
7
  }
8
8
  export declare const DEFAULT_COORDINATES: CoordinatesStyle;
9
+ export declare const COORDINATES_STYLE_SCHEMA: {
10
+ type: string;
11
+ title: string;
12
+ properties: {
13
+ top: {
14
+ type: string;
15
+ title: string;
16
+ description: string;
17
+ default: number;
18
+ };
19
+ left: {
20
+ type: string;
21
+ title: string;
22
+ description: string;
23
+ default: number;
24
+ };
25
+ };
26
+ required: string[];
27
+ };
@@ -1,11 +1,48 @@
1
1
  import { OnStyle } from './on-style';
2
- import { ngStyleItem } from './ng-style-item';
2
+ import { ngStyleAttribute } from './ng-style-attribute';
3
3
  export declare class FontStyle implements OnStyle {
4
4
  family: string;
5
5
  size: number;
6
6
  italic: boolean;
7
7
  bold: boolean;
8
8
  underline: boolean;
9
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
9
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
10
10
  }
11
11
  export declare const DEFAULT_FONT: FontStyle;
12
+ export declare const FONT_STYLE_SCHEMA: {
13
+ type: string;
14
+ title: string;
15
+ properties: {
16
+ family: {
17
+ type: string;
18
+ title: string;
19
+ description: string;
20
+ default: string;
21
+ };
22
+ size: {
23
+ type: string;
24
+ title: string;
25
+ description: string;
26
+ default: number;
27
+ };
28
+ italic: {
29
+ type: string;
30
+ title: string;
31
+ description: string;
32
+ default: boolean;
33
+ };
34
+ bold: {
35
+ type: string;
36
+ title: string;
37
+ description: string;
38
+ default: boolean;
39
+ };
40
+ underline: {
41
+ type: string;
42
+ title: string;
43
+ description: string;
44
+ default: boolean;
45
+ };
46
+ };
47
+ required: string[];
48
+ };
@@ -120,3 +120,11 @@ export declare function hexToNamedColor(hexColor: HexColor): string | null;
120
120
  * @returns Named color string or null if no close match found
121
121
  */
122
122
  export declare function rgbaToNamedColor(rgba: RgbaColorStyle): string | null;
123
+ export declare const DEFAULT_HEX_COLOR: HexColor;
124
+ export declare const HEX_COLOR_SCHEMA: {
125
+ type: string;
126
+ title: string;
127
+ description: string;
128
+ pattern: string;
129
+ default: `#${string}`;
130
+ };
@@ -2,12 +2,66 @@ import { CoordinatesStyle } from './coordinates-style';
2
2
  import { Justifications } from './justifications';
3
3
  import { SizeStyle } from "./size-style";
4
4
  import { OnStyle } from './on-style';
5
- import { ngStyleItem } from './ng-style-item';
5
+ import { ngStyleAttribute } from './ng-style-attribute';
6
6
  export declare class ImageStyle implements OnStyle {
7
7
  href: string | URL;
8
8
  justification: Justifications;
9
9
  size: SizeStyle | undefined;
10
10
  coordinates: CoordinatesStyle | undefined;
11
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
11
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
12
12
  }
13
- export declare const DEFAULT_IMAGE: ImageStyle;
13
+ export declare const DEFAULT_IMAGE_STYLE: ImageStyle;
14
+ export declare const IMAGE_STYLE_SCHEMA: {
15
+ type: string;
16
+ title: string;
17
+ properties: {
18
+ href: {
19
+ type: string;
20
+ title: string;
21
+ description: string;
22
+ };
23
+ justification: {
24
+ enum: Justifications[];
25
+ type: string;
26
+ title: string;
27
+ description: string;
28
+ };
29
+ size: {
30
+ type: string;
31
+ title: string;
32
+ description: string;
33
+ properties: {
34
+ width: {
35
+ type: string[];
36
+ title: string;
37
+ description: string;
38
+ };
39
+ height: {
40
+ type: string[];
41
+ title: string;
42
+ description: string;
43
+ };
44
+ };
45
+ required: string[];
46
+ };
47
+ coordinates: {
48
+ type: string;
49
+ title: string;
50
+ description: string;
51
+ properties: {
52
+ top: {
53
+ type: string[];
54
+ title: string;
55
+ description: string;
56
+ };
57
+ left: {
58
+ type: string[];
59
+ title: string;
60
+ description: string;
61
+ };
62
+ };
63
+ required: string[];
64
+ };
65
+ };
66
+ required: string[];
67
+ };
@@ -4,3 +4,11 @@ export declare enum Justifications {
4
4
  Center = "center",
5
5
  Fully = "fully"
6
6
  }
7
+ export declare const DEFAULT_JUSTIFICATION = Justifications.Left;
8
+ export declare const JUSTIFICATIONS_SCHEMA: {
9
+ type: string;
10
+ title: string;
11
+ description: string;
12
+ enum: Justifications[];
13
+ default: Justifications;
14
+ };
@@ -170,3 +170,11 @@ export declare function isNamedColor(colorName: string): boolean;
170
170
  * @returns Array of all CSS named color names
171
171
  */
172
172
  export declare function getNamedColors(): string[];
173
+ export declare const DEFAULT_NAMED_COLOR: NamedColors;
174
+ export declare const NAMED_COLOR_SCHEMA: {
175
+ type: string;
176
+ title: string;
177
+ description: string;
178
+ enum: string[];
179
+ default: NamedColors.Black;
180
+ };
@@ -0,0 +1,14 @@
1
+ export type ngStyleAttribute = {
2
+ [key: string]: string | number | null;
3
+ };
4
+ export declare const DEFAULT_NG_STYLE: ngStyleAttribute;
5
+ export declare const NG_STYLE_SCHEMA: {
6
+ type: string;
7
+ title: string;
8
+ description: string;
9
+ additionalProperties: {
10
+ type: string[];
11
+ title: string;
12
+ description: string;
13
+ };
14
+ };
@@ -1,4 +1,4 @@
1
- import { ngStyleItem } from './ng-style-item';
1
+ import { ngStyleAttribute } from './ng-style-attribute';
2
2
  export interface OnStyle {
3
- ngOnStyle(ngStyle: ngStyleItem): ngStyleItem;
3
+ ngOnStyle(ngStyle: ngStyleAttribute): ngStyleAttribute;
4
4
  }