@arsedizioni/ars-utils 18.2.282 → 18.2.284

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.
@@ -547,6 +547,12 @@ export declare class ClipperUtils {
547
547
  static getClipperAvailableSortOptions(modules?: NameValueItem<ClipperModule>[] | null | undefined, params?: ClipperSearchParams | null | undefined): NameValueItem<ClipperSort>[];
548
548
  }
549
549
  export declare class ClipperSearchUtils {
550
+ /**
551
+ * Check if search params have at least on params set
552
+ * @param params : the search params to check
553
+ * @returns true if validation succeded
554
+ */
555
+ static canSearch(params: ClipperSearchParams): boolean;
550
556
  /**
551
557
  * Clear the search params object
552
558
  * @param params : the search params to clear
@@ -13,5 +13,6 @@ export * from './system';
13
13
  export * from './definitions';
14
14
  export * from './selectable';
15
15
  export * from './services/broadcast.service';
16
+ export * from './services/broadcastChannelManager';
16
17
  export * from './services/environment.service';
17
18
  export * from './services/screen.service';
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Standard Broadcast Messages Manager
3
+ * https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
4
+ */
5
+ /**
6
+ * The message bag sent as a message
7
+ */
8
+ export interface BroadcastChannelMessageBag<T> {
9
+ messageId: string;
10
+ sender: string;
11
+ data?: T;
12
+ }
13
+ /**
14
+ * Message subscription params
15
+ */
16
+ export interface BroadcastChannelSubscriberInfo<T> {
17
+ messageId: string;
18
+ action: (bag: BroadcastChannelMessageBag<T>) => void;
19
+ }
20
+ /**
21
+ * Web Standard Broadcast Messages Manager
22
+ * https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
23
+ */
24
+ export declare class BroadcastChannelManager {
25
+ private channel?;
26
+ private subscriptions;
27
+ /**
28
+ * Get the current channel registration
29
+ */
30
+ get currentBus(): string | null | undefined;
31
+ constructor(bus: string);
32
+ dispose(): void;
33
+ /**
34
+ * Send a message
35
+ * @param bag The message, see also {@link BroadcastChannelMessageBag}
36
+ *
37
+ * @example
38
+ * channel.sendMessage({ messageId: 'my-broadcast-message', sender: 'the-sender', data: value });
39
+ */
40
+ sendMessage<T>(bag: BroadcastChannelMessageBag<T>): void;
41
+ /**
42
+ * Send a message
43
+ * @param bag The message, see also {@link BroadcastChannelMessageBag}
44
+ * @param delay The number of milliseconds to wait before sending the message, see also {@link setTimeout}
45
+ *
46
+ * @example
47
+ * channel.sendMessage({ messageId: 'my-broadcast-message', sender: 'the-sender', data: value }, 250);
48
+ */
49
+ sendMessage<T>(bag: BroadcastChannelMessageBag<T>, delay: number | null): void;
50
+ /**
51
+ * Send a message
52
+ * @param messageId The message id
53
+ * @param data The data to send
54
+ *
55
+ * @example
56
+ * channel.sendMessage('my-broadcast-message', value);
57
+ */
58
+ sendMessage<T>(messageId: string, data: T | null): void;
59
+ /**
60
+ * Send a message
61
+ * @param messageId The message id
62
+ * @param data The data to send
63
+ * @param delay The number of milliseconds to wait before sending the message
64
+ *
65
+ * @example
66
+ * channel.sendMessage('my-broadcast-message', value, 250);
67
+ */
68
+ sendMessage<T>(messageId: string, data: T | null, delay: number | null): void;
69
+ /**
70
+ * Subscribe to a message
71
+ * @param args The subscription info, see also {@link BroadcastChannelSubscriberInfo}
72
+ */
73
+ subscribe<T>(args: BroadcastChannelSubscriberInfo<T>): void;
74
+ /**
75
+ * Remove a message subscription
76
+ * @param messageId The message id
77
+ */
78
+ unsubscribe(messageId: string): void;
79
+ /**
80
+ * Remove all the current subscriptions
81
+ */
82
+ unsubscribeAll(): void;
83
+ }
@@ -36,6 +36,12 @@ export declare class ThemeService implements OnDestroy {
36
36
  readonly toggleTooltip: Signal<string>;
37
37
  constructor();
38
38
  ngOnDestroy(): void;
39
+ /**
40
+ * Check if a value string is a theme type
41
+ * @param value : th string value
42
+ * @returns true if the the value is a valid theme type
43
+ */
44
+ private isTheme;
39
45
  /**
40
46
  * Set the new theme
41
47
  * @param theme the new theme