sloria / perspective-api-client

Node.js client for the Perspective API
https://www.perspectiveapi.com
MIT License
29 stars 9 forks source link

Support for TypeScript Type definitions #188

Open amitkumarhq opened 2 years ago

amitkumarhq commented 2 years ago

Can you please add type definition for this package..? It would be really helpful for TypeScript developers

alexandermckay commented 8 months ago
declare module 'perspective-api-client' {
  interface AnalyzeResult {
    attributeScores: any
    languages: string[]
    detectedLanguages: string[]
  }

  interface PerspectiveOptions {
    apiKey: string
  }

  export default class Perspective {
    constructor(options: PerspectiveOptions)
    analyze(text: string): Promise<AnalyzeResult>
  }
}