Skip to content

Commit 6c43dbf

Browse files
authored
Merge pull request #2 from zcf0508/master
type: 补充类型定义
2 parents c395264 + e276251 commit 6c43dbf

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

index.d.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
declare module "api2d"
2+
3+
declare class Api2d {
4+
constructor(
5+
key?: null | string,
6+
apiBaseUrl?: null | string,
7+
timeout?: number,
8+
);
9+
10+
setApiBaseUrl(apiBaseUrl: string): void;
11+
12+
setTimeout(timeout: number): void;
13+
14+
abort(): void;
15+
16+
completion(options: {
17+
onMessage?: (message: string) => void;
18+
onEnd?: (message: string) => void;
19+
model?: string;
20+
[key: string]: any;
21+
}): Promise<string>;
22+
23+
embeddings(options: {
24+
model?: string;
25+
[key: string]: any;
26+
}): Promise<any>;
27+
28+
billing(): Promise<any>;
29+
}
30+
31+
export default Api2d

tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"compilerOptions": {
3+
"target": "es5",
4+
"strict": true
5+
}
6+
}

0 commit comments

Comments
 (0)