Skip to content

Commit 02cbcb6

Browse files
Merge pull request #310 from opencomponents/utils-ts-typings
add TS typings to storage-adapters-utils
2 parents 34e5d07 + 25adde6 commit 02cbcb6

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
declare const utils: {
2+
getNextYear: () => Date;
3+
getFileInfo: (filePath: string) => {
4+
gzip: boolean;
5+
extname: string;
6+
mimeType: string | undefined;
7+
};
8+
strings: {
9+
errors: {
10+
generic: string;
11+
STORAGE: {
12+
DIR_NOT_FOUND: string;
13+
DIR_NOT_FOUND_CODE: string;
14+
FILE_NOT_FOUND: string;
15+
FILE_NOT_FOUND_CODE: string;
16+
FILE_NOT_VALID: string;
17+
FILE_NOT_VALID_CODE: string;
18+
};
19+
};
20+
};
21+
getMimeType: (extension: string) => string | undefined;
22+
};
23+
24+
export = utils;

packages/oc-storage-adapters-utils/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
"version": "1.0.3",
44
"description": "Common storage adapter utils for OC",
55
"main": "index.js",
6+
"types": "index.d.ts",
67
"files": [
78
"index.js",
9+
"index.d.ts",
810
"lib",
911
"LICENSE",
1012
"README.md"

0 commit comments

Comments
 (0)