Skip to content

Commit

Permalink
Fix: includes type info
Browse files Browse the repository at this point in the history
  • Loading branch information
black7375 committed Jun 11, 2022
1 parent a78aa04 commit eeab711
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 5 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/**/*.js
build/**
2 changes: 1 addition & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
18 changes: 18 additions & 0 deletions build/src/main.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/// <reference types="node" />
export declare const targets: {
weston: string;
korean: string;
japanese: string;
chinese: string;
chinese_traditional: string;
};
export declare function getUnicodeRanges(dirPath?: string, url?: string): Promise<string[]>;
interface fontRangeOptionI {
savePath: string;
format: string;
nameFormat: string;
defaultArgs: string;
etcArgs: string;
}
export declare function fontRange(url?: string, fontPath?: string, fontRangeOption?: fontRangeOptionI['savePath'] | Partial<fontRangeOptionI>): Promise<Buffer[]>;
export {};
4 changes: 4 additions & 0 deletions build/src/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare type Diff<T, U> = T extends U ? never : T;
export declare type RequiredByValueExcept<T, TOptional extends keyof T> = Pick<T, Diff<keyof T, TOptional>> & Partial<T>;
export declare type ValueOf<T> = T[keyof T];
export {};
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"license": "MIT",
"keywords": [
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@
"include": [
"src/**/*",
"__tests__/**/*"
],
"exclude": [
"build/**/*"
]
}
3 changes: 2 additions & 1 deletion tsconfig.release.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"compilerOptions": {
"rootDir": ".",
"outDir": "build",
"removeComments": true
"removeComments": true,
"declaration": true
},
"include": [
"src/**/*"
Expand Down

0 comments on commit eeab711

Please sign in to comment.