@banta/sdk 4.7.9 → 4.7.11

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.
@@ -12,6 +12,11 @@ export declare class ChatBackend extends ChatBackendBase {
12
12
  private connectToService;
13
13
  getSourceForTopic(topicId: string, options?: ChatSourceOptions): Promise<ChatSourceBase>;
14
14
  getSourceForThread(topicId: string, messageId: string, options?: ChatSourceOptions): Promise<ChatSource>;
15
+ /**
16
+ * Get the count of the given topic
17
+ * @param topicId
18
+ * @returns
19
+ */
15
20
  getSourceCountForTopic(topicId: string): Promise<number>;
16
21
  refreshMessage(message: ChatMessage): Promise<ChatMessage>;
17
22
  getMessage(topicId: string, messageId: string): Promise<ChatMessage>;
@@ -31,4 +31,5 @@ export interface ChatSourceBase {
31
31
  deleteMessage(messageId: string): Promise<void>;
32
32
  connectionStateChanged?: Observable<'connected' | 'connecting' | 'lost' | 'restored'>;
33
33
  state?: 'connecting' | 'connected' | 'lost' | 'restored';
34
+ get errorState(): any;
34
35
  }
@@ -18,12 +18,16 @@ export declare class ChatSource extends SocketRPC implements ChatSourceBase {
18
18
  set state(value: "connected" | "connecting" | "lost" | "restored");
19
19
  private _connectionStateChanged;
20
20
  get connectionStateChanged(): Observable<"connected" | "connecting" | "lost" | "restored">;
21
+ private wasRestored;
21
22
  bind(socket: DurableSocket): Promise<this>;
22
23
  private mapOrUpdateMessages;
23
24
  private mapOrUpdateMessage;
24
25
  getExistingMessages(): Promise<ChatMessage[]>;
25
26
  private ensureConnection;
26
27
  editMessage(messageId: string, text: string): Promise<void>;
28
+ private subscribeAttempt;
29
+ private _errorState;
30
+ get errorState(): string;
27
31
  subscribeToTopic(): Promise<void>;
28
32
  authenticate(): Promise<void>;
29
33
  close(): void;
@@ -17,6 +17,7 @@ export declare class BantaAttachmentsComponent {
17
17
  isImageAttachment(attachment: ChatMessageAttachment): boolean;
18
18
  isCardAttachment(attachment: ChatMessageAttachment): boolean;
19
19
  showLightbox(image: ChatMessageAttachment): void;
20
+ get validAttachments(): ChatMessageAttachment[];
20
21
  get inlineAttachments(): ChatMessageAttachment[];
21
22
  get blockAttachments(): ChatMessageAttachment[];
22
23
  attachmentId(index: number, attachment: ChatMessageAttachment): string;
@@ -1,3 +1,4 @@
1
+ import { ModuleWithProviders } from '@angular/core';
1
2
  import * as i0 from "@angular/core";
2
3
  import * as i1 from "./timestamp.component";
3
4
  import * as i2 from "./lightbox/lightbox.component";
@@ -11,6 +12,7 @@ import * as i9 from "@angular/material/icon";
11
12
  import * as i10 from "@angular/material/progress-spinner";
12
13
  import * as i11 from "@angular/material/button";
13
14
  export declare class BantaCommonModule {
15
+ static forRoot(): ModuleWithProviders<BantaCommonModule>;
14
16
  static ɵfac: i0.ɵɵFactoryDeclaration<BantaCommonModule, never>;
15
17
  static ɵmod: i0.ɵɵNgModuleDeclaration<BantaCommonModule, [typeof i1.TimestampComponent, typeof i2.LightboxComponent, typeof i3.BantaMarkdownToHtmlPipe, typeof i4.BantaMentionLinkerPipe, typeof i5.BantaTrustResourceUrlPipe, typeof i6.BantaAttachmentComponent, typeof i7.BantaAttachmentsComponent], [typeof i8.CommonModule, typeof i9.MatIconModule, typeof i10.MatProgressSpinnerModule, typeof i11.MatButtonModule], [typeof i1.TimestampComponent, typeof i2.LightboxComponent, typeof i3.BantaMarkdownToHtmlPipe, typeof i4.BantaMentionLinkerPipe, typeof i5.BantaTrustResourceUrlPipe, typeof i6.BantaAttachmentComponent, typeof i7.BantaAttachmentsComponent]>;
16
18
  static ɵinj: i0.ɵɵInjectorDeclaration<BantaCommonModule>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Provides a way to hook in to a shared set of timers, instead of creating a timer per instance.
3
+ * This is very useful for cases where the update is not extremely time-sensitive, but happens at scale.
4
+ * The principal use case is the TimestampComponent. When several hundred (or several thousand) comments are
5
+ * being displayed, we do not want to trigger thousands of independent relative timestamp updates, because over
6
+ * time the updates will saturate the CPU since they don't perfectly align.
7
+ */
8
+ export declare class TimerPool {
9
+ private subscriptions;
10
+ private newSubscriptionsNotice;
11
+ private newSubscriptions;
12
+ private removedSubscriptionsNotice;
13
+ private removedSubscriptions;
14
+ addTimer(interval: number, callback: () => void): () => void;
15
+ }
@@ -1,9 +1,14 @@
1
+ import { TimerPool } from "projects/sdk/src/lib/common/timer-pool.service";
1
2
  import * as i0 from "@angular/core";
2
3
  export declare class TimestampComponent {
4
+ private timerPool;
5
+ constructor(timerPool: TimerPool);
3
6
  private _value;
4
7
  relative: string;
5
8
  tooltip: string;
6
- private updateInterval;
9
+ private timerUnsubscribe;
10
+ private timerInterval;
11
+ private _destroyed;
7
12
  ngOnDestroy(): void;
8
13
  get value(): number;
9
14
  showAbsolute: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@banta/sdk",
3
- "version": "4.7.9",
3
+ "version": "4.7.11",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"