diff --git a/.eslintignore b/.eslintignore
index fc40c5a..5cc6223 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1 +1,2 @@
/**/*.js
+build/**
diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml
index c65fd7e..5665b9f 100644
--- a/.github/workflows/npm-publish.yml
+++ b/.github/workflows/npm-publish.yml
@@ -44,7 +44,7 @@ jobs:
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: master
- file_pattern: build/src/*.js build/src/*.js.map
+ file_pattern: build/src/*.js build/src/*.js.map build/src/*.d.ts
commit_message: 'Fix: Automated apply build files'
status_options: '--untracked-files=no'
diff --git a/build/src/main.d.ts b/build/src/main.d.ts
new file mode 100644
index 0000000..6a0a9fa
--- /dev/null
+++ b/build/src/main.d.ts
@@ -0,0 +1,18 @@
+///
+export declare const targets: {
+ weston: string;
+ korean: string;
+ japanese: string;
+ chinese: string;
+ chinese_traditional: string;
+};
+export declare function getUnicodeRanges(dirPath?: string, url?: string): Promise;
+interface fontRangeOptionI {
+ savePath: string;
+ format: string;
+ nameFormat: string;
+ defaultArgs: string;
+ etcArgs: string;
+}
+export declare function fontRange(url?: string, fontPath?: string, fontRangeOption?: fontRangeOptionI['savePath'] | Partial): Promise;
+export {};
diff --git a/build/src/types.d.ts b/build/src/types.d.ts
new file mode 100644
index 0000000..1cb1317
--- /dev/null
+++ b/build/src/types.d.ts
@@ -0,0 +1,4 @@
+declare type Diff = T extends U ? never : T;
+export declare type RequiredByValueExcept = Pick> & Partial;
+export declare type ValueOf = T[keyof T];
+export {};
diff --git a/package-lock.json b/package-lock.json
index 9f47ab9..499c8a4 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "font-range",
- "version": "0.2.0",
+ "version": "0.2.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "font-range",
- "version": "0.2.0",
+ "version": "0.2.1",
"license": "MIT",
"dependencies": {
"@types/css-tree": "^1.0.7",
diff --git a/package.json b/package.json
index d5d4064..4f2d09e 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "font-range",
"description": " Font subset with google font's ML result.",
- "version": "0.2.0",
+ "version": "0.2.1",
"author": "black7375 ",
"license": "MIT",
"keywords": [
@@ -43,6 +43,7 @@
"typescript": "^4.4.5"
},
"main": "build/src/main.js",
+ "typings": "build/src/main.d.ts",
"scripts": {
"clean": "rimraf coverage build tmp",
"build": "tsc -p tsconfig.release.json",
diff --git a/tsconfig.json b/tsconfig.json
index 208886b..09aef01 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -24,5 +24,8 @@
"include": [
"src/**/*",
"__tests__/**/*"
+ ],
+ "exclude": [
+ "build/**/*"
]
}
diff --git a/tsconfig.release.json b/tsconfig.release.json
index a7ed494..07cc042 100644
--- a/tsconfig.release.json
+++ b/tsconfig.release.json
@@ -3,7 +3,8 @@
"compilerOptions": {
"rootDir": ".",
"outDir": "build",
- "removeComments": true
+ "removeComments": true,
+ "declaration": true
},
"include": [
"src/**/*"