-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsupport.d.ts
More file actions
171 lines (129 loc) · 4.18 KB
/
support.d.ts
File metadata and controls
171 lines (129 loc) · 4.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
declare module 'snoowrap/dist/errors' {
export interface InvalidUserError extends Error {
}
export interface NoCredentialsError extends Error {
}
export interface InvalidMethodCallError extends Error {
}
export interface RequestError extends Error {
statusCode: number,
response: http.IncomingMessage
error: Error
}
export interface StatusCodeError extends RequestError {
name: 'StatusCodeError',
}
export interface RateLimitError extends RequestError {
name: 'RateLimitError',
}
}
declare module 'winston-null' {
import TransportStream from "winston-transport";
export class NullTransport extends TransportStream {
}
}
declare module '@nlpjs/*' {
declare interface SentimentResult {
score: number,
average: number,
numWords: number,
numHits: number,
type: string,
language: string
}
declare interface NLPSentimentResult extends Omit<SentimentResult, 'language'> {
vote: string
locale: string
}
declare module '@nlpjs/language' {
export interface LanguageType {
alpha3: string,
alpha2: string,
language: string,
}
export interface LanguageObj {
alpha3: string,
alpha2: string,
name: string,
}
export interface LanguageGuess extends LanguageType {
score: number
}
export class Language {
guess(val: string, allowedList?: string[] | null, limit?: number): LanguageGuess[];
guessBest(val: string, allowedList?: string[] | null): LanguageGuess;
/**
* Key is alpha2 lang IE en es de fr
* */
languagesAlpha2: Record<string, LanguageObj>;
/**
* Key is alpha3 lang IE eng spa deu fra
* */
languagesAlpha3: Record<string, LanguageObj>;
}
}
declare module '@nlpjs/sentiment' {
declare interface SentimentPipelineResult {
utterance: string
locale: string
settings: { tag: string }
tokens: string[]
sentiment: SentimentResult
}
declare interface SentimentPipelineInput {
utterance: string
locale: string
[key: string]: any
}
export class SentimentAnalyzer {
constructor(settings?: { language?: string }, container?: any)
container: any
process(srcInput: SentimentPipelineInput, settings?: object): Promise<SentimentPipelineResult>
}
}
declare module '@nlpjs/nlp' {
declare interface NlpResult {
locale: string
language: string
languageGuessed: boolean
sentiment: NLPSentimentResult
}
export class Nlp {
settings: any;
nluManager: any;
constructor(settings?: { language?: string }, container?: any)
// locale language languageGuessed sentiment
process(locale: string, utterance?: string, srcContext?: object, settings?: object): Promise<NlpResult>
addLanguage(locale: string)
train(): Promise<any>;
}
}
declare module '@nlpjs/lang-es' {
export const LangEs: any
}
declare module '@nlpjs/lang-en' {
export const LangEn: any
}
declare module '@nlpjs/lang-de' {
export const LangDe: any
}
declare module '@nlpjs/lang-fr' {
export const LangFr: any
}
declare module '@nlpjs/nlu' {
export const Nlu: any
}
declare module '@nlpjs/core' {
export const Container: any
export const containerBootstrap: any
}
}
declare module 'wink-sentiment' {
function sentiment(phrase: string): { score: number, normalizedScore: number, tokenizedPhrase: any[] };
export default sentiment;
}
declare module 'cache-manager-redis-store' {
import {RedisClientOptions} from "@redis/client";
import {Cache, CachingConfig} from "cache-manager";
export async function redisStore(config: RedisClientOptions & Partial<CachingConfig>): Cache;
}