Skip to content

Instantly share code, notes, and snippets.

@scottenriquez
Created March 24, 2019 04:06
Show Gist options
  • Save scottenriquez/8288baae4ed6c6e89ea9949759763235 to your computer and use it in GitHub Desktop.
Save scottenriquez/8288baae4ed6c6e89ea9949759763235 to your computer and use it in GitHub Desktop.
Sentiment TypeScript definition
module 'sentiment' {
interface ConstructorOptions {
}
interface AnalyzeOptions {
extras: any;
language: string;
}
interface AnalyzeResponse {
score: number;
comparative: number;
tokens: Array<string>;
words: Array<string>;
positive: Array<string>;
negative: Array<string>;
}
class Sentiment {
constructor(options?: ConstructorOptions);
analyze(phrase: string, opts?: AnalyzeOptions, callback?: Function): AnalyzeResponse;
registerLanguage(languageCode: string, language: any): void;
}
export = Sentiment;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment