perspective-api-client icon indicating copy to clipboard operation
perspective-api-client copied to clipboard

Support for TypeScript Type definitions

Open amitkumarhq opened this issue 2 years ago • 1 comments

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

amitkumarhq avatar Aug 04 '22 14:08 amitkumarhq

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>
  }
}

alexandermckay avatar Mar 05 '24 10:03 alexandermckay