Skip to content

Commit 0618a68

Browse files
Merge pull request #34 from exadel-inc/EFRS-1233-Compreface-JS-SDK-running-issue-with-angular-framework
EFRS-1233-Compreface-JS-SDK-running-issue-with-angular-framework
2 parents d5e577a + 00319c5 commit 0618a68

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed

compreface.d.ts

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
declare interface Detection {
2+
detect<T>(image_path: string, localOptions?: any): Promise<T>;
3+
}
4+
5+
declare interface Verification {
6+
verify<T>(source_image_path: string, target_image_path: string, options?: any): Promise<T>
7+
}
8+
9+
declare interface Recognition {
10+
getFaceCollection(): FaceCollectionFunctions;
11+
subjectFunctions(): SubjectFunctions;
12+
}
13+
14+
declare interface FaceCollectionFunctions {
15+
/**
16+
* View the list of images in face collection
17+
* @returns {Promise}
18+
*/
19+
list<T>(): Promise<T>,
20+
21+
/**
22+
* Add image (with subject) to face collection
23+
* @param {String} image_path
24+
* @param {String} subject
25+
* @returns {Promise}
26+
*/
27+
add<T>(image_path: string, subject: string, options?: any): Promise<T>;
28+
29+
/**
30+
* Verify face from image
31+
* @param {String} image_path
32+
* @param {String} image_id
33+
* @returns {Promise}
34+
*/
35+
verify<T>(image_path: string, image_id: string, options?: any): Promise<T>,
36+
37+
/**
38+
* Delete image by id
39+
* @param {String} image_id
40+
* @returns {Promise}
41+
*/
42+
delete<T>(image_id: string): Promise<T>,
43+
44+
/**
45+
* Delete multiple images
46+
* @param {String} subject
47+
* @returns {Promise}
48+
*/
49+
delete_multiple_images<T>(image_ids: string[]): Promise<T>,
50+
/**
51+
* Delete image by subject
52+
* @param {String} subject
53+
* @returns {Promise}
54+
*/
55+
delete_all_subject<T>(subject: string): Promise<T>,
56+
57+
/**
58+
* Delete all images in face collection
59+
* @returns {Promise}
60+
*/
61+
delete_all<T>(): Promise<T>,
62+
}
63+
64+
declare interface SubjectFunctions {
65+
66+
/**
67+
* List the subjects
68+
* @returns {Promise}
69+
*/
70+
list<T>(): Promise<T>,
71+
72+
/**
73+
* Add subject
74+
* @param {String} subject
75+
* @returns {Promise}
76+
*/
77+
add<T>(subject: string): Promise<T>,
78+
79+
/**
80+
* Rename the subject
81+
* @param {String} presentSubjectName
82+
* @param {String} newSubjectName
83+
* @returns {Promise}
84+
*/
85+
rename<T>(presentSubjectName: string, newSubjectName: string): Promise<T>,
86+
87+
/**
88+
* Delete a subject
89+
* @param {String} subject
90+
* @returns {Promise}
91+
*/
92+
delete<T>(subject: string): Promise<T>,
93+
94+
/**
95+
* Delete all subject
96+
* @param {String} subject
97+
* @returns {Promise}
98+
*/
99+
deleteAll<T>(): Promise<T>;
100+
}
101+
102+
export declare class CompreFace {
103+
constructor(server: string, port: number, options?: any);
104+
105+
/**
106+
* Initialize RecognitionService instance
107+
* @param {String} api_key
108+
* @returns {Object}
109+
*/
110+
initFaceRecognitionService(api_key: string): Recognition;
111+
112+
/**
113+
* Initialize VerificationService instance
114+
* @param {String} api_key
115+
* @returns {Object}
116+
*/
117+
initFaceVerificationService(api_key: string): Verification;
118+
119+
/**
120+
* Initialize DetectionService instance
121+
* @param {String} api_key
122+
* @returns {Object}
123+
*/
124+
initFaceDetectionService(api_key: string): Detection;
125+
}
126+

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"description": "JavaScript SDK for CompreFace - free and open-source face recognition system from Exadel",
66
"main": "index.js",
77
"type": "module",
8+
"types":"compreface.d.ts",
89
"scripts": {
910
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --coverage"
1011
},

0 commit comments

Comments
 (0)