jaxs 0.9.3 → 0.9.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.
package/dist/jaxs.d.ts CHANGED
@@ -175,7 +175,7 @@ declare type CreateAppBuilderArguments = {
175
175
 
176
176
  declare const createBus: () => {
177
177
  bus: JaxsBus
178
- publish: (event: string, payload: any) => void
178
+ publish: PublishExtended<any>
179
179
  subscribe: (
180
180
  matcher: BusEventMatcher,
181
181
  listener: BusListener<any>,
@@ -263,14 +263,6 @@ declare class FuzzySubscriptions {
263
263
  matches(event: string): FuzzySubscriptionData<any>[]
264
264
  }
265
265
 
266
- declare type GeneralPeriodicOptions = {
267
- period: number
268
- offset?: number
269
- }
270
-
271
- declare type GeneralPeriodicPublisherOptions<T> =
272
- RequiredPeriodicPublisherOptions<T> & GeneralPeriodicOptions
273
-
274
266
  declare type InsertNodeData = {
275
267
  parent: JaxsElement
276
268
  index: number
@@ -396,13 +388,14 @@ export declare namespace JaxsTypes {
396
388
  StoreListSorterFunction,
397
389
  PeriodicPublisher,
398
390
  RequiredPeriodicPublisherOptions,
399
- GeneralPeriodicOptions,
400
391
  CustomPeriodicOptions,
401
- GeneralPeriodicPublisherOptions,
402
392
  CustomPeriodicPublisherOptions,
403
- PublishPeriodicallyOptions,
404
393
  PeriodicTimerFunctionOptions,
405
394
  PeriodicTimerFunction,
395
+ WithTimeoutOptions,
396
+ PeriodicallyOptions,
397
+ PeriodicallyWithCustomTimerOptions,
398
+ PublishExtended,
406
399
  RouteState,
407
400
  RouteMatcher,
408
401
  RenderedRoute,
@@ -467,13 +460,7 @@ export declare const ListStore: {
467
460
  declare const locationChangeEvent = 'navigation:location-change'
468
461
 
469
462
  export declare namespace messageBus {
470
- export {
471
- createBus,
472
- JaxsBus,
473
- ExactSubscriptions,
474
- FuzzySubscriptions,
475
- publishPeriodically,
476
- }
463
+ export { createBus, JaxsBus, ExactSubscriptions, FuzzySubscriptions }
477
464
  }
478
465
 
479
466
  declare const navigate: ({
@@ -507,6 +494,17 @@ declare const onLinkClick: (listenerKit: ListenerKit<MouseEvent>) => void
507
494
 
508
495
  declare const onLocationChange: (listenerKit: ListenerKit<null>) => void
509
496
 
497
+ declare type PeriodicallyOptions<T> = {
498
+ period: number
499
+ payload?: T
500
+ offset?: number
501
+ }
502
+
503
+ declare type PeriodicallyWithCustomTimerOptions<T> = {
504
+ timer: PeriodicTimerFunction
505
+ payload?: T
506
+ }
507
+
510
508
  declare interface PeriodicPublisher<T> {
511
509
  event: string
512
510
  publish: Publish<T>
@@ -538,20 +536,26 @@ declare type PropValue =
538
536
  | ReactSourceObject
539
537
  | RenderableCollection
540
538
 
541
- export declare type Publish<T> = (event: string, payload: T) => void
539
+ export declare interface Publish<T> {
540
+ (event: string, payload: T): void
541
+ }
542
+
543
+ declare interface PublishExtended<T> extends Publish<T> {
544
+ withTimeout: <T>(event: string, options: WithTimeoutOptions<T>) => Unsubscribe
545
+ periodically: <T>(
546
+ event: string,
547
+ options: PeriodicallyOptions<T>,
548
+ ) => Unsubscribe
549
+ periodicallyWithCustomTimer: <T>(
550
+ event: string,
551
+ options: PeriodicallyWithCustomTimerOptions<T>,
552
+ ) => Unsubscribe
553
+ }
542
554
 
543
555
  declare type PublishFromDom_2 = Publish<Event>
544
556
 
545
557
  declare const publishLocation: (app: App) => void
546
558
 
547
- declare const publishPeriodically: <T>(
548
- options: PublishPeriodicallyOptions<T>,
549
- ) => () => void
550
-
551
- declare type PublishPeriodicallyOptions<T> =
552
- | GeneralPeriodicPublisherOptions<T>
553
- | CustomPeriodicPublisherOptions<T>
554
-
555
559
  declare type ReactSourceObject = {
556
560
  fileName: string
557
561
  lineNumber: string
@@ -805,4 +809,9 @@ declare type ViewModel<ATTRIBUTES, STORE_MAP> = (
805
809
  storeMap: STORE_MAP,
806
810
  ) => Partial<ATTRIBUTES>
807
811
 
812
+ declare type WithTimeoutOptions<T> = {
813
+ timeout: number
814
+ payload?: T
815
+ }
816
+
808
817
  export {}