Skip to content

Instantly share code, notes, and snippets.

@hawx
Created November 10, 2017 08:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hawx/6a3a22c8a80196dc400544f2c8342700 to your computer and use it in GitHub Desktop.
Save hawx/6a3a22c8a80196dc400544f2c8342700 to your computer and use it in GitHub Desktop.
Typings for the helpscout beacon <https://www.helpscout.net>
interface HelpScout {
beacon: HelpScoutBeacon;
}
interface HelpScoutBeacon {
config(configObject: HelpScoutConfig): void;
ready(handler: () => void): void;
open(): void;
close(): void;
toggle(): void;
identify(userObject: Object): void;
prefill(formObject: Object): void;
search(query: string): void;
suggest(articlesIds: string[]): void;
show(articleId: string): void;
reset(): void;
init(): void;
destroy(): void;
}
interface HelpScoutConfig {
attachment?: boolean;
autoInit?: boolean;
collection?: string;
color?: string;
icon?: string;
instructions?: string;
modal?: boolean;
position?: string;
poweredBy?: boolean;
showContactFields?: boolean;
showName?: boolean;
showSubject?: boolean;
topArticles?: boolean;
topics?: HelpScoutTopic[];
translation?: HelpScoutTranslation;
zIndex?: number;
}
interface HelpScoutTopic {
val: string;
label: string;
}
interface HelpScoutTranslation {
searchLabel?: string;
searchErrorLabel?: string;
noResultsLabel?: string;
contactLabel?: string;
attachFileLabel?: string;
attachFileError?: string;
fileExtensionError?: string;
nameLabel?: string;
nameError?: string;
emailLabel?: string;
emailError?: string;
topicLabel?: string;
topicError?: string;
subjectLabel?: string;
subjectError?: string;
messageLabel?: string;
messageError?: string;
sendLabel?: string;
contactSuccessLabel?: string;
contactSuccessDescription?: string;
}
declare const HS: HelpScout;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment