Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
shrinktofit committed Sep 23, 2019
1 parent 301e6a7 commit 9fe344b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
13 changes: 10 additions & 3 deletions build/gift.js

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

2 changes: 1 addition & 1 deletion build/gift.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tfig",
"version": "1.0.26",
"version": "1.0.27",
"description": "Yet another tool to generate .d.ts bundle.",
"main": "build/gift.js",
"types": "build/gift.d.ts",
Expand Down
18 changes: 12 additions & 6 deletions source/gift.ts
Original file line number Diff line number Diff line change
Expand Up @@ -640,12 +640,18 @@ class BundleGenerator {
const inf = this._getInf(symbol);
if (inf) {
const mainTypeName = this._resolveSymbolPath(inf);
const remadeImportType = ts.createTypeReferenceNode(
mainTypeName,
type.typeArguments ? type.typeArguments.map((ta) => this._remakeType(ta)!) : undefined,
);
// Note: `typeof import("")` is treated as a single importType with `isTypeOf` set to true
return type.isTypeOf ? ts.createTypeOperatorNode(remadeImportType) : remadeImportType;
if (type.isTypeOf) {
// Note: `typeof import("")` is treated as a single importType with `isTypeOf` set to true
if (type.typeArguments) {
console.error(`Unexpected: typeof import("...") should not have arguments.`);
}
return ts.createTypeQueryNode(ts.createIdentifier(mainTypeName));
} else {
return ts.createTypeReferenceNode(
mainTypeName,
type.typeArguments ? type.typeArguments.map((ta) => this._remakeType(ta)!) : undefined,
);
}
}
}
} else if (ts.isIntersectionTypeNode(type)) {
Expand Down
2 changes: 1 addition & 1 deletion test/declarations-output/Cocos3D.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19004,7 +19004,7 @@ declare module "Cocos3D" {
* Toggle 是一个 CheckBox,当它和 ToggleGroup 一起使用的时候,可以变成 RadioButton。
* 可通过 cc.ToggleComponent 获得该组件。
*/ export class ToggleComponent extends ButtonComponent {
static TestEventType: keyof __internal.cocos_ui_components_button_component_TestButtonEventType & typeof __internal.cocos_ui_components_toggle_component_TestToggleEventType;
static TestEventType: typeof __internal.cocos_ui_components_button_component_TestButtonEventType & typeof __internal.cocos_ui_components_toggle_component_TestToggleEventType;
/**
* @zh
* 如果这个设置为 true,则 check mark 组件会处于 enabled 状态,否则处于 disabled 状态。
Expand Down

0 comments on commit 9fe344b

Please sign in to comment.