// Type definitions for knockout-postbox // Project: https://github.com/rniemeyer/knockout-postbox // Definitions by: Judah Gabriel Himango // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 /// interface KnockoutPostBox { subscribe(topic: string, handler: (value: T) => void , target?: any): KnockoutSubscription; publish(topic: string, value?: T): void; defaultComparer(newValue: T, oldValue: T): boolean; serializer: (object: any) => string; reset(): void; } interface KnockoutObservable { subscribeTo(topic: string, useLastPublishedValueToInitialize?: boolean, transform?: (val: any) => T): KnockoutObservable; unsubscribeFrom(topic: string): KnockoutObservable; publishOn(topic: string, skipInitialPublish?: boolean, equalityComparer?: (newValue: T, oldValue: T) => boolean): KnockoutObservable; stopPublishingOn(topic: string): KnockoutObservable; syncWith(topic: string, initializeWithLatestValue?: boolean, skipInitialPublish?: boolean, equalityComparer?: (newValue: T, oldValue: T) => boolean): KnockoutObservable; } interface KnockoutObservableArray { subscribeTo(topic: string, useLastPublishedValueToInitialize?: boolean, transform?: (val: any) => any /* T */): KnockoutObservableArray; unsubscribeFrom(topic: string): KnockoutObservableArray; publishOn(topic: string, skipInitialPublish?: boolean, equalityComparer?: (newValue: any /* T */, oldValue: any /* T */) => boolean): KnockoutObservableArray; stopPublishingOn(topic: string): KnockoutObservableArray; syncWith(topic: string, initializeWithLatestValue?: boolean, skipInitialPublish?: boolean, equalityComparer?: (newValue: any /* T */, oldValue: any /* T */) => boolean): KnockoutObservableArray; } interface KnockoutStatic { postbox: KnockoutPostBox; }