typescript-to-gdscript 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +324 -0
- package/dist/cache/index.d.ts +203 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +609 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/checker/godot-project.d.ts +15 -0
- package/dist/checker/godot-project.d.ts.map +1 -0
- package/dist/checker/godot-project.js +14 -0
- package/dist/checker/godot-project.js.map +1 -0
- package/dist/checker/index.d.ts +61 -0
- package/dist/checker/index.d.ts.map +1 -0
- package/dist/checker/index.js +229 -0
- package/dist/checker/index.js.map +1 -0
- package/dist/checker/ts-diagnostics.d.ts +11 -0
- package/dist/checker/ts-diagnostics.d.ts.map +1 -0
- package/dist/checker/ts-diagnostics.js +67 -0
- package/dist/checker/ts-diagnostics.js.map +1 -0
- package/dist/cli/clear-cache.d.ts +3 -0
- package/dist/cli/clear-cache.d.ts.map +1 -0
- package/dist/cli/clear-cache.js +42 -0
- package/dist/cli/clear-cache.js.map +1 -0
- package/dist/cli/convert-gd.d.ts +3 -0
- package/dist/cli/convert-gd.d.ts.map +1 -0
- package/dist/cli/convert-gd.js +148 -0
- package/dist/cli/convert-gd.js.map +1 -0
- package/dist/cli/convert.d.ts +3 -0
- package/dist/cli/convert.d.ts.map +1 -0
- package/dist/cli/convert.js +165 -0
- package/dist/cli/convert.js.map +1 -0
- package/dist/cli/generate-addon-typings.d.ts +3 -0
- package/dist/cli/generate-addon-typings.d.ts.map +1 -0
- package/dist/cli/generate-addon-typings.js +31 -0
- package/dist/cli/generate-addon-typings.js.map +1 -0
- package/dist/cli/generate-gdscript-global-typings.d.ts +3 -0
- package/dist/cli/generate-gdscript-global-typings.d.ts.map +1 -0
- package/dist/cli/generate-gdscript-global-typings.js +172 -0
- package/dist/cli/generate-gdscript-global-typings.js.map +1 -0
- package/dist/cli/generate-typings.d.ts +3 -0
- package/dist/cli/generate-typings.d.ts.map +1 -0
- package/dist/cli/generate-typings.js +48 -0
- package/dist/cli/generate-typings.js.map +1 -0
- package/dist/cli/helpers.d.ts +47 -0
- package/dist/cli/helpers.d.ts.map +1 -0
- package/dist/cli/helpers.js +180 -0
- package/dist/cli/helpers.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +35 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/init.d.ts +8 -0
- package/dist/cli/init.d.ts.map +1 -0
- package/dist/cli/init.js +222 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/initial-convert-gd-to-ts.d.ts +3 -0
- package/dist/cli/initial-convert-gd-to-ts.d.ts.map +1 -0
- package/dist/cli/initial-convert-gd-to-ts.js +149 -0
- package/dist/cli/initial-convert-gd-to-ts.js.map +1 -0
- package/dist/cli/lint.d.ts +3 -0
- package/dist/cli/lint.d.ts.map +1 -0
- package/dist/cli/lint.js +191 -0
- package/dist/cli/lint.js.map +1 -0
- package/dist/cli/open-editor.d.ts +21 -0
- package/dist/cli/open-editor.d.ts.map +1 -0
- package/dist/cli/open-editor.js +148 -0
- package/dist/cli/open-editor.js.map +1 -0
- package/dist/cli/set-latest.d.ts +3 -0
- package/dist/cli/set-latest.d.ts.map +1 -0
- package/dist/cli/set-latest.js +23 -0
- package/dist/cli/set-latest.js.map +1 -0
- package/dist/cli/validate-gd.d.ts +3 -0
- package/dist/cli/validate-gd.d.ts.map +1 -0
- package/dist/cli/validate-gd.js +37 -0
- package/dist/cli/validate-gd.js.map +1 -0
- package/dist/cli/watch.d.ts +3 -0
- package/dist/cli/watch.d.ts.map +1 -0
- package/dist/cli/watch.js +58 -0
- package/dist/cli/watch.js.map +1 -0
- package/dist/config/index.d.ts +142 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +161 -0
- package/dist/config/index.js.map +1 -0
- package/dist/converter/common/index.d.ts +169 -0
- package/dist/converter/common/index.d.ts.map +1 -0
- package/dist/converter/common/index.js +298 -0
- package/dist/converter/common/index.js.map +1 -0
- package/dist/converter/gd-to-ts/class-scope.d.ts +80 -0
- package/dist/converter/gd-to-ts/class-scope.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/class-scope.js +208 -0
- package/dist/converter/gd-to-ts/class-scope.js.map +1 -0
- package/dist/converter/gd-to-ts/context.d.ts +94 -0
- package/dist/converter/gd-to-ts/context.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/context.js +71 -0
- package/dist/converter/gd-to-ts/context.js.map +1 -0
- package/dist/converter/gd-to-ts/expressions.d.ts +18 -0
- package/dist/converter/gd-to-ts/expressions.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/expressions.js +535 -0
- package/dist/converter/gd-to-ts/expressions.js.map +1 -0
- package/dist/converter/gd-to-ts/file-scope-emitter.d.ts +34 -0
- package/dist/converter/gd-to-ts/file-scope-emitter.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/file-scope-emitter.js +191 -0
- package/dist/converter/gd-to-ts/file-scope-emitter.js.map +1 -0
- package/dist/converter/gd-to-ts/functions.d.ts +20 -0
- package/dist/converter/gd-to-ts/functions.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/functions.js +313 -0
- package/dist/converter/gd-to-ts/functions.js.map +1 -0
- package/dist/converter/gd-to-ts/helpers/explicit-convert.d.ts +42 -0
- package/dist/converter/gd-to-ts/helpers/explicit-convert.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/helpers/explicit-convert.js +173 -0
- package/dist/converter/gd-to-ts/helpers/explicit-convert.js.map +1 -0
- package/dist/converter/gd-to-ts/helpers/nullable-return.d.ts +19 -0
- package/dist/converter/gd-to-ts/helpers/nullable-return.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/helpers/nullable-return.js +116 -0
- package/dist/converter/gd-to-ts/helpers/nullable-return.js.map +1 -0
- package/dist/converter/gd-to-ts/helpers/nullable.d.ts +41 -0
- package/dist/converter/gd-to-ts/helpers/nullable.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/helpers/nullable.js +526 -0
- package/dist/converter/gd-to-ts/helpers/nullable.js.map +1 -0
- package/dist/converter/gd-to-ts/helpers/operator-fix.d.ts +20 -0
- package/dist/converter/gd-to-ts/helpers/operator-fix.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/helpers/operator-fix.js +114 -0
- package/dist/converter/gd-to-ts/helpers/operator-fix.js.map +1 -0
- package/dist/converter/gd-to-ts/helpers/ready-field-types.d.ts +48 -0
- package/dist/converter/gd-to-ts/helpers/ready-field-types.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/helpers/ready-field-types.js +217 -0
- package/dist/converter/gd-to-ts/helpers/ready-field-types.js.map +1 -0
- package/dist/converter/gd-to-ts/helpers/unsafe-helpers.d.ts +64 -0
- package/dist/converter/gd-to-ts/helpers/unsafe-helpers.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/helpers/unsafe-helpers.js +336 -0
- package/dist/converter/gd-to-ts/helpers/unsafe-helpers.js.map +1 -0
- package/dist/converter/gd-to-ts/imports.d.ts +47 -0
- package/dist/converter/gd-to-ts/imports.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/imports.js +98 -0
- package/dist/converter/gd-to-ts/imports.js.map +1 -0
- package/dist/converter/gd-to-ts/index.d.ts +59 -0
- package/dist/converter/gd-to-ts/index.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/index.js +189 -0
- package/dist/converter/gd-to-ts/index.js.map +1 -0
- package/dist/converter/gd-to-ts/inject-imports.d.ts +55 -0
- package/dist/converter/gd-to-ts/inject-imports.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/inject-imports.js +161 -0
- package/dist/converter/gd-to-ts/inject-imports.js.map +1 -0
- package/dist/converter/gd-to-ts/members.d.ts +15 -0
- package/dist/converter/gd-to-ts/members.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/members.js +397 -0
- package/dist/converter/gd-to-ts/members.js.map +1 -0
- package/dist/converter/gd-to-ts/source-emitter.d.ts +27 -0
- package/dist/converter/gd-to-ts/source-emitter.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/source-emitter.js +420 -0
- package/dist/converter/gd-to-ts/source-emitter.js.map +1 -0
- package/dist/converter/gd-to-ts/statements.d.ts +6 -0
- package/dist/converter/gd-to-ts/statements.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/statements.js +385 -0
- package/dist/converter/gd-to-ts/statements.js.map +1 -0
- package/dist/converter/gd-to-ts/ts-helpers.d.ts +49 -0
- package/dist/converter/gd-to-ts/ts-helpers.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/ts-helpers.js +161 -0
- package/dist/converter/gd-to-ts/ts-helpers.js.map +1 -0
- package/dist/converter/gd-to-ts/type-inference.d.ts +41 -0
- package/dist/converter/gd-to-ts/type-inference.d.ts.map +1 -0
- package/dist/converter/gd-to-ts/type-inference.js +168 -0
- package/dist/converter/gd-to-ts/type-inference.js.map +1 -0
- package/dist/converter/ts-to-gd/class-body.d.ts +62 -0
- package/dist/converter/ts-to-gd/class-body.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/class-body.js +290 -0
- package/dist/converter/ts-to-gd/class-body.js.map +1 -0
- package/dist/converter/ts-to-gd/class-members.d.ts +18 -0
- package/dist/converter/ts-to-gd/class-members.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/class-members.js +246 -0
- package/dist/converter/ts-to-gd/class-members.js.map +1 -0
- package/dist/converter/ts-to-gd/diagnostics.d.ts +27 -0
- package/dist/converter/ts-to-gd/diagnostics.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/diagnostics.js +95 -0
- package/dist/converter/ts-to-gd/diagnostics.js.map +1 -0
- package/dist/converter/ts-to-gd/emitter.d.ts +40 -0
- package/dist/converter/ts-to-gd/emitter.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/emitter.js +88 -0
- package/dist/converter/ts-to-gd/emitter.js.map +1 -0
- package/dist/converter/ts-to-gd/expressions.d.ts +46 -0
- package/dist/converter/ts-to-gd/expressions.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/expressions.js +793 -0
- package/dist/converter/ts-to-gd/expressions.js.map +1 -0
- package/dist/converter/ts-to-gd/file-scope.d.ts +42 -0
- package/dist/converter/ts-to-gd/file-scope.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/file-scope.js +463 -0
- package/dist/converter/ts-to-gd/file-scope.js.map +1 -0
- package/dist/converter/ts-to-gd/gd-getset.d.ts +31 -0
- package/dist/converter/ts-to-gd/gd-getset.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/gd-getset.js +219 -0
- package/dist/converter/ts-to-gd/gd-getset.js.map +1 -0
- package/dist/converter/ts-to-gd/gd-helpers.d.ts +44 -0
- package/dist/converter/ts-to-gd/gd-helpers.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/gd-helpers.js +458 -0
- package/dist/converter/ts-to-gd/gd-helpers.js.map +1 -0
- package/dist/converter/ts-to-gd/imports.d.ts +67 -0
- package/dist/converter/ts-to-gd/imports.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/imports.js +150 -0
- package/dist/converter/ts-to-gd/imports.js.map +1 -0
- package/dist/converter/ts-to-gd/index.d.ts +34 -0
- package/dist/converter/ts-to-gd/index.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/index.js +52 -0
- package/dist/converter/ts-to-gd/index.js.map +1 -0
- package/dist/converter/ts-to-gd/parameters.d.ts +12 -0
- package/dist/converter/ts-to-gd/parameters.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/parameters.js +100 -0
- package/dist/converter/ts-to-gd/parameters.js.map +1 -0
- package/dist/converter/ts-to-gd/statements.d.ts +12 -0
- package/dist/converter/ts-to-gd/statements.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/statements.js +262 -0
- package/dist/converter/ts-to-gd/statements.js.map +1 -0
- package/dist/converter/ts-to-gd/transformer-types.d.ts +33 -0
- package/dist/converter/ts-to-gd/transformer-types.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/transformer-types.js +2 -0
- package/dist/converter/ts-to-gd/transformer-types.js.map +1 -0
- package/dist/converter/ts-to-gd/transformer.d.ts +83 -0
- package/dist/converter/ts-to-gd/transformer.d.ts.map +1 -0
- package/dist/converter/ts-to-gd/transformer.js +344 -0
- package/dist/converter/ts-to-gd/transformer.js.map +1 -0
- package/dist/eslint/plugin.d.ts +11 -0
- package/dist/eslint/plugin.d.ts.map +1 -0
- package/dist/eslint/plugin.js +12 -0
- package/dist/eslint/plugin.js.map +1 -0
- package/dist/eslint/rules/convert.d.ts +4 -0
- package/dist/eslint/rules/convert.d.ts.map +1 -0
- package/dist/eslint/rules/convert.js +286 -0
- package/dist/eslint/rules/convert.js.map +1 -0
- package/dist/eslint/rules/no-in-variant.d.ts +10 -0
- package/dist/eslint/rules/no-in-variant.d.ts.map +1 -0
- package/dist/eslint/rules/no-in-variant.js +126 -0
- package/dist/eslint/rules/no-in-variant.js.map +1 -0
- package/dist/godot-validate/error-parser.d.ts +64 -0
- package/dist/godot-validate/error-parser.d.ts.map +1 -0
- package/dist/godot-validate/error-parser.js +170 -0
- package/dist/godot-validate/error-parser.js.map +1 -0
- package/dist/godot-validate/index.d.ts +76 -0
- package/dist/godot-validate/index.d.ts.map +1 -0
- package/dist/godot-validate/index.js +267 -0
- package/dist/godot-validate/index.js.map +1 -0
- package/dist/godot-validate/source-map-remap.d.ts +48 -0
- package/dist/godot-validate/source-map-remap.d.ts.map +1 -0
- package/dist/godot-validate/source-map-remap.js +195 -0
- package/dist/godot-validate/source-map-remap.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/gdscript/generate-types.d.ts +7 -0
- package/dist/parser/gdscript/generate-types.d.ts.map +1 -0
- package/dist/parser/gdscript/generate-types.js +134 -0
- package/dist/parser/gdscript/generate-types.js.map +1 -0
- package/dist/parser/gdscript/index.d.ts +9 -0
- package/dist/parser/gdscript/index.d.ts.map +1 -0
- package/dist/parser/gdscript/index.js +17 -0
- package/dist/parser/gdscript/index.js.map +1 -0
- package/dist/parser/gdscript/types.d.ts +689 -0
- package/dist/parser/gdscript/types.d.ts.map +1 -0
- package/dist/parser/gdscript/types.js +89 -0
- package/dist/parser/gdscript/types.js.map +1 -0
- package/dist/parser/godot-resource/index.d.ts +7 -0
- package/dist/parser/godot-resource/index.d.ts.map +1 -0
- package/dist/parser/godot-resource/index.js +14 -0
- package/dist/parser/godot-resource/index.js.map +1 -0
- package/dist/parser/godot-resource/types.d.ts +330 -0
- package/dist/parser/godot-resource/types.d.ts.map +1 -0
- package/dist/parser/godot-resource/types.js +22 -0
- package/dist/parser/godot-resource/types.js.map +1 -0
- package/dist/parser/typescript/index.d.ts +12 -0
- package/dist/parser/typescript/index.d.ts.map +1 -0
- package/dist/parser/typescript/index.js +30 -0
- package/dist/parser/typescript/index.js.map +1 -0
- package/dist/sourcemap/index.d.ts +59 -0
- package/dist/sourcemap/index.d.ts.map +1 -0
- package/dist/sourcemap/index.js +85 -0
- package/dist/sourcemap/index.js.map +1 -0
- package/dist/ts-plugin/index.d.ts +47 -0
- package/dist/ts-plugin/index.d.ts.map +1 -0
- package/dist/ts-plugin/index.js +227 -0
- package/dist/ts-plugin/index.js.map +1 -0
- package/dist/ts-plugin/lint.d.ts +48 -0
- package/dist/ts-plugin/lint.d.ts.map +1 -0
- package/dist/ts-plugin/lint.js +424 -0
- package/dist/ts-plugin/lint.js.map +1 -0
- package/dist/ts-plugin/lru.d.ts +40 -0
- package/dist/ts-plugin/lru.d.ts.map +1 -0
- package/dist/ts-plugin/lru.js +82 -0
- package/dist/ts-plugin/lru.js.map +1 -0
- package/dist/ts-plugin/navigation.d.ts +58 -0
- package/dist/ts-plugin/navigation.d.ts.map +1 -0
- package/dist/ts-plugin/navigation.js +427 -0
- package/dist/ts-plugin/navigation.js.map +1 -0
- package/dist/ts-plugin/shadow-refs.d.ts +31 -0
- package/dist/ts-plugin/shadow-refs.d.ts.map +1 -0
- package/dist/ts-plugin/shadow-refs.js +76 -0
- package/dist/ts-plugin/shadow-refs.js.map +1 -0
- package/dist/ts-plugin/snapshot-transform.d.ts +61 -0
- package/dist/ts-plugin/snapshot-transform.d.ts.map +1 -0
- package/dist/ts-plugin/snapshot-transform.js +55 -0
- package/dist/ts-plugin/snapshot-transform.js.map +1 -0
- package/dist/typings/class-generator.d.ts +54 -0
- package/dist/typings/class-generator.d.ts.map +1 -0
- package/dist/typings/class-generator.js +524 -0
- package/dist/typings/class-generator.js.map +1 -0
- package/dist/typings/classes.d.ts +24 -0
- package/dist/typings/classes.d.ts.map +1 -0
- package/dist/typings/classes.js +139 -0
- package/dist/typings/classes.js.map +1 -0
- package/dist/typings/content-generators.d.ts +62 -0
- package/dist/typings/content-generators.d.ts.map +1 -0
- package/dist/typings/content-generators.js +536 -0
- package/dist/typings/content-generators.js.map +1 -0
- package/dist/typings/global-generator.d.ts +32 -0
- package/dist/typings/global-generator.d.ts.map +1 -0
- package/dist/typings/global-generator.js +242 -0
- package/dist/typings/global-generator.js.map +1 -0
- package/dist/typings/godot-docs.d.ts +27 -0
- package/dist/typings/godot-docs.d.ts.map +1 -0
- package/dist/typings/godot-docs.js +310 -0
- package/dist/typings/godot-docs.js.map +1 -0
- package/dist/typings/godot-registry.d.ts +123 -0
- package/dist/typings/godot-registry.d.ts.map +1 -0
- package/dist/typings/godot-registry.js +157 -0
- package/dist/typings/godot-registry.js.map +1 -0
- package/dist/typings/index.d.ts +4 -0
- package/dist/typings/index.d.ts.map +1 -0
- package/dist/typings/index.js +4 -0
- package/dist/typings/index.js.map +1 -0
- package/dist/typings/override-system.d.ts +36 -0
- package/dist/typings/override-system.d.ts.map +1 -0
- package/dist/typings/override-system.js +341 -0
- package/dist/typings/override-system.js.map +1 -0
- package/dist/typings/registry-generator.d.ts +44 -0
- package/dist/typings/registry-generator.d.ts.map +1 -0
- package/dist/typings/registry-generator.js +170 -0
- package/dist/typings/registry-generator.js.map +1 -0
- package/dist/typings/scene-parser.d.ts +113 -0
- package/dist/typings/scene-parser.d.ts.map +1 -0
- package/dist/typings/scene-parser.js +436 -0
- package/dist/typings/scene-parser.js.map +1 -0
- package/dist/typings/scene-tree.d.ts +33 -0
- package/dist/typings/scene-tree.d.ts.map +1 -0
- package/dist/typings/scene-tree.js +118 -0
- package/dist/typings/scene-tree.js.map +1 -0
- package/dist/typings/scene-utils.d.ts +131 -0
- package/dist/typings/scene-utils.d.ts.map +1 -0
- package/dist/typings/scene-utils.js +604 -0
- package/dist/typings/scene-utils.js.map +1 -0
- package/dist/typings/scenes.d.ts +96 -0
- package/dist/typings/scenes.d.ts.map +1 -0
- package/dist/typings/scenes.js +368 -0
- package/dist/typings/scenes.js.map +1 -0
- package/dist/typings/type-mapping.d.ts +76 -0
- package/dist/typings/type-mapping.d.ts.map +1 -0
- package/dist/typings/type-mapping.js +239 -0
- package/dist/typings/type-mapping.js.map +1 -0
- package/dist/typings/xml-parser.d.ts +91 -0
- package/dist/typings/xml-parser.d.ts.map +1 -0
- package/dist/typings/xml-parser.js +275 -0
- package/dist/typings/xml-parser.js.map +1 -0
- package/dist/watcher/index.d.ts +74 -0
- package/dist/watcher/index.d.ts.map +1 -0
- package/dist/watcher/index.js +410 -0
- package/dist/watcher/index.js.map +1 -0
- package/package.json +115 -0
- package/ts-plugin/index.js +9 -0
- package/ts-plugin/package.json +7 -0
- package/typings/classes/AABB.d.ts +177 -0
- package/typings/classes/AESContext.d.ts +34 -0
- package/typings/classes/AStar2D.d.ts +108 -0
- package/typings/classes/AStar3D.d.ts +108 -0
- package/typings/classes/AStarGrid2D.d.ts +184 -0
- package/typings/classes/AcceptDialog.d.ts +77 -0
- package/typings/classes/AccessibilityServer.d.ts +405 -0
- package/typings/classes/AimModifier3D.d.ts +40 -0
- package/typings/classes/AnimatableBody2D.d.ts +14 -0
- package/typings/classes/AnimatableBody3D.d.ts +14 -0
- package/typings/classes/AnimatedSprite2D.d.ts +108 -0
- package/typings/classes/AnimatedSprite3D.d.ts +89 -0
- package/typings/classes/AnimatedTexture.d.ts +54 -0
- package/typings/classes/Animation.d.ts +340 -0
- package/typings/classes/AnimationLibrary.d.ts +34 -0
- package/typings/classes/AnimationMixer.d.ts +226 -0
- package/typings/classes/AnimationNode.d.ts +116 -0
- package/typings/classes/AnimationNodeAdd2.d.ts +6 -0
- package/typings/classes/AnimationNodeAdd3.d.ts +6 -0
- package/typings/classes/AnimationNodeAnimation.d.ts +64 -0
- package/typings/classes/AnimationNodeBlend2.d.ts +6 -0
- package/typings/classes/AnimationNodeBlend3.d.ts +6 -0
- package/typings/classes/AnimationNodeBlendSpace1D.d.ts +79 -0
- package/typings/classes/AnimationNodeBlendSpace2D.d.ts +104 -0
- package/typings/classes/AnimationNodeBlendTree.d.ts +53 -0
- package/typings/classes/AnimationNodeExtension.d.ts +18 -0
- package/typings/classes/AnimationNodeOneShot.d.ts +78 -0
- package/typings/classes/AnimationNodeOutput.d.ts +6 -0
- package/typings/classes/AnimationNodeStateMachine.d.ts +80 -0
- package/typings/classes/AnimationNodeStateMachinePlayback.d.ts +67 -0
- package/typings/classes/AnimationNodeStateMachineTransition.d.ts +83 -0
- package/typings/classes/AnimationNodeSub2.d.ts +6 -0
- package/typings/classes/AnimationNodeSync.d.ts +13 -0
- package/typings/classes/AnimationNodeTimeScale.d.ts +6 -0
- package/typings/classes/AnimationNodeTimeSeek.d.ts +12 -0
- package/typings/classes/AnimationNodeTransition.d.ts +45 -0
- package/typings/classes/AnimationPlayer.d.ts +203 -0
- package/typings/classes/AnimationRootNode.d.ts +8 -0
- package/typings/classes/AnimationTree.d.ts +35 -0
- package/typings/classes/Area2D.d.ts +166 -0
- package/typings/classes/Area3D.d.ts +214 -0
- package/typings/classes/Array.d.ts +301 -0
- package/typings/classes/ArrayMesh.d.ts +94 -0
- package/typings/classes/ArrayOccluder3D.d.ts +23 -0
- package/typings/classes/AspectRatioContainer.d.ts +46 -0
- package/typings/classes/AtlasTexture.d.ts +32 -0
- package/typings/classes/AudioBusLayout.d.ts +6 -0
- package/typings/classes/AudioEffect.d.ts +11 -0
- package/typings/classes/AudioEffectAmplify.d.ts +19 -0
- package/typings/classes/AudioEffectBandLimitFilter.d.ts +6 -0
- package/typings/classes/AudioEffectBandPassFilter.d.ts +6 -0
- package/typings/classes/AudioEffectCapture.d.ts +35 -0
- package/typings/classes/AudioEffectChorus.d.ts +108 -0
- package/typings/classes/AudioEffectCompressor.d.ts +47 -0
- package/typings/classes/AudioEffectDelay.d.ts +71 -0
- package/typings/classes/AudioEffectDistortion.d.ts +55 -0
- package/typings/classes/AudioEffectEQ.d.ts +15 -0
- package/typings/classes/AudioEffectEQ10.d.ts +9 -0
- package/typings/classes/AudioEffectEQ21.d.ts +9 -0
- package/typings/classes/AudioEffectEQ6.d.ts +9 -0
- package/typings/classes/AudioEffectFilter.d.ts +50 -0
- package/typings/classes/AudioEffectHardLimiter.d.ts +24 -0
- package/typings/classes/AudioEffectHighPassFilter.d.ts +6 -0
- package/typings/classes/AudioEffectHighShelfFilter.d.ts +6 -0
- package/typings/classes/AudioEffectInstance.d.ts +16 -0
- package/typings/classes/AudioEffectLimiter.d.ts +26 -0
- package/typings/classes/AudioEffectLowPassFilter.d.ts +6 -0
- package/typings/classes/AudioEffectLowShelfFilter.d.ts +6 -0
- package/typings/classes/AudioEffectNotchFilter.d.ts +6 -0
- package/typings/classes/AudioEffectPanner.d.ts +15 -0
- package/typings/classes/AudioEffectPhaser.d.ts +37 -0
- package/typings/classes/AudioEffectPitchShift.d.ts +47 -0
- package/typings/classes/AudioEffectRecord.d.ts +19 -0
- package/typings/classes/AudioEffectReverb.d.ts +55 -0
- package/typings/classes/AudioEffectSpectrumAnalyzer.d.ts +40 -0
- package/typings/classes/AudioEffectSpectrumAnalyzerInstance.d.ts +17 -0
- package/typings/classes/AudioEffectStereoEnhance.d.ts +27 -0
- package/typings/classes/AudioListener2D.d.ts +15 -0
- package/typings/classes/AudioListener3D.d.ts +37 -0
- package/typings/classes/AudioSample.d.ts +6 -0
- package/typings/classes/AudioSamplePlayback.d.ts +6 -0
- package/typings/classes/AudioServer.d.ts +199 -0
- package/typings/classes/AudioStream.d.ts +66 -0
- package/typings/classes/AudioStreamGenerator.d.ts +38 -0
- package/typings/classes/AudioStreamGeneratorPlayback.d.ts +28 -0
- package/typings/classes/AudioStreamMicrophone.d.ts +6 -0
- package/typings/classes/AudioStreamPlayback.d.ts +69 -0
- package/typings/classes/AudioStreamPlaybackPolyphonic.d.ts +32 -0
- package/typings/classes/AudioStreamPlaybackResampled.d.ts +16 -0
- package/typings/classes/AudioStreamPlayer.d.ts +110 -0
- package/typings/classes/AudioStreamPlayer2D.d.ts +96 -0
- package/typings/classes/AudioStreamPlayer3D.d.ts +162 -0
- package/typings/classes/AudioStreamPolyphonic.d.ts +12 -0
- package/typings/classes/AudioStreamRandomizer.d.ts +67 -0
- package/typings/classes/AudioStreamWAV.d.ts +87 -0
- package/typings/classes/AwaitTweener.d.ts +10 -0
- package/typings/classes/BackBufferCopy.d.ts +26 -0
- package/typings/classes/BaseButton.d.ts +116 -0
- package/typings/classes/BaseMaterial3D.d.ts +1021 -0
- package/typings/classes/Basis.d.ts +225 -0
- package/typings/classes/BitMap.d.ts +42 -0
- package/typings/classes/BlitMaterial.d.ts +22 -0
- package/typings/classes/Bone2D.d.ts +45 -0
- package/typings/classes/BoneAttachment3D.d.ts +39 -0
- package/typings/classes/BoneConstraint3D.d.ts +67 -0
- package/typings/classes/BoneMap.d.ts +39 -0
- package/typings/classes/BoneTwistDisperser3D.d.ts +126 -0
- package/typings/classes/BoxContainer.d.ts +36 -0
- package/typings/classes/BoxMesh.d.ts +22 -0
- package/typings/classes/BoxOccluder3D.d.ts +10 -0
- package/typings/classes/BoxShape3D.d.ts +10 -0
- package/typings/classes/Button.d.ts +75 -0
- package/typings/classes/ButtonGroup.d.ts +21 -0
- package/typings/classes/CCDIK3D.d.ts +6 -0
- package/typings/classes/CPUParticles2D.d.ts +397 -0
- package/typings/classes/CPUParticles3D.d.ts +421 -0
- package/typings/classes/Callable.d.ts +203 -0
- package/typings/classes/CallbackTweener.d.ts +11 -0
- package/typings/classes/Camera2D.d.ts +214 -0
- package/typings/classes/Camera3D.d.ts +207 -0
- package/typings/classes/CameraAttributes.d.ts +35 -0
- package/typings/classes/CameraAttributesPhysical.d.ts +61 -0
- package/typings/classes/CameraAttributesPractical.d.ts +64 -0
- package/typings/classes/CameraFeed.d.ts +81 -0
- package/typings/classes/CameraServer.d.ts +44 -0
- package/typings/classes/CameraTexture.d.ts +19 -0
- package/typings/classes/CanvasGroup.d.ts +24 -0
- package/typings/classes/CanvasItem.d.ts +503 -0
- package/typings/classes/CanvasItemMaterial.d.ts +61 -0
- package/typings/classes/CanvasLayer.d.ts +74 -0
- package/typings/classes/CanvasModulate.d.ts +10 -0
- package/typings/classes/CanvasTexture.d.ts +42 -0
- package/typings/classes/CapsuleMesh.d.ts +28 -0
- package/typings/classes/CapsuleShape2D.d.ts +26 -0
- package/typings/classes/CapsuleShape3D.d.ts +26 -0
- package/typings/classes/CenterContainer.d.ts +10 -0
- package/typings/classes/ChainIK3D.d.ts +50 -0
- package/typings/classes/CharFXTransform.d.ts +88 -0
- package/typings/classes/CharacterBody2D.d.ts +199 -0
- package/typings/classes/CharacterBody3D.d.ts +201 -0
- package/typings/classes/CheckBox.d.ts +8 -0
- package/typings/classes/CheckButton.d.ts +8 -0
- package/typings/classes/CircleShape2D.d.ts +10 -0
- package/typings/classes/ClassDB.d.ts +110 -0
- package/typings/classes/CodeEdit.d.ts +402 -0
- package/typings/classes/CodeHighlighter.d.ts +81 -0
- package/typings/classes/CollisionObject2D.d.ts +171 -0
- package/typings/classes/CollisionObject3D.d.ts +141 -0
- package/typings/classes/CollisionPolygon2D.d.ts +51 -0
- package/typings/classes/CollisionPolygon3D.d.ts +39 -0
- package/typings/classes/CollisionShape2D.d.ts +41 -0
- package/typings/classes/CollisionShape3D.d.ts +36 -0
- package/typings/classes/Color.d.ts +517 -0
- package/typings/classes/ColorPalette.d.ts +12 -0
- package/typings/classes/ColorPicker.d.ts +118 -0
- package/typings/classes/ColorPickerButton.d.ts +37 -0
- package/typings/classes/ColorRect.d.ts +10 -0
- package/typings/classes/Compositor.d.ts +12 -0
- package/typings/classes/CompositorEffect.d.ts +76 -0
- package/typings/classes/CompressedCubemap.d.ts +6 -0
- package/typings/classes/CompressedCubemapArray.d.ts +6 -0
- package/typings/classes/CompressedTexture2D.d.ts +13 -0
- package/typings/classes/CompressedTexture2DArray.d.ts +6 -0
- package/typings/classes/CompressedTexture3D.d.ts +12 -0
- package/typings/classes/CompressedTextureLayered.d.ts +12 -0
- package/typings/classes/ConcavePolygonShape2D.d.ts +12 -0
- package/typings/classes/ConcavePolygonShape3D.d.ts +21 -0
- package/typings/classes/ConeTwistJoint3D.d.ts +63 -0
- package/typings/classes/ConfigFile.d.ts +71 -0
- package/typings/classes/ConfirmationDialog.d.ts +19 -0
- package/typings/classes/Container.d.ts +42 -0
- package/typings/classes/Control.d.ts +1125 -0
- package/typings/classes/ConvertTransformModifier3D.d.ts +65 -0
- package/typings/classes/ConvexPolygonShape2D.d.ts +18 -0
- package/typings/classes/ConvexPolygonShape3D.d.ts +10 -0
- package/typings/classes/CopyTransformModifier3D.d.ts +117 -0
- package/typings/classes/Crypto.d.ts +41 -0
- package/typings/classes/CryptoKey.d.ts +26 -0
- package/typings/classes/Cubemap.d.ts +8 -0
- package/typings/classes/CubemapArray.d.ts +8 -0
- package/typings/classes/Curve.d.ts +96 -0
- package/typings/classes/Curve2D.d.ts +97 -0
- package/typings/classes/Curve3D.d.ts +129 -0
- package/typings/classes/CurveTexture.d.ts +30 -0
- package/typings/classes/CurveXYZTexture.d.ts +25 -0
- package/typings/classes/CylinderMesh.d.ts +48 -0
- package/typings/classes/CylinderShape3D.d.ts +14 -0
- package/typings/classes/DPITexture.d.ts +48 -0
- package/typings/classes/DTLSServer.d.ts +13 -0
- package/typings/classes/DampedSpringJoint2D.d.ts +28 -0
- package/typings/classes/Decal.d.ts +120 -0
- package/typings/classes/Dictionary.d.ts +181 -0
- package/typings/classes/DirAccess.d.ts +199 -0
- package/typings/classes/DirectionalLight2D.d.ts +16 -0
- package/typings/classes/DirectionalLight3D.d.ts +71 -0
- package/typings/classes/DisplayServer.d.ts +2153 -0
- package/typings/classes/DrawableTexture2D.d.ts +47 -0
- package/typings/classes/EditorCommandPalette.d.ts +21 -0
- package/typings/classes/EditorContextMenuPlugin.d.ts +59 -0
- package/typings/classes/EditorDebuggerPlugin.d.ts +33 -0
- package/typings/classes/EditorDebuggerSession.d.ts +41 -0
- package/typings/classes/EditorDock.d.ts +141 -0
- package/typings/classes/EditorExportPlatform.d.ts +125 -0
- package/typings/classes/EditorExportPlatformAppleEmbedded.d.ts +6 -0
- package/typings/classes/EditorExportPlatformExtension.d.ts +131 -0
- package/typings/classes/EditorExportPlatformPC.d.ts +6 -0
- package/typings/classes/EditorExportPlugin.d.ts +207 -0
- package/typings/classes/EditorExportPreset.d.ts +83 -0
- package/typings/classes/EditorFeatureProfile.d.ts +90 -0
- package/typings/classes/EditorFileDialog.d.ts +15 -0
- package/typings/classes/EditorFileSystem.d.ts +48 -0
- package/typings/classes/EditorFileSystemDirectory.d.ts +42 -0
- package/typings/classes/EditorFileSystemImportFormatSupportQuery.d.ts +12 -0
- package/typings/classes/EditorImportPlugin.d.ts +67 -0
- package/typings/classes/EditorInspector.d.ts +54 -0
- package/typings/classes/EditorInspectorPlugin.d.ts +34 -0
- package/typings/classes/EditorInterface.d.ts +254 -0
- package/typings/classes/EditorNode3DGizmo.d.ts +104 -0
- package/typings/classes/EditorNode3DGizmoPlugin.d.ts +103 -0
- package/typings/classes/EditorPaths.d.ts +52 -0
- package/typings/classes/EditorPlugin.d.ts +384 -0
- package/typings/classes/EditorProperty.d.ts +133 -0
- package/typings/classes/EditorResourceConversionPlugin.d.ts +20 -0
- package/typings/classes/EditorResourcePicker.d.ts +47 -0
- package/typings/classes/EditorResourcePreview.d.ts +25 -0
- package/typings/classes/EditorResourcePreviewGenerator.d.ts +34 -0
- package/typings/classes/EditorResourceTooltipPlugin.d.ts +20 -0
- package/typings/classes/EditorSceneFormatImporter.d.ts +36 -0
- package/typings/classes/EditorScenePostImport.d.ts +10 -0
- package/typings/classes/EditorScenePostImportPlugin.d.ts +57 -0
- package/typings/classes/EditorScript.d.ts +18 -0
- package/typings/classes/EditorScriptPicker.d.ts +10 -0
- package/typings/classes/EditorSelection.d.ts +29 -0
- package/typings/classes/EditorSettings.d.ts +1821 -0
- package/typings/classes/EditorSpinSlider.d.ts +65 -0
- package/typings/classes/EditorSyntaxHighlighter.d.ts +12 -0
- package/typings/classes/EditorToaster.d.ts +16 -0
- package/typings/classes/EditorTranslationParserPlugin.d.ts +12 -0
- package/typings/classes/EditorUndoRedoManager.d.ts +86 -0
- package/typings/classes/EditorVCSInterface.d.ts +121 -0
- package/typings/classes/EncodedObjectAsID.d.ts +12 -0
- package/typings/classes/Engine.d.ts +202 -0
- package/typings/classes/EngineDebugger.d.ts +66 -0
- package/typings/classes/EngineProfiler.d.ts +14 -0
- package/typings/classes/Environment.d.ts +720 -0
- package/typings/classes/Expression.d.ts +20 -0
- package/typings/classes/ExternalTexture.d.ts +22 -0
- package/typings/classes/FABRIK3D.d.ts +6 -0
- package/typings/classes/FileAccess.d.ts +411 -0
- package/typings/classes/FileDialog.d.ts +277 -0
- package/typings/classes/FileSystemDock.d.ts +35 -0
- package/typings/classes/FlowContainer.d.ts +64 -0
- package/typings/classes/FogMaterial.d.ts +43 -0
- package/typings/classes/FogVolume.d.ts +26 -0
- package/typings/classes/FoldableContainer.d.ts +65 -0
- package/typings/classes/FoldableGroup.d.ts +21 -0
- package/typings/classes/Font.d.ts +144 -0
- package/typings/classes/FontFile.d.ts +286 -0
- package/typings/classes/FontVariation.d.ts +56 -0
- package/typings/classes/FramebufferCacheRD.d.ts +10 -0
- package/typings/classes/GDExtension.d.ts +26 -0
- package/typings/classes/GDExtensionManager.d.ts +60 -0
- package/typings/classes/GPUParticles2D.d.ts +220 -0
- package/typings/classes/GPUParticles3D.d.ts +239 -0
- package/typings/classes/GPUParticlesAttractor3D.d.ts +33 -0
- package/typings/classes/GPUParticlesAttractorBox3D.d.ts +10 -0
- package/typings/classes/GPUParticlesAttractorSphere3D.d.ts +13 -0
- package/typings/classes/GPUParticlesAttractorVectorField3D.d.ts +19 -0
- package/typings/classes/GPUParticlesCollision3D.d.ts +14 -0
- package/typings/classes/GPUParticlesCollisionBox3D.d.ts +10 -0
- package/typings/classes/GPUParticlesCollisionHeightField3D.d.ts +75 -0
- package/typings/classes/GPUParticlesCollisionSDF3D.d.ts +59 -0
- package/typings/classes/GPUParticlesCollisionSphere3D.d.ts +10 -0
- package/typings/classes/Generic6DOFJoint3D.d.ts +241 -0
- package/typings/classes/Geometry2D.d.ts +147 -0
- package/typings/classes/Geometry3D.d.ts +67 -0
- package/typings/classes/GeometryInstance3D.d.ts +183 -0
- package/typings/classes/GodotInstance.d.ts +20 -0
- package/typings/classes/Gradient.d.ts +74 -0
- package/typings/classes/GradientTexture1D.d.ts +18 -0
- package/typings/classes/GradientTexture2D.d.ts +64 -0
- package/typings/classes/GraphEdit.d.ts +306 -0
- package/typings/classes/GraphElement.d.ts +56 -0
- package/typings/classes/GraphFrame.d.ts +46 -0
- package/typings/classes/GraphNode.d.ts +132 -0
- package/typings/classes/GridContainer.d.ts +12 -0
- package/typings/classes/GrooveJoint2D.d.ts +18 -0
- package/typings/classes/HBoxContainer.d.ts +6 -0
- package/typings/classes/HFlowContainer.d.ts +6 -0
- package/typings/classes/HMACContext.d.ts +16 -0
- package/typings/classes/HScrollBar.d.ts +6 -0
- package/typings/classes/HSeparator.d.ts +6 -0
- package/typings/classes/HSlider.d.ts +6 -0
- package/typings/classes/HSplitContainer.d.ts +8 -0
- package/typings/classes/HTTPClient.d.ts +384 -0
- package/typings/classes/HTTPRequest.d.ts +124 -0
- package/typings/classes/HashingContext.d.ts +22 -0
- package/typings/classes/HeightMapShape3D.d.ts +36 -0
- package/typings/classes/HingeJoint3D.d.ts +66 -0
- package/typings/classes/IKModifier3D.d.ts +22 -0
- package/typings/classes/IP.d.ts +71 -0
- package/typings/classes/Image.d.ts +567 -0
- package/typings/classes/ImageFormatLoader.d.ts +11 -0
- package/typings/classes/ImageFormatLoaderExtension.d.ts +20 -0
- package/typings/classes/ImageTexture.d.ts +25 -0
- package/typings/classes/ImageTexture3D.d.ts +14 -0
- package/typings/classes/ImageTextureLayered.d.ts +20 -0
- package/typings/classes/ImmediateMesh.d.ts +31 -0
- package/typings/classes/ImporterMesh.d.ts +84 -0
- package/typings/classes/ImporterMeshInstance3D.d.ts +35 -0
- package/typings/classes/Input.d.ts +504 -0
- package/typings/classes/InputEvent.d.ts +85 -0
- package/typings/classes/InputEventAction.d.ts +27 -0
- package/typings/classes/InputEventFromWindow.d.ts +10 -0
- package/typings/classes/InputEventGesture.d.ts +11 -0
- package/typings/classes/InputEventJoypadButton.d.ts +16 -0
- package/typings/classes/InputEventJoypadMotion.d.ts +16 -0
- package/typings/classes/InputEventKey.d.ts +86 -0
- package/typings/classes/InputEventMIDI.d.ts +59 -0
- package/typings/classes/InputEventMagnifyGesture.d.ts +12 -0
- package/typings/classes/InputEventMouse.d.ts +25 -0
- package/typings/classes/InputEventMouseButton.d.ts +26 -0
- package/typings/classes/InputEventMouseMotion.d.ts +54 -0
- package/typings/classes/InputEventPanGesture.d.ts +10 -0
- package/typings/classes/InputEventScreenDrag.d.ts +54 -0
- package/typings/classes/InputEventScreenTouch.d.ts +24 -0
- package/typings/classes/InputEventShortcut.d.ts +12 -0
- package/typings/classes/InputEventWithModifiers.d.ts +37 -0
- package/typings/classes/InputMap.d.ts +50 -0
- package/typings/classes/InstancePlaceholder.d.ts +20 -0
- package/typings/classes/IntervalTweener.d.ts +6 -0
- package/typings/classes/ItemList.d.ts +277 -0
- package/typings/classes/IterateIK3D.d.ts +85 -0
- package/typings/classes/JNISingleton.d.ts +8 -0
- package/typings/classes/JSON.d.ts +53 -0
- package/typings/classes/JSONRPC.d.ts +59 -0
- package/typings/classes/JacobianIK3D.d.ts +6 -0
- package/typings/classes/JavaClass.d.ts +16 -0
- package/typings/classes/JavaClassWrapper.d.ts +20 -0
- package/typings/classes/JavaObject.d.ts +10 -0
- package/typings/classes/JavaScriptBridge.d.ts +62 -0
- package/typings/classes/JavaScriptObject.d.ts +6 -0
- package/typings/classes/Joint2D.d.ts +28 -0
- package/typings/classes/Joint3D.d.ts +34 -0
- package/typings/classes/JointLimitation3D.d.ts +6 -0
- package/typings/classes/JointLimitationCone3D.d.ts +13 -0
- package/typings/classes/KinematicCollision2D.d.ts +36 -0
- package/typings/classes/KinematicCollision3D.d.ts +50 -0
- package/typings/classes/Label.d.ts +134 -0
- package/typings/classes/Label3D.d.ts +202 -0
- package/typings/classes/LabelSettings.d.ts +93 -0
- package/typings/classes/Light2D.d.ts +109 -0
- package/typings/classes/Light3D.d.ts +227 -0
- package/typings/classes/LightOccluder2D.d.ts +22 -0
- package/typings/classes/LightmapGI.d.ts +225 -0
- package/typings/classes/LightmapGIData.d.ts +50 -0
- package/typings/classes/LightmapProbe.d.ts +6 -0
- package/typings/classes/Lightmapper.d.ts +6 -0
- package/typings/classes/LightmapperRD.d.ts +6 -0
- package/typings/classes/LimitAngularVelocityModifier3D.d.ts +50 -0
- package/typings/classes/Line2D.d.ts +127 -0
- package/typings/classes/LineEdit.d.ts +370 -0
- package/typings/classes/LinkButton.d.ts +54 -0
- package/typings/classes/Logger.d.ts +31 -0
- package/typings/classes/LookAtModifier3D.d.ts +196 -0
- package/typings/classes/MainLoop.d.ts +80 -0
- package/typings/classes/MarginContainer.d.ts +6 -0
- package/typings/classes/Marker2D.d.ts +10 -0
- package/typings/classes/Marker3D.d.ts +10 -0
- package/typings/classes/Marshalls.d.ts +27 -0
- package/typings/classes/Material.d.ts +50 -0
- package/typings/classes/MenuBar.d.ts +64 -0
- package/typings/classes/MenuButton.d.ts +35 -0
- package/typings/classes/Mesh.d.ts +255 -0
- package/typings/classes/MeshConvexDecompositionSettings.d.ts +68 -0
- package/typings/classes/MeshDataTool.d.ts +99 -0
- package/typings/classes/MeshInstance2D.d.ts +19 -0
- package/typings/classes/MeshInstance3D.d.ts +87 -0
- package/typings/classes/MeshLibrary.d.ts +68 -0
- package/typings/classes/MeshTexture.d.ts +19 -0
- package/typings/classes/MethodTweener.d.ts +18 -0
- package/typings/classes/MissingNode.d.ts +26 -0
- package/typings/classes/MissingResource.d.ts +16 -0
- package/typings/classes/ModifierBoneTarget3D.d.ts +14 -0
- package/typings/classes/MovieWriter.d.ts +36 -0
- package/typings/classes/MultiMesh.d.ts +138 -0
- package/typings/classes/MultiMeshInstance2D.d.ts +19 -0
- package/typings/classes/MultiMeshInstance3D.d.ts +12 -0
- package/typings/classes/MultiplayerAPI.d.ts +93 -0
- package/typings/classes/MultiplayerAPIExtension.d.ts +24 -0
- package/typings/classes/MultiplayerPeer.d.ts +90 -0
- package/typings/classes/MultiplayerPeerExtension.d.ts +90 -0
- package/typings/classes/Mutex.d.ts +22 -0
- package/typings/classes/NativeMenu.d.ts +428 -0
- package/typings/classes/NavigationAgent2D.d.ts +292 -0
- package/typings/classes/NavigationAgent3D.d.ts +311 -0
- package/typings/classes/NavigationLink2D.d.ts +77 -0
- package/typings/classes/NavigationLink3D.d.ts +77 -0
- package/typings/classes/NavigationMesh.d.ts +207 -0
- package/typings/classes/NavigationMeshGenerator.d.ts +22 -0
- package/typings/classes/NavigationMeshSourceGeometryData2D.d.ts +52 -0
- package/typings/classes/NavigationMeshSourceGeometryData3D.d.ts +64 -0
- package/typings/classes/NavigationObstacle2D.d.ts +67 -0
- package/typings/classes/NavigationObstacle3D.d.ts +80 -0
- package/typings/classes/NavigationPathQueryParameters2D.d.ts +114 -0
- package/typings/classes/NavigationPathQueryParameters3D.d.ts +114 -0
- package/typings/classes/NavigationPathQueryResult2D.d.ts +41 -0
- package/typings/classes/NavigationPathQueryResult3D.d.ts +41 -0
- package/typings/classes/NavigationPolygon.d.ts +150 -0
- package/typings/classes/NavigationRegion2D.d.ts +74 -0
- package/typings/classes/NavigationRegion3D.d.ts +72 -0
- package/typings/classes/NavigationServer2D.d.ts +443 -0
- package/typings/classes/NavigationServer2DManager.d.ts +16 -0
- package/typings/classes/NavigationServer3D.d.ts +499 -0
- package/typings/classes/NavigationServer3DManager.d.ts +16 -0
- package/typings/classes/NinePatchRect.d.ts +65 -0
- package/typings/classes/Node.d.ts +1021 -0
- package/typings/classes/Node2D.d.ts +107 -0
- package/typings/classes/Node3D.d.ts +331 -0
- package/typings/classes/Node3DGizmo.d.ts +6 -0
- package/typings/classes/NodePath.d.ts +107 -0
- package/typings/classes/ORMMaterial3D.d.ts +6 -0
- package/typings/classes/OS.d.ts +556 -0
- package/typings/classes/Object.d.ts +434 -0
- package/typings/classes/Occluder3D.d.ts +10 -0
- package/typings/classes/OccluderInstance3D.d.ts +39 -0
- package/typings/classes/OccluderPolygon2D.d.ts +28 -0
- package/typings/classes/OmniLight3D.d.ts +31 -0
- package/typings/classes/OptimizedTranslation.d.ts +12 -0
- package/typings/classes/OptionButton.d.ts +136 -0
- package/typings/classes/PCKPacker.d.ts +27 -0
- package/typings/classes/PackedByteArray.d.ts +327 -0
- package/typings/classes/PackedColorArray.d.ts +125 -0
- package/typings/classes/PackedDataContainer.d.ts +13 -0
- package/typings/classes/PackedDataContainerRef.d.ts +8 -0
- package/typings/classes/PackedFloat32Array.d.ts +140 -0
- package/typings/classes/PackedFloat64Array.d.ts +140 -0
- package/typings/classes/PackedInt32Array.d.ts +127 -0
- package/typings/classes/PackedInt64Array.d.ts +127 -0
- package/typings/classes/PackedScene.d.ts +40 -0
- package/typings/classes/PackedStringArray.d.ts +124 -0
- package/typings/classes/PackedVector2Array.d.ts +139 -0
- package/typings/classes/PackedVector3Array.d.ts +139 -0
- package/typings/classes/PackedVector4Array.d.ts +138 -0
- package/typings/classes/PacketPeer.d.ts +33 -0
- package/typings/classes/PacketPeerDTLS.d.ts +34 -0
- package/typings/classes/PacketPeerExtension.d.ts +9 -0
- package/typings/classes/PacketPeerStream.d.ts +16 -0
- package/typings/classes/PacketPeerUDP.d.ts +61 -0
- package/typings/classes/Panel.d.ts +6 -0
- package/typings/classes/PanelContainer.d.ts +7 -0
- package/typings/classes/PanoramaSkyMaterial.d.ts +18 -0
- package/typings/classes/Parallax2D.d.ts +63 -0
- package/typings/classes/ParallaxBackground.d.ts +37 -0
- package/typings/classes/ParallaxLayer.d.ts +26 -0
- package/typings/classes/ParticleProcessMaterial.d.ts +595 -0
- package/typings/classes/Path2D.d.ts +10 -0
- package/typings/classes/Path3D.d.ts +21 -0
- package/typings/classes/PathFollow2D.d.ts +45 -0
- package/typings/classes/PathFollow3D.d.ts +76 -0
- package/typings/classes/Performance.d.ts +229 -0
- package/typings/classes/PhysicalBone2D.d.ts +44 -0
- package/typings/classes/PhysicalBone3D.d.ts +130 -0
- package/typings/classes/PhysicalBoneSimulator3D.d.ts +29 -0
- package/typings/classes/PhysicalSkyMaterial.d.ts +66 -0
- package/typings/classes/PhysicsBody2D.d.ts +34 -0
- package/typings/classes/PhysicsBody3D.d.ts +51 -0
- package/typings/classes/PhysicsDirectBodyState2D.d.ts +162 -0
- package/typings/classes/PhysicsDirectBodyState2DExtension.d.ts +132 -0
- package/typings/classes/PhysicsDirectBodyState3D.d.ts +165 -0
- package/typings/classes/PhysicsDirectBodyState3DExtension.d.ts +58 -0
- package/typings/classes/PhysicsDirectSpaceState2D.d.ts +58 -0
- package/typings/classes/PhysicsDirectSpaceState2DExtension.d.ts +15 -0
- package/typings/classes/PhysicsDirectSpaceState3D.d.ts +62 -0
- package/typings/classes/PhysicsDirectSpaceState3DExtension.d.ts +16 -0
- package/typings/classes/PhysicsMaterial.d.ts +27 -0
- package/typings/classes/PhysicsPointQueryParameters2D.d.ts +38 -0
- package/typings/classes/PhysicsPointQueryParameters3D.d.ts +31 -0
- package/typings/classes/PhysicsRayQueryParameters2D.d.ts +46 -0
- package/typings/classes/PhysicsRayQueryParameters3D.d.ts +52 -0
- package/typings/classes/PhysicsServer2D.d.ts +739 -0
- package/typings/classes/PhysicsServer2DExtension.d.ts +354 -0
- package/typings/classes/PhysicsServer2DManager.d.ts +16 -0
- package/typings/classes/PhysicsServer3D.d.ts +1028 -0
- package/typings/classes/PhysicsServer3DExtension.d.ts +204 -0
- package/typings/classes/PhysicsServer3DManager.d.ts +16 -0
- package/typings/classes/PhysicsServer3DRenderingServerHandler.d.ts +26 -0
- package/typings/classes/PhysicsShapeQueryParameters2D.d.ts +51 -0
- package/typings/classes/PhysicsShapeQueryParameters3D.d.ts +51 -0
- package/typings/classes/PhysicsTestMotionParameters2D.d.ts +46 -0
- package/typings/classes/PhysicsTestMotionParameters3D.d.ts +52 -0
- package/typings/classes/PhysicsTestMotionResult2D.d.ts +38 -0
- package/typings/classes/PhysicsTestMotionResult3D.d.ts +54 -0
- package/typings/classes/PinJoint2D.d.ts +34 -0
- package/typings/classes/PinJoint3D.d.ts +35 -0
- package/typings/classes/PlaceholderCubemap.d.ts +6 -0
- package/typings/classes/PlaceholderCubemapArray.d.ts +6 -0
- package/typings/classes/PlaceholderMaterial.d.ts +6 -0
- package/typings/classes/PlaceholderMesh.d.ts +9 -0
- package/typings/classes/PlaceholderTexture2D.d.ts +11 -0
- package/typings/classes/PlaceholderTexture2DArray.d.ts +6 -0
- package/typings/classes/PlaceholderTexture3D.d.ts +10 -0
- package/typings/classes/PlaceholderTextureLayered.d.ts +13 -0
- package/typings/classes/Plane.d.ts +143 -0
- package/typings/classes/PlaneMesh.d.ts +38 -0
- package/typings/classes/PointLight2D.d.ts +22 -0
- package/typings/classes/PointMesh.d.ts +6 -0
- package/typings/classes/Polygon2D.d.ts +101 -0
- package/typings/classes/PolygonOccluder3D.d.ts +13 -0
- package/typings/classes/PolygonPathFinder.d.ts +18 -0
- package/typings/classes/Popup.d.ts +18 -0
- package/typings/classes/PopupMenu.d.ts +349 -0
- package/typings/classes/PopupPanel.d.ts +10 -0
- package/typings/classes/PortableCompressedTexture2D.d.ts +47 -0
- package/typings/classes/PrimitiveMesh.d.ts +48 -0
- package/typings/classes/PrismMesh.d.ts +28 -0
- package/typings/classes/ProceduralSkyMaterial.d.ts +68 -0
- package/typings/classes/ProgressBar.d.ts +38 -0
- package/typings/classes/ProjectSettings.d.ts +3818 -0
- package/typings/classes/Projection.d.ts +193 -0
- package/typings/classes/PropertyTweener.d.ts +38 -0
- package/typings/classes/QuadMesh.d.ts +8 -0
- package/typings/classes/QuadOccluder3D.d.ts +10 -0
- package/typings/classes/Quaternion.d.ts +188 -0
- package/typings/classes/RDAttachmentFormat.d.ts +18 -0
- package/typings/classes/RDFramebufferPass.d.ts +33 -0
- package/typings/classes/RDPipelineColorBlendState.d.ts +22 -0
- package/typings/classes/RDPipelineColorBlendStateAttachment.d.ts +61 -0
- package/typings/classes/RDPipelineDepthStencilState.d.ts +102 -0
- package/typings/classes/RDPipelineMultisampleState.d.ts +42 -0
- package/typings/classes/RDPipelineRasterizationState.d.ts +64 -0
- package/typings/classes/RDPipelineSpecializationConstant.d.ts +18 -0
- package/typings/classes/RDSamplerState.d.ts +91 -0
- package/typings/classes/RDShaderFile.d.ts +21 -0
- package/typings/classes/RDShaderSPIRV.d.ts +85 -0
- package/typings/classes/RDShaderSource.d.ts +40 -0
- package/typings/classes/RDTextureFormat.d.ts +62 -0
- package/typings/classes/RDTextureView.d.ts +28 -0
- package/typings/classes/RDUniform.d.ts +23 -0
- package/typings/classes/RDVertexAttribute.d.ts +35 -0
- package/typings/classes/RID.d.ts +65 -0
- package/typings/classes/RandomNumberGenerator.d.ts +45 -0
- package/typings/classes/Range.d.ts +76 -0
- package/typings/classes/RayCast2D.d.ts +90 -0
- package/typings/classes/RayCast3D.d.ts +113 -0
- package/typings/classes/Rect2.d.ts +135 -0
- package/typings/classes/Rect2i.d.ts +127 -0
- package/typings/classes/RectangleShape2D.d.ts +10 -0
- package/typings/classes/RefCounted.d.ts +23 -0
- package/typings/classes/ReferenceRect.d.ts +22 -0
- package/typings/classes/ReflectionProbe.d.ts +118 -0
- package/typings/classes/RemoteTransform2D.d.ts +33 -0
- package/typings/classes/RemoteTransform3D.d.ts +33 -0
- package/typings/classes/RenderData.d.ts +20 -0
- package/typings/classes/RenderDataExtension.d.ts +18 -0
- package/typings/classes/RenderDataRD.d.ts +6 -0
- package/typings/classes/RenderSceneBuffers.d.ts +10 -0
- package/typings/classes/RenderSceneBuffersConfiguration.d.ts +48 -0
- package/typings/classes/RenderSceneBuffersExtension.d.ts +16 -0
- package/typings/classes/RenderSceneBuffersRD.d.ts +85 -0
- package/typings/classes/RenderSceneData.d.ts +29 -0
- package/typings/classes/RenderSceneDataExtension.d.ts +20 -0
- package/typings/classes/RenderSceneDataRD.d.ts +6 -0
- package/typings/classes/RenderingDevice.d.ts +2373 -0
- package/typings/classes/RenderingServer.d.ts +3501 -0
- package/typings/classes/Resource.d.ts +130 -0
- package/typings/classes/ResourceFormatLoader.d.ts +73 -0
- package/typings/classes/ResourceFormatSaver.d.ts +26 -0
- package/typings/classes/ResourceImporter.d.ts +18 -0
- package/typings/classes/ResourceImporterBMFont.d.ts +14 -0
- package/typings/classes/ResourceImporterBitMap.d.ts +16 -0
- package/typings/classes/ResourceImporterCSVTranslation.d.ts +23 -0
- package/typings/classes/ResourceImporterDynamicFont.d.ts +96 -0
- package/typings/classes/ResourceImporterImage.d.ts +6 -0
- package/typings/classes/ResourceImporterImageFont.d.ts +46 -0
- package/typings/classes/ResourceImporterLayeredTexture.d.ts +65 -0
- package/typings/classes/ResourceImporterOBJ.d.ts +38 -0
- package/typings/classes/ResourceImporterSVG.d.ts +24 -0
- package/typings/classes/ResourceImporterScene.d.ts +114 -0
- package/typings/classes/ResourceImporterShaderFile.d.ts +6 -0
- package/typings/classes/ResourceImporterTexture.d.ts +188 -0
- package/typings/classes/ResourceImporterTextureAtlas.d.ts +27 -0
- package/typings/classes/ResourceImporterWAV.d.ts +57 -0
- package/typings/classes/ResourceLoader.d.ts +106 -0
- package/typings/classes/ResourcePreloader.d.ts +20 -0
- package/typings/classes/ResourceSaver.d.ts +53 -0
- package/typings/classes/ResourceUID.d.ts +59 -0
- package/typings/classes/RetargetModifier3D.d.ts +51 -0
- package/typings/classes/RibbonTrailMesh.d.ts +42 -0
- package/typings/classes/RichTextEffect.d.ts +10 -0
- package/typings/classes/RichTextLabel.d.ts +524 -0
- package/typings/classes/RigidBody2D.d.ts +280 -0
- package/typings/classes/RigidBody3D.d.ts +271 -0
- package/typings/classes/RootMotionView.d.ts +30 -0
- package/typings/classes/SceneState.d.ts +93 -0
- package/typings/classes/SceneTree.d.ts +257 -0
- package/typings/classes/SceneTreeTimer.d.ts +13 -0
- package/typings/classes/Script.d.ts +64 -0
- package/typings/classes/ScriptBacktrace.d.ts +63 -0
- package/typings/classes/ScriptCreateDialog.d.ts +17 -0
- package/typings/classes/ScriptEditor.d.ts +60 -0
- package/typings/classes/ScriptEditorBase.d.ts +39 -0
- package/typings/classes/ScriptExtension.d.ts +48 -0
- package/typings/classes/ScriptLanguage.d.ts +12 -0
- package/typings/classes/ScriptLanguageExtension.d.ts +110 -0
- package/typings/classes/ScrollBar.d.ts +19 -0
- package/typings/classes/ScrollContainer.d.ts +120 -0
- package/typings/classes/SegmentShape2D.d.ts +14 -0
- package/typings/classes/Semaphore.d.ts +14 -0
- package/typings/classes/SeparationRayShape2D.d.ts +17 -0
- package/typings/classes/SeparationRayShape3D.d.ts +17 -0
- package/typings/classes/Separator.d.ts +6 -0
- package/typings/classes/Shader.d.ts +48 -0
- package/typings/classes/ShaderGlobalsOverride.d.ts +6 -0
- package/typings/classes/ShaderInclude.d.ts +12 -0
- package/typings/classes/ShaderIncludeDB.d.ts +14 -0
- package/typings/classes/ShaderMaterial.d.ts +19 -0
- package/typings/classes/Shape2D.d.ts +44 -0
- package/typings/classes/Shape3D.d.ts +24 -0
- package/typings/classes/ShapeCast2D.d.ts +107 -0
- package/typings/classes/ShapeCast3D.d.ts +116 -0
- package/typings/classes/Shortcut.d.ts +22 -0
- package/typings/classes/Signal.d.ts +86 -0
- package/typings/classes/Skeleton2D.d.ts +35 -0
- package/typings/classes/Skeleton3D.d.ts +225 -0
- package/typings/classes/SkeletonIK3D.d.ts +83 -0
- package/typings/classes/SkeletonModification2D.d.ts +52 -0
- package/typings/classes/SkeletonModification2DCCDIK.d.ts +64 -0
- package/typings/classes/SkeletonModification2DFABRIK.d.ts +40 -0
- package/typings/classes/SkeletonModification2DJiggle.d.ts +97 -0
- package/typings/classes/SkeletonModification2DLookAt.d.ts +48 -0
- package/typings/classes/SkeletonModification2DPhysicalBones.d.ts +32 -0
- package/typings/classes/SkeletonModification2DStackHolder.d.ts +12 -0
- package/typings/classes/SkeletonModification2DTwoBoneIK.d.ts +57 -0
- package/typings/classes/SkeletonModificationStack2D.d.ts +46 -0
- package/typings/classes/SkeletonModifier3D.d.ts +101 -0
- package/typings/classes/SkeletonProfile.d.ts +119 -0
- package/typings/classes/SkeletonProfileHumanoid.d.ts +10 -0
- package/typings/classes/Skin.d.ts +16 -0
- package/typings/classes/SkinReference.d.ts +15 -0
- package/typings/classes/Sky.d.ts +61 -0
- package/typings/classes/Slider.d.ts +49 -0
- package/typings/classes/SliderJoint3D.d.ts +166 -0
- package/typings/classes/SocketServer.d.ts +14 -0
- package/typings/classes/SoftBody3D.d.ts +136 -0
- package/typings/classes/SphereMesh.d.ts +29 -0
- package/typings/classes/SphereOccluder3D.d.ts +10 -0
- package/typings/classes/SphereShape3D.d.ts +10 -0
- package/typings/classes/SpinBox.d.ts +60 -0
- package/typings/classes/SplineIK3D.d.ts +37 -0
- package/typings/classes/SplitContainer.d.ts +114 -0
- package/typings/classes/SpotLight3D.d.ts +28 -0
- package/typings/classes/SpringArm3D.d.ts +47 -0
- package/typings/classes/SpringBoneCollision3D.d.ts +25 -0
- package/typings/classes/SpringBoneCollisionCapsule3D.d.ts +30 -0
- package/typings/classes/SpringBoneCollisionPlane3D.d.ts +6 -0
- package/typings/classes/SpringBoneCollisionSphere3D.d.ts +14 -0
- package/typings/classes/SpringBoneSimulator3D.d.ts +283 -0
- package/typings/classes/Sprite2D.d.ts +88 -0
- package/typings/classes/Sprite3D.d.ts +51 -0
- package/typings/classes/SpriteBase3D.d.ts +147 -0
- package/typings/classes/SpriteFrames.d.ts +57 -0
- package/typings/classes/StandardMaterial3D.d.ts +6 -0
- package/typings/classes/StaticBody2D.d.ts +27 -0
- package/typings/classes/StaticBody3D.d.ts +27 -0
- package/typings/classes/StatusIndicator.d.ts +36 -0
- package/typings/classes/StreamPeer.d.ts +102 -0
- package/typings/classes/StreamPeerBuffer.d.ts +23 -0
- package/typings/classes/StreamPeerExtension.d.ts +10 -0
- package/typings/classes/StreamPeerGZIP.d.ts +21 -0
- package/typings/classes/StreamPeerSocket.d.ts +22 -0
- package/typings/classes/StreamPeerTCP.d.ts +26 -0
- package/typings/classes/StreamPeerTLS.d.ts +40 -0
- package/typings/classes/StreamPeerUDS.d.ts +15 -0
- package/typings/classes/String.d.ts +475 -0
- package/typings/classes/StringName.d.ts +4 -0
- package/typings/classes/StyleBox.d.ts +64 -0
- package/typings/classes/StyleBoxEmpty.d.ts +6 -0
- package/typings/classes/StyleBoxFlat.d.ts +120 -0
- package/typings/classes/StyleBoxLine.d.ts +30 -0
- package/typings/classes/StyleBoxTexture.d.ts +99 -0
- package/typings/classes/SubViewport.d.ts +57 -0
- package/typings/classes/SubViewportContainer.d.ts +33 -0
- package/typings/classes/SubtweenTweener.d.ts +10 -0
- package/typings/classes/SurfaceTool.d.ts +178 -0
- package/typings/classes/SyntaxHighlighter.d.ts +33 -0
- package/typings/classes/SystemFont.d.ts +94 -0
- package/typings/classes/TCPServer.d.ts +17 -0
- package/typings/classes/TLSOptions.d.ts +38 -0
- package/typings/classes/TabBar.d.ts +203 -0
- package/typings/classes/TabContainer.d.ts +184 -0
- package/typings/classes/TextEdit.d.ts +877 -0
- package/typings/classes/TextLine.d.ts +100 -0
- package/typings/classes/TextMesh.d.ts +103 -0
- package/typings/classes/TextParagraph.d.ts +160 -0
- package/typings/classes/TextServer.d.ts +1006 -0
- package/typings/classes/TextServerDummy.d.ts +6 -0
- package/typings/classes/TextServerExtension.d.ts +586 -0
- package/typings/classes/TextServerManager.d.ts +31 -0
- package/typings/classes/Texture.d.ts +6 -0
- package/typings/classes/Texture2D.d.ts +69 -0
- package/typings/classes/Texture2DArray.d.ts +10 -0
- package/typings/classes/Texture2DArrayRD.d.ts +6 -0
- package/typings/classes/Texture2DRD.d.ts +11 -0
- package/typings/classes/Texture3D.d.ts +36 -0
- package/typings/classes/Texture3DRD.d.ts +10 -0
- package/typings/classes/TextureButton.d.ts +80 -0
- package/typings/classes/TextureCubemapArrayRD.d.ts +6 -0
- package/typings/classes/TextureCubemapRD.d.ts +6 -0
- package/typings/classes/TextureLayered.d.ts +46 -0
- package/typings/classes/TextureLayeredRD.d.ts +10 -0
- package/typings/classes/TextureProgressBar.d.ts +120 -0
- package/typings/classes/TextureRect.d.ts +69 -0
- package/typings/classes/Theme.d.ts +335 -0
- package/typings/classes/ThemeDB.d.ts +58 -0
- package/typings/classes/Thread.d.ts +55 -0
- package/typings/classes/TileData.d.ts +155 -0
- package/typings/classes/TileMap.d.ts +303 -0
- package/typings/classes/TileMapLayer.d.ts +244 -0
- package/typings/classes/TileMapPattern.d.ts +26 -0
- package/typings/classes/TileSet.d.ts +348 -0
- package/typings/classes/TileSetAtlasSource.d.ts +160 -0
- package/typings/classes/TileSetScenesCollectionSource.d.ts +37 -0
- package/typings/classes/TileSetSource.d.ts +24 -0
- package/typings/classes/Time.d.ts +149 -0
- package/typings/classes/Timer.d.ts +71 -0
- package/typings/classes/TorusMesh.d.ts +22 -0
- package/typings/classes/TouchScreenButton.d.ts +61 -0
- package/typings/classes/Transform2D.d.ts +207 -0
- package/typings/classes/Transform3D.d.ts +173 -0
- package/typings/classes/Translation.d.ts +51 -0
- package/typings/classes/TranslationDomain.d.ts +115 -0
- package/typings/classes/TranslationServer.d.ts +117 -0
- package/typings/classes/Tree.d.ts +298 -0
- package/typings/classes/TreeItem.d.ts +374 -0
- package/typings/classes/TriangleMesh.d.ts +33 -0
- package/typings/classes/TubeTrailMesh.d.ts +50 -0
- package/typings/classes/Tween.d.ts +218 -0
- package/typings/classes/Tweener.d.ts +11 -0
- package/typings/classes/TwoBoneIK3D.d.ts +87 -0
- package/typings/classes/UDPServer.d.ts +35 -0
- package/typings/classes/UDSServer.d.ts +13 -0
- package/typings/classes/UndoRedo.d.ts +92 -0
- package/typings/classes/UniformSetCacheRD.d.ts +8 -0
- package/typings/classes/VBoxContainer.d.ts +6 -0
- package/typings/classes/VFlowContainer.d.ts +6 -0
- package/typings/classes/VScrollBar.d.ts +8 -0
- package/typings/classes/VSeparator.d.ts +6 -0
- package/typings/classes/VSlider.d.ts +8 -0
- package/typings/classes/VSplitContainer.d.ts +8 -0
- package/typings/classes/Variant.d.ts +6 -0
- package/typings/classes/Vector2.d.ts +298 -0
- package/typings/classes/Vector2i.d.ts +166 -0
- package/typings/classes/Vector3.d.ts +309 -0
- package/typings/classes/Vector3i.d.ts +172 -0
- package/typings/classes/Vector4.d.ts +216 -0
- package/typings/classes/Vector4i.d.ts +164 -0
- package/typings/classes/VehicleBody3D.d.ts +26 -0
- package/typings/classes/VehicleWheel3D.d.ts +112 -0
- package/typings/classes/VideoStream.d.ts +18 -0
- package/typings/classes/VideoStreamPlayback.d.ts +52 -0
- package/typings/classes/VideoStreamPlayer.d.ts +82 -0
- package/typings/classes/Viewport.d.ts +815 -0
- package/typings/classes/ViewportTexture.d.ts +13 -0
- package/typings/classes/VirtualJoystick.d.ts +94 -0
- package/typings/classes/VisibleOnScreenEnabler2D.d.ts +26 -0
- package/typings/classes/VisibleOnScreenEnabler3D.d.ts +26 -0
- package/typings/classes/VisibleOnScreenNotifier2D.d.ts +27 -0
- package/typings/classes/VisibleOnScreenNotifier3D.d.ts +20 -0
- package/typings/classes/VisualInstance3D.d.ts +53 -0
- package/typings/classes/VisualShader.d.ts +112 -0
- package/typings/classes/VisualShaderNode.d.ts +63 -0
- package/typings/classes/VisualShaderNodeBillboard.d.ts +28 -0
- package/typings/classes/VisualShaderNodeBooleanConstant.d.ts +10 -0
- package/typings/classes/VisualShaderNodeBooleanParameter.d.ts +14 -0
- package/typings/classes/VisualShaderNodeClamp.d.ts +26 -0
- package/typings/classes/VisualShaderNodeColorConstant.d.ts +10 -0
- package/typings/classes/VisualShaderNodeColorFunc.d.ts +32 -0
- package/typings/classes/VisualShaderNodeColorOp.d.ts +32 -0
- package/typings/classes/VisualShaderNodeColorParameter.d.ts +14 -0
- package/typings/classes/VisualShaderNodeComment.d.ts +12 -0
- package/typings/classes/VisualShaderNodeCompare.d.ts +68 -0
- package/typings/classes/VisualShaderNodeConstant.d.ts +6 -0
- package/typings/classes/VisualShaderNodeCubemap.d.ts +43 -0
- package/typings/classes/VisualShaderNodeCubemapParameter.d.ts +6 -0
- package/typings/classes/VisualShaderNodeCurveTexture.d.ts +10 -0
- package/typings/classes/VisualShaderNodeCurveXYZTexture.d.ts +10 -0
- package/typings/classes/VisualShaderNodeCustom.d.ts +122 -0
- package/typings/classes/VisualShaderNodeDerivativeFunc.d.ts +56 -0
- package/typings/classes/VisualShaderNodeDeterminant.d.ts +6 -0
- package/typings/classes/VisualShaderNodeDistanceFade.d.ts +6 -0
- package/typings/classes/VisualShaderNodeDotProduct.d.ts +6 -0
- package/typings/classes/VisualShaderNodeExpression.d.ts +12 -0
- package/typings/classes/VisualShaderNodeFaceForward.d.ts +8 -0
- package/typings/classes/VisualShaderNodeFloatConstant.d.ts +10 -0
- package/typings/classes/VisualShaderNodeFloatFunc.d.ts +108 -0
- package/typings/classes/VisualShaderNodeFloatOp.d.ts +36 -0
- package/typings/classes/VisualShaderNodeFloatParameter.d.ts +52 -0
- package/typings/classes/VisualShaderNodeFrame.d.ts +35 -0
- package/typings/classes/VisualShaderNodeFresnel.d.ts +6 -0
- package/typings/classes/VisualShaderNodeGlobalExpression.d.ts +6 -0
- package/typings/classes/VisualShaderNodeGroupBase.d.ts +60 -0
- package/typings/classes/VisualShaderNodeIf.d.ts +8 -0
- package/typings/classes/VisualShaderNodeInput.d.ts +20 -0
- package/typings/classes/VisualShaderNodeIntConstant.d.ts +10 -0
- package/typings/classes/VisualShaderNodeIntFunc.d.ts +24 -0
- package/typings/classes/VisualShaderNodeIntOp.d.ts +48 -0
- package/typings/classes/VisualShaderNodeIntParameter.d.ts +58 -0
- package/typings/classes/VisualShaderNodeIs.d.ts +18 -0
- package/typings/classes/VisualShaderNodeLinearSceneDepth.d.ts +6 -0
- package/typings/classes/VisualShaderNodeMix.d.ts +28 -0
- package/typings/classes/VisualShaderNodeMultiplyAdd.d.ts +22 -0
- package/typings/classes/VisualShaderNodeOuterProduct.d.ts +6 -0
- package/typings/classes/VisualShaderNodeOutput.d.ts +6 -0
- package/typings/classes/VisualShaderNodeParameter.d.ts +32 -0
- package/typings/classes/VisualShaderNodeParameterRef.d.ts +10 -0
- package/typings/classes/VisualShaderNodeParticleAccelerator.d.ts +20 -0
- package/typings/classes/VisualShaderNodeParticleBoxEmitter.d.ts +6 -0
- package/typings/classes/VisualShaderNodeParticleConeVelocity.d.ts +6 -0
- package/typings/classes/VisualShaderNodeParticleEmit.d.ts +22 -0
- package/typings/classes/VisualShaderNodeParticleEmitter.d.ts +12 -0
- package/typings/classes/VisualShaderNodeParticleMeshEmitter.d.ts +20 -0
- package/typings/classes/VisualShaderNodeParticleMultiplyByAxisAngle.d.ts +10 -0
- package/typings/classes/VisualShaderNodeParticleOutput.d.ts +6 -0
- package/typings/classes/VisualShaderNodeParticleRandomness.d.ts +22 -0
- package/typings/classes/VisualShaderNodeParticleRingEmitter.d.ts +6 -0
- package/typings/classes/VisualShaderNodeParticleSphereEmitter.d.ts +6 -0
- package/typings/classes/VisualShaderNodeProximityFade.d.ts +6 -0
- package/typings/classes/VisualShaderNodeRandomRange.d.ts +6 -0
- package/typings/classes/VisualShaderNodeRemap.d.ts +33 -0
- package/typings/classes/VisualShaderNodeReroute.d.ts +8 -0
- package/typings/classes/VisualShaderNodeResizableBase.d.ts +10 -0
- package/typings/classes/VisualShaderNodeRotationByAxis.d.ts +6 -0
- package/typings/classes/VisualShaderNodeSDFRaymarch.d.ts +6 -0
- package/typings/classes/VisualShaderNodeSDFToScreenUV.d.ts +8 -0
- package/typings/classes/VisualShaderNodeSample3D.d.ts +18 -0
- package/typings/classes/VisualShaderNodeScreenNormalWorldSpace.d.ts +6 -0
- package/typings/classes/VisualShaderNodeScreenUVToSDF.d.ts +8 -0
- package/typings/classes/VisualShaderNodeSmoothStep.d.ts +28 -0
- package/typings/classes/VisualShaderNodeStep.d.ts +28 -0
- package/typings/classes/VisualShaderNodeSwitch.d.ts +30 -0
- package/typings/classes/VisualShaderNodeTexture.d.ts +57 -0
- package/typings/classes/VisualShaderNodeTexture2DArray.d.ts +12 -0
- package/typings/classes/VisualShaderNodeTexture2DArrayParameter.d.ts +6 -0
- package/typings/classes/VisualShaderNodeTexture2DParameter.d.ts +6 -0
- package/typings/classes/VisualShaderNodeTexture3D.d.ts +12 -0
- package/typings/classes/VisualShaderNodeTexture3DParameter.d.ts +6 -0
- package/typings/classes/VisualShaderNodeTextureParameter.d.ts +104 -0
- package/typings/classes/VisualShaderNodeTextureParameterTriplanar.d.ts +6 -0
- package/typings/classes/VisualShaderNodeTextureSDF.d.ts +6 -0
- package/typings/classes/VisualShaderNodeTextureSDFNormal.d.ts +6 -0
- package/typings/classes/VisualShaderNodeTransformCompose.d.ts +6 -0
- package/typings/classes/VisualShaderNodeTransformConstant.d.ts +10 -0
- package/typings/classes/VisualShaderNodeTransformDecompose.d.ts +6 -0
- package/typings/classes/VisualShaderNodeTransformFunc.d.ts +18 -0
- package/typings/classes/VisualShaderNodeTransformOp.d.ts +32 -0
- package/typings/classes/VisualShaderNodeTransformParameter.d.ts +14 -0
- package/typings/classes/VisualShaderNodeTransformVecMult.d.ts +22 -0
- package/typings/classes/VisualShaderNodeUIntConstant.d.ts +10 -0
- package/typings/classes/VisualShaderNodeUIntFunc.d.ts +20 -0
- package/typings/classes/VisualShaderNodeUIntOp.d.ts +48 -0
- package/typings/classes/VisualShaderNodeUIntParameter.d.ts +16 -0
- package/typings/classes/VisualShaderNodeUVFunc.d.ts +22 -0
- package/typings/classes/VisualShaderNodeUVPolarCoord.d.ts +6 -0
- package/typings/classes/VisualShaderNodeVarying.d.ts +14 -0
- package/typings/classes/VisualShaderNodeVaryingGetter.d.ts +6 -0
- package/typings/classes/VisualShaderNodeVaryingSetter.d.ts +6 -0
- package/typings/classes/VisualShaderNodeVec2Constant.d.ts +10 -0
- package/typings/classes/VisualShaderNodeVec2Parameter.d.ts +14 -0
- package/typings/classes/VisualShaderNodeVec3Constant.d.ts +10 -0
- package/typings/classes/VisualShaderNodeVec3Parameter.d.ts +14 -0
- package/typings/classes/VisualShaderNodeVec4Constant.d.ts +10 -0
- package/typings/classes/VisualShaderNodeVec4Parameter.d.ts +14 -0
- package/typings/classes/VisualShaderNodeVectorBase.d.ts +20 -0
- package/typings/classes/VisualShaderNodeVectorCompose.d.ts +8 -0
- package/typings/classes/VisualShaderNodeVectorDecompose.d.ts +8 -0
- package/typings/classes/VisualShaderNodeVectorDistance.d.ts +6 -0
- package/typings/classes/VisualShaderNodeVectorFunc.d.ts +84 -0
- package/typings/classes/VisualShaderNodeVectorLen.d.ts +6 -0
- package/typings/classes/VisualShaderNodeVectorOp.d.ts +42 -0
- package/typings/classes/VisualShaderNodeVectorRefract.d.ts +8 -0
- package/typings/classes/VisualShaderNodeWorldPositionFromDepth.d.ts +8 -0
- package/typings/classes/VoxelGI.d.ts +54 -0
- package/typings/classes/VoxelGIData.d.ts +70 -0
- package/typings/classes/WeakRef.d.ts +12 -0
- package/typings/classes/Window.d.ts +790 -0
- package/typings/classes/WorkerThreadPool.d.ts +55 -0
- package/typings/classes/World2D.d.ts +24 -0
- package/typings/classes/World3D.d.ts +32 -0
- package/typings/classes/WorldBoundaryShape2D.d.ts +19 -0
- package/typings/classes/WorldBoundaryShape3D.d.ts +10 -0
- package/typings/classes/WorldEnvironment.d.ts +22 -0
- package/typings/classes/X509Certificate.d.ts +16 -0
- package/typings/classes/XMLParser.d.ts +74 -0
- package/typings/classes/XRAnchor3D.d.ts +12 -0
- package/typings/classes/XRBodyModifier3D.d.ts +35 -0
- package/typings/classes/XRBodyTracker.d.ts +218 -0
- package/typings/classes/XRCamera3D.d.ts +7 -0
- package/typings/classes/XRController3D.d.ts +39 -0
- package/typings/classes/XRControllerTracker.d.ts +7 -0
- package/typings/classes/XRFaceModifier3D.d.ts +14 -0
- package/typings/classes/XRFaceTracker.d.ts +308 -0
- package/typings/classes/XRHandModifier3D.d.ts +24 -0
- package/typings/classes/XRHandTracker.d.ts +127 -0
- package/typings/classes/XRInterface.d.ts +181 -0
- package/typings/classes/XRInterfaceExtension.d.ts +94 -0
- package/typings/classes/XRNode3D.d.ts +46 -0
- package/typings/classes/XROrigin3D.d.ts +18 -0
- package/typings/classes/XRPose.d.ts +55 -0
- package/typings/classes/XRPositionalTracker.d.ts +64 -0
- package/typings/classes/XRServer.d.ts +130 -0
- package/typings/classes/XRTracker.d.ts +27 -0
- package/typings/classes/XRVRS.d.ts +28 -0
- package/typings/classes/_globals.d.ts +2243 -0
- package/typings/classes/_number-ops.d.ts +19 -0
- package/typings/classes/index.d.ts +915 -0
- package/typings/globals/gd-helpers.d.ts +354 -0
- package/typings/globals/globals.d.ts +511 -0
- package/typings/godot-class-registry.json +61322 -0
- package/typings/index.d.ts +3 -0
- package/typings-overrides/_globals.d.ts +114 -0
- package/typings-overrides/array.d.ts +54 -0
- package/typings-overrides/callable-function.d.ts +92 -0
- package/typings-overrides/class-db.d.ts +19 -0
- package/typings-overrides/dictionary.d.ts +26 -0
- package/typings-overrides/function.d.ts +29 -0
- package/typings-overrides/godot-object.d.ts +32 -0
- package/typings-overrides/node.d.ts +9 -0
- package/typings-overrides/non-nullable.json +117 -0
- package/typings-overrides/packed-scene.d.ts +7 -0
- package/typings-overrides/project-settings.d.ts +73 -0
- package/typings-overrides/property-tweener.d.ts +8 -0
- package/typings-overrides/resource.d.ts +3 -0
- package/typings-overrides/scene-tree.d.ts +54 -0
- package/typings-overrides/signal.d.ts +10 -0
- package/typings-overrides/tween.d.ts +18 -0
|
@@ -0,0 +1,793 @@
|
|
|
1
|
+
import ts from 'typescript';
|
|
2
|
+
import { tsTypeNodeToGdType } from "../common/index.js";
|
|
3
|
+
import { classifyInRhsType } from "./diagnostics.js";
|
|
4
|
+
import { tryEmitGdAs, tryEmitGdIs, tryEmitGdDict, tryEmitGdOps, } from "./gd-helpers.js";
|
|
5
|
+
import { typeContainsUndefined } from "./parameters.js";
|
|
6
|
+
// ---- Main Expression Emitter ----
|
|
7
|
+
export function emitExpression(t, node) {
|
|
8
|
+
// Identifiers
|
|
9
|
+
if (ts.isIdentifier(node)) {
|
|
10
|
+
const text = node.text;
|
|
11
|
+
if (text === 'undefined') {
|
|
12
|
+
t.addDiagnostic(node, 'error', '`undefined` is restricted; use `null`');
|
|
13
|
+
return 'null';
|
|
14
|
+
}
|
|
15
|
+
if (text === 'null')
|
|
16
|
+
return 'null';
|
|
17
|
+
if (text === 'true')
|
|
18
|
+
return 'true';
|
|
19
|
+
if (text === 'false')
|
|
20
|
+
return 'false';
|
|
21
|
+
return text;
|
|
22
|
+
}
|
|
23
|
+
// this -> self
|
|
24
|
+
if (node.kind === ts.SyntaxKind.ThisKeyword) {
|
|
25
|
+
return 'self';
|
|
26
|
+
}
|
|
27
|
+
// null keyword
|
|
28
|
+
if (node.kind === ts.SyntaxKind.NullKeyword)
|
|
29
|
+
return 'null';
|
|
30
|
+
if (node.kind === ts.SyntaxKind.TrueKeyword)
|
|
31
|
+
return 'true';
|
|
32
|
+
if (node.kind === ts.SyntaxKind.FalseKeyword)
|
|
33
|
+
return 'false';
|
|
34
|
+
// Numeric literals -- preserve original source text to keep 100.0 vs 100
|
|
35
|
+
if (ts.isNumericLiteral(node)) {
|
|
36
|
+
return node.getText(t.ctx.sourceFile);
|
|
37
|
+
}
|
|
38
|
+
// String literals -- properly escape
|
|
39
|
+
if (ts.isStringLiteral(node)) {
|
|
40
|
+
return t.emitStringLiteral(node);
|
|
41
|
+
}
|
|
42
|
+
// Template literals
|
|
43
|
+
if (ts.isTemplateExpression(node)) {
|
|
44
|
+
return emitTemplateExpression(t, node);
|
|
45
|
+
}
|
|
46
|
+
if (ts.isNoSubstitutionTemplateLiteral(node)) {
|
|
47
|
+
return `"${t.escapeGdString(node.text)}"`;
|
|
48
|
+
}
|
|
49
|
+
// Property access
|
|
50
|
+
if (ts.isPropertyAccessExpression(node)) {
|
|
51
|
+
return emitPropertyAccess(t, node);
|
|
52
|
+
}
|
|
53
|
+
// Element access: a[b] — convert to .get() when type includes undefined
|
|
54
|
+
if (ts.isElementAccessExpression(node)) {
|
|
55
|
+
const elemType = t.ctx.checker.getTypeAtLocation(node);
|
|
56
|
+
if (typeContainsUndefined(elemType)) {
|
|
57
|
+
const parent = node.parent;
|
|
58
|
+
const isChainedOrCalled = (ts.isCallExpression(parent) && parent.expression === node) ||
|
|
59
|
+
(ts.isPropertyAccessExpression(parent) && parent.expression === node) ||
|
|
60
|
+
(ts.isElementAccessExpression(parent) && parent.expression === node);
|
|
61
|
+
if (!isChainedOrCalled) {
|
|
62
|
+
return `${t.emitExpression(node.expression)}.get(${t.emitExpression(node.argumentExpression)})`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return `${t.emitExpression(node.expression)}[${t.emitExpression(node.argumentExpression)}]`;
|
|
66
|
+
}
|
|
67
|
+
// Call expression
|
|
68
|
+
if (ts.isCallExpression(node)) {
|
|
69
|
+
return emitCallExpression(t, node);
|
|
70
|
+
}
|
|
71
|
+
// New expression -> ClassName.new()
|
|
72
|
+
if (ts.isNewExpression(node)) {
|
|
73
|
+
const className = t.emitExpression(node.expression);
|
|
74
|
+
const args = node.arguments?.map((a) => t.emitExpression(a)).join(', ') ?? '';
|
|
75
|
+
return `${className}.new(${args})`;
|
|
76
|
+
}
|
|
77
|
+
// Binary expression
|
|
78
|
+
if (ts.isBinaryExpression(node)) {
|
|
79
|
+
return emitBinaryExpression(t, node);
|
|
80
|
+
}
|
|
81
|
+
// Prefix unary
|
|
82
|
+
if (ts.isPrefixUnaryExpression(node)) {
|
|
83
|
+
const operand = t.emitExpression(node.operand);
|
|
84
|
+
const op = unaryOperator(node.operator);
|
|
85
|
+
return `${op}${operand}`;
|
|
86
|
+
}
|
|
87
|
+
// Postfix unary (i++ / i--)
|
|
88
|
+
if (ts.isPostfixUnaryExpression(node)) {
|
|
89
|
+
const operand = t.emitExpression(node.operand);
|
|
90
|
+
if (node.operator === ts.SyntaxKind.PlusPlusToken) {
|
|
91
|
+
return `${operand} += 1`;
|
|
92
|
+
}
|
|
93
|
+
if (node.operator === ts.SyntaxKind.MinusMinusToken) {
|
|
94
|
+
return `${operand} -= 1`;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// Parenthesized
|
|
98
|
+
if (ts.isParenthesizedExpression(node)) {
|
|
99
|
+
return `(${t.emitExpression(node.expression)})`;
|
|
100
|
+
}
|
|
101
|
+
// Array literal
|
|
102
|
+
if (ts.isArrayLiteralExpression(node)) {
|
|
103
|
+
const elements = node.elements.map((e) => t.emitExpression(e)).join(', ');
|
|
104
|
+
return `[${elements}]`;
|
|
105
|
+
}
|
|
106
|
+
// Object literal -> Dictionary
|
|
107
|
+
if (ts.isObjectLiteralExpression(node)) {
|
|
108
|
+
const entries = [];
|
|
109
|
+
for (const p of node.properties) {
|
|
110
|
+
if (ts.isPropertyAssignment(p)) {
|
|
111
|
+
let key;
|
|
112
|
+
if (ts.isComputedPropertyName(p.name)) {
|
|
113
|
+
// {[expr]: value} -> expr: value (strip brackets, use raw expression)
|
|
114
|
+
key = t.emitExpression(p.name.expression);
|
|
115
|
+
}
|
|
116
|
+
else if (ts.isStringLiteral(p.name)) {
|
|
117
|
+
// String literal key: {'key': v} or {"key": v} -> "key": v
|
|
118
|
+
key = t.emitStringLiteral(p.name);
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
// Regular property: quote the key name
|
|
122
|
+
key = `"${t.escapeGdString(p.name.getText(t.ctx.sourceFile))}"`;
|
|
123
|
+
}
|
|
124
|
+
const value = t.emitExpression(p.initializer);
|
|
125
|
+
entries.push(`${key}: ${value}`);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
if (entries.length === 0)
|
|
129
|
+
return '{}';
|
|
130
|
+
return t.emitMultiLineDict(entries);
|
|
131
|
+
}
|
|
132
|
+
// Conditional (ternary) -> GDScript ternary
|
|
133
|
+
if (ts.isConditionalExpression(node)) {
|
|
134
|
+
const cond = t.emitExpression(node.condition);
|
|
135
|
+
const whenTrue = t.emitExpression(node.whenTrue);
|
|
136
|
+
const whenFalse = t.emitExpression(node.whenFalse);
|
|
137
|
+
return `${whenTrue} if ${cond} else ${whenFalse}`;
|
|
138
|
+
}
|
|
139
|
+
// Await
|
|
140
|
+
if (ts.isAwaitExpression(node)) {
|
|
141
|
+
return `await ${t.emitExpression(node.expression)}`;
|
|
142
|
+
}
|
|
143
|
+
// Type assertion (as) -> skip
|
|
144
|
+
if (ts.isAsExpression(node)) {
|
|
145
|
+
return t.emitExpression(node.expression);
|
|
146
|
+
}
|
|
147
|
+
// Satisfies expression -> skip (type-only, no runtime effect)
|
|
148
|
+
if (ts.isSatisfiesExpression(node)) {
|
|
149
|
+
return t.emitExpression(node.expression);
|
|
150
|
+
}
|
|
151
|
+
// Non-null assertion (!) -> skip
|
|
152
|
+
if (ts.isNonNullExpression(node)) {
|
|
153
|
+
return t.emitExpression(node.expression);
|
|
154
|
+
}
|
|
155
|
+
// Arrow function / function expression -> lambda
|
|
156
|
+
if (ts.isArrowFunction(node) || ts.isFunctionExpression(node)) {
|
|
157
|
+
return emitLambda(t, node);
|
|
158
|
+
}
|
|
159
|
+
// Spread -> not supported
|
|
160
|
+
if (ts.isSpreadElement(node)) {
|
|
161
|
+
t.addDiagnostic(node, 'error', 'Spread operator is not supported in GDScript');
|
|
162
|
+
return t.emitExpression(node.expression);
|
|
163
|
+
}
|
|
164
|
+
// Yield -> not supported
|
|
165
|
+
if (ts.isYieldExpression(node)) {
|
|
166
|
+
t.addDiagnostic(node, 'error', '`yield` is not supported; use `await` instead');
|
|
167
|
+
return node.getText(t.ctx.sourceFile);
|
|
168
|
+
}
|
|
169
|
+
// Fallback -- unsupported expression
|
|
170
|
+
t.addDiagnostic(node, 'error', `Unsupported expression: ${ts.SyntaxKind[node.kind]}`);
|
|
171
|
+
return node.getText(t.ctx.sourceFile);
|
|
172
|
+
}
|
|
173
|
+
// ---- Property Access ----
|
|
174
|
+
/**
|
|
175
|
+
* Promise method names that can't map to GDScript. `.then` / `.catch`
|
|
176
|
+
* / `.finally` would need callback-based desugaring, but GD's
|
|
177
|
+
* coroutine model works the other way round — the whole point of
|
|
178
|
+
* `await` is that you don't need `.then`. Flag any access of these
|
|
179
|
+
* method names on a Promise-typed object as a `type-error`; the
|
|
180
|
+
* emitted GD would be broken (`.then` doesn't exist on GD's
|
|
181
|
+
* `GDScriptFunctionState`), but leaving GD output intact keeps
|
|
182
|
+
* downstream lint/Godot passes informative.
|
|
183
|
+
*/
|
|
184
|
+
const PROMISE_FORBIDDEN_METHODS = new Set(['then', 'catch', 'finally']);
|
|
185
|
+
/**
|
|
186
|
+
* True when `node` is the direct `.type` slot of a function-like
|
|
187
|
+
* declaration that carries the `async` modifier. This is the ONLY
|
|
188
|
+
* position where an explicit `Promise<T>` annotation is meaningful
|
|
189
|
+
* in this project — async functions/methods/arrows desugar to GD
|
|
190
|
+
* coroutines, and the `Promise<T>` wrapper is stripped by
|
|
191
|
+
* `tsTypeNodeToGdType` before emit.
|
|
192
|
+
*
|
|
193
|
+
* Anything else — variable annotations, parameter types, non-async
|
|
194
|
+
* return types, nested generics, type aliases, generic constraints
|
|
195
|
+
* — is explicit Promise usage that has no GD counterpart.
|
|
196
|
+
*
|
|
197
|
+
* The four kinds below are the ONLY function-like declarations that
|
|
198
|
+
* can carry an `async` modifier in TypeScript. Getters/setters, the
|
|
199
|
+
* constructor, `MethodSignature`, `FunctionTypeNode`, and call/
|
|
200
|
+
* construct signatures cannot be async — a `Promise<T>` return on
|
|
201
|
+
* any of those correctly falls through and gets flagged. Do NOT
|
|
202
|
+
* expand this list.
|
|
203
|
+
*/
|
|
204
|
+
function isAsyncFunctionReturnTypeSlot(node) {
|
|
205
|
+
const parent = node.parent;
|
|
206
|
+
if (!parent)
|
|
207
|
+
return false;
|
|
208
|
+
const isFunctionLikeReturnSlot = (ts.isFunctionDeclaration(parent) ||
|
|
209
|
+
ts.isMethodDeclaration(parent) ||
|
|
210
|
+
ts.isArrowFunction(parent) ||
|
|
211
|
+
ts.isFunctionExpression(parent)) &&
|
|
212
|
+
parent.type === node;
|
|
213
|
+
if (!isFunctionLikeReturnSlot)
|
|
214
|
+
return false;
|
|
215
|
+
const modifiers = ts.canHaveModifiers(parent)
|
|
216
|
+
? ts.getModifiers(parent)
|
|
217
|
+
: undefined;
|
|
218
|
+
return modifiers?.some((m) => m.kind === ts.SyntaxKind.AsyncKeyword) ?? false;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Type-reference names that represent "a thing you await" at the TS
|
|
222
|
+
* type level. Both have no GD counterpart:
|
|
223
|
+
* - `Promise<T>` — the standard lib type. `await` unwraps it.
|
|
224
|
+
* - `PromiseLike<T>` — the structural minimum (`.then` only). TS's
|
|
225
|
+
* `await` accepts either interchangeably.
|
|
226
|
+
* Users rarely write `PromiseLike` explicitly, but when they do the
|
|
227
|
+
* intent is identical ("this is awaitable") and GDScript has no way
|
|
228
|
+
* to express it.
|
|
229
|
+
*/
|
|
230
|
+
const FORBIDDEN_PROMISE_TYPE_NAMES = new Set([
|
|
231
|
+
'Promise',
|
|
232
|
+
'PromiseLike',
|
|
233
|
+
]);
|
|
234
|
+
/**
|
|
235
|
+
* Pre-pass: forbid EXPLICIT `Promise<T>` / `PromiseLike<T>` type
|
|
236
|
+
* annotations anywhere except as the return type of an `async`
|
|
237
|
+
* function / method / arrow.
|
|
238
|
+
*
|
|
239
|
+
* Walks the whole source file once so variable annotations,
|
|
240
|
+
* parameter types, non-async return types, type aliases, generic
|
|
241
|
+
* constraints, and nested positions (e.g. `Array<Promise<T>>`) are
|
|
242
|
+
* all caught in a single place — no per-call-site sprinkling.
|
|
243
|
+
*
|
|
244
|
+
* Only flags USER-WRITTEN annotations (TypeReferenceNodes with a
|
|
245
|
+
* forbidden name). Inferred Promise types from `async` functions
|
|
246
|
+
* aren't touched here — those are handled by
|
|
247
|
+
* `tsTypeNodeToGdType` stripping `Promise<T>` → `T` on emission,
|
|
248
|
+
* and by `checkPromiseUsedAsValue` for value-position misuse.
|
|
249
|
+
*
|
|
250
|
+
* A symbol-level check (via `checker.getSymbolAtLocation`) runs
|
|
251
|
+
* only when the name-based gate already matched, so the cost is
|
|
252
|
+
* bounded by the number of Promise-named references in the file
|
|
253
|
+
* (typically 0–5). It filters out user-shadowed names like
|
|
254
|
+
* `class Promise {}` that aren't actually the global Promise.
|
|
255
|
+
*/
|
|
256
|
+
export function checkExplicitPromiseTypes(t) {
|
|
257
|
+
const walk = (node) => {
|
|
258
|
+
if (ts.isTypeReferenceNode(node) &&
|
|
259
|
+
ts.isIdentifier(node.typeName) &&
|
|
260
|
+
FORBIDDEN_PROMISE_TYPE_NAMES.has(node.typeName.text) &&
|
|
261
|
+
!isAsyncFunctionReturnTypeSlot(node) &&
|
|
262
|
+
resolvesToBuiltinAwaitable(t, node.typeName)) {
|
|
263
|
+
const typeName = node.typeName.text;
|
|
264
|
+
t.addDiagnostic(node, 'type-error', `Explicit \`${typeName}<T>\` type is forbidden except as the return type of ` +
|
|
265
|
+
'an `async` function / method / arrow. GDScript has no Promise — ' +
|
|
266
|
+
'remove the annotation, or wrap the callsite in an `async` function ' +
|
|
267
|
+
'whose `Promise<T>` return is auto-unwrapped on emit.');
|
|
268
|
+
// Still recurse into type arguments — `Promise<Promise<T>>` must
|
|
269
|
+
// flag the INNER one too (nested Promises are invalid anywhere,
|
|
270
|
+
// including inside an otherwise-allowed async return slot).
|
|
271
|
+
}
|
|
272
|
+
ts.forEachChild(node, walk);
|
|
273
|
+
};
|
|
274
|
+
walk(t.ctx.sourceFile);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* True when the identifier resolves to the built-in `Promise` /
|
|
278
|
+
* `PromiseLike` type from TypeScript's lib, NOT a user-defined
|
|
279
|
+
* symbol that happens to share the name. Defense-in-depth for the
|
|
280
|
+
* rare case of `class Promise {}` shadowing the global — without
|
|
281
|
+
* this filter the name-only check would mis-flag uses of the
|
|
282
|
+
* shadow.
|
|
283
|
+
*
|
|
284
|
+
* When the symbol can't be resolved (no type-checker, or an
|
|
285
|
+
* unresolvable name), defaults to `true` — safer to over-flag than
|
|
286
|
+
* to silently let a real Promise reference through.
|
|
287
|
+
*/
|
|
288
|
+
function resolvesToBuiltinAwaitable(t, identifier) {
|
|
289
|
+
const symbol = t.ctx.checker.getSymbolAtLocation(identifier);
|
|
290
|
+
if (!symbol)
|
|
291
|
+
return true;
|
|
292
|
+
// The global Promise / PromiseLike declarations live in lib files
|
|
293
|
+
// whose names contain ".d.ts". A user class shadowing them would
|
|
294
|
+
// be declared in a user `.ts` file. Checking the declaration's
|
|
295
|
+
// source-file name is cheap and avoids comparing against the
|
|
296
|
+
// global symbol directly (which requires a global-scope lookup
|
|
297
|
+
// and more plumbing).
|
|
298
|
+
const decls = symbol.getDeclarations();
|
|
299
|
+
if (!decls || decls.length === 0)
|
|
300
|
+
return true;
|
|
301
|
+
return decls.some((d) => {
|
|
302
|
+
const fileName = d.getSourceFile().fileName;
|
|
303
|
+
return fileName.includes('/lib.') || fileName.includes('\\lib.');
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
function checkPromiseMethodAccess(t, node) {
|
|
307
|
+
if (!PROMISE_FORBIDDEN_METHODS.has(node.name.text))
|
|
308
|
+
return;
|
|
309
|
+
const objType = t.ctx.checker.getTypeAtLocation(node.expression);
|
|
310
|
+
if (!isPromiseType(objType))
|
|
311
|
+
return;
|
|
312
|
+
const method = node.name.text;
|
|
313
|
+
const hint = method === 'catch'
|
|
314
|
+
? 'wrap `await` in `try { … } catch (e) { … }` — GDScript propagates thrown errors through the coroutine chain'
|
|
315
|
+
: method === 'finally'
|
|
316
|
+
? 'run cleanup after `await` completes — GDScript has no `finally` equivalent for coroutines'
|
|
317
|
+
: 'use `await` and normal control flow — the unwrapped value is what you get from `await fn()`';
|
|
318
|
+
t.addDiagnostic(node.name, 'type-error', `Promise.${method} is not supported in GDScript. GDScript has no Promise type — ${hint}.`);
|
|
319
|
+
}
|
|
320
|
+
export function emitPropertyAccess(t, node) {
|
|
321
|
+
// Optional chaining (?.) -> not supported
|
|
322
|
+
if (node.questionDotToken) {
|
|
323
|
+
t.addDiagnostic(node, 'error', 'Optional chaining (`?.`) is not supported in GDScript');
|
|
324
|
+
}
|
|
325
|
+
checkPromiseMethodAccess(t, node);
|
|
326
|
+
// Inside a get/set accessor body, `this.<accessorName>` refers to the
|
|
327
|
+
// GDScript backing field, which must be emitted as a bare identifier
|
|
328
|
+
// (emitting `self.<name>` would recursively call the accessor).
|
|
329
|
+
if (t.currentAccessorName &&
|
|
330
|
+
node.expression.kind === ts.SyntaxKind.ThisKeyword &&
|
|
331
|
+
node.name.text === t.currentAccessorName) {
|
|
332
|
+
return t.currentAccessorName;
|
|
333
|
+
}
|
|
334
|
+
// ClassName.staticProp -> self.staticProp (when accessing own class)
|
|
335
|
+
if (ts.isIdentifier(node.expression) &&
|
|
336
|
+
node.expression.text === t.currentClassName) {
|
|
337
|
+
return `self.${node.name.text}`;
|
|
338
|
+
}
|
|
339
|
+
const obj = t.emitExpression(node.expression);
|
|
340
|
+
const prop = node.name.text;
|
|
341
|
+
// Optional property access: convert standalone `obj.prop` to `obj.get("prop")`
|
|
342
|
+
// when the property type includes `undefined` (optional or T | undefined).
|
|
343
|
+
// Skip when:
|
|
344
|
+
// - chained or called: obj.prop(), obj.prop.inner, obj.prop["key"]
|
|
345
|
+
// - accessing a class field (always defined in GDScript)
|
|
346
|
+
const propType = t.ctx.checker.getTypeAtLocation(node);
|
|
347
|
+
if (typeContainsUndefined(propType)) {
|
|
348
|
+
// Walk up through non-null assertions (!) and parens to find the real parent
|
|
349
|
+
let effectiveNode = node;
|
|
350
|
+
let parent = node.parent;
|
|
351
|
+
while (parent &&
|
|
352
|
+
(ts.isNonNullExpression(parent) || ts.isParenthesizedExpression(parent))) {
|
|
353
|
+
effectiveNode = parent;
|
|
354
|
+
parent = parent.parent;
|
|
355
|
+
}
|
|
356
|
+
const isChainedOrCalled = parent != null &&
|
|
357
|
+
((ts.isCallExpression(parent) && parent.expression === effectiveNode) ||
|
|
358
|
+
(ts.isPropertyAccessExpression(parent) &&
|
|
359
|
+
parent.expression === effectiveNode) ||
|
|
360
|
+
(ts.isElementAccessExpression(parent) &&
|
|
361
|
+
parent.expression === effectiveNode));
|
|
362
|
+
// Check if the property is a class field (declared via PropertyDeclaration in a class body).
|
|
363
|
+
// PropertySignature (in interfaces/type literals) is NOT a class field.
|
|
364
|
+
const symbol = t.ctx.checker.getSymbolAtLocation(node.name);
|
|
365
|
+
const isClassField = symbol?.getDeclarations()?.some((d) => ts.isPropertyDeclaration(d)) ??
|
|
366
|
+
false;
|
|
367
|
+
if (!isChainedOrCalled && !isClassField) {
|
|
368
|
+
return `${obj}.get("${prop}")`;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
return `${obj}.${prop}`;
|
|
372
|
+
}
|
|
373
|
+
// ---- Call Expressions ----
|
|
374
|
+
/**
|
|
375
|
+
* Return the first non-transparent ancestor of `node` — i.e. walk through
|
|
376
|
+
* parenthesis, non-null assertions, and type assertions which don't change
|
|
377
|
+
* runtime semantics. Used to decide whether a value is actually "consumed"
|
|
378
|
+
* vs merely wrapped.
|
|
379
|
+
*/
|
|
380
|
+
function effectiveParent(node) {
|
|
381
|
+
let parent = node.parent;
|
|
382
|
+
while (parent &&
|
|
383
|
+
(ts.isParenthesizedExpression(parent) ||
|
|
384
|
+
ts.isNonNullExpression(parent) ||
|
|
385
|
+
ts.isAsExpression(parent) ||
|
|
386
|
+
ts.isTypeAssertionExpression(parent))) {
|
|
387
|
+
parent = parent.parent;
|
|
388
|
+
}
|
|
389
|
+
return parent;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* True when `type` is a TypeScript `Promise<T>` (or a union/intersection that
|
|
393
|
+
* contains one). In GDScript there is no Promise; an unawaited coroutine
|
|
394
|
+
* yields a `GDScriptFunctionState` at runtime, not the resolved value.
|
|
395
|
+
*/
|
|
396
|
+
function isPromiseType(type) {
|
|
397
|
+
if (type.isUnionOrIntersection()) {
|
|
398
|
+
return type.types.some((t) => isPromiseType(t));
|
|
399
|
+
}
|
|
400
|
+
const symbol = type.aliasSymbol ?? type.getSymbol();
|
|
401
|
+
return symbol?.getName() === 'Promise';
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Report a `type-error` when a call that returns `Promise<T>` is used as a
|
|
405
|
+
* value without `await`. Calls used as statements (value discarded) and
|
|
406
|
+
* calls directly awaited are fine.
|
|
407
|
+
*
|
|
408
|
+
* Only checks call expressions — other producers of Promise values (e.g.
|
|
409
|
+
* reading a Promise-typed variable) are rare, and the error at the call
|
|
410
|
+
* site that originally created the Promise covers the common path.
|
|
411
|
+
*/
|
|
412
|
+
function checkPromiseUsedAsValue(t, node) {
|
|
413
|
+
const returnType = t.ctx.checker.getTypeAtLocation(node);
|
|
414
|
+
if (!isPromiseType(returnType))
|
|
415
|
+
return;
|
|
416
|
+
const parent = effectiveParent(node);
|
|
417
|
+
if (!parent)
|
|
418
|
+
return;
|
|
419
|
+
// `await fn()` — the whole point of the Promise, clearly fine.
|
|
420
|
+
if (ts.isAwaitExpression(parent))
|
|
421
|
+
return;
|
|
422
|
+
// `fn();` on its own line — value is discarded, same as not caring about
|
|
423
|
+
// the coroutine's result in GD. Allowed.
|
|
424
|
+
if (ts.isExpressionStatement(parent))
|
|
425
|
+
return;
|
|
426
|
+
t.addDiagnostic(node, 'type-error', 'Promise value used without `await`. In GDScript an unawaited coroutine ' +
|
|
427
|
+
'resolves to a `GDScriptFunctionState`, not the value — this will fail ' +
|
|
428
|
+
'at runtime. Prefix with `await`, or discard the call as a statement.');
|
|
429
|
+
}
|
|
430
|
+
export function emitCallExpression(t, node) {
|
|
431
|
+
// Optional chaining on calls (?.) -> not supported
|
|
432
|
+
if (node.questionDotToken) {
|
|
433
|
+
t.addDiagnostic(node, 'error', 'Optional chaining (`?.`) is not supported in GDScript');
|
|
434
|
+
}
|
|
435
|
+
checkPromiseUsedAsValue(t, node);
|
|
436
|
+
// Check each argument for `undefined` in its type.
|
|
437
|
+
// Skip literal `undefined` -- already caught by emitExpression's identifier check.
|
|
438
|
+
// Skip class field accesses -- their `undefined` maps to `null` in GDScript.
|
|
439
|
+
const checker = t.ctx.checker;
|
|
440
|
+
for (const arg of node.arguments) {
|
|
441
|
+
if (ts.isIdentifier(arg) && arg.text === 'undefined')
|
|
442
|
+
continue;
|
|
443
|
+
const argType = checker.getTypeAtLocation(arg);
|
|
444
|
+
if (typeContainsUndefined(argType)) {
|
|
445
|
+
// Class fields (PropertyDeclaration) are nullable in GDScript, not undefined
|
|
446
|
+
if (ts.isPropertyAccessExpression(arg)) {
|
|
447
|
+
const sym = checker.getSymbolAtLocation(arg.name);
|
|
448
|
+
const isClassField = sym?.getDeclarations()?.some((d) => ts.isPropertyDeclaration(d)) ??
|
|
449
|
+
false;
|
|
450
|
+
if (isClassField)
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
t.addDiagnostic(arg, 'type-error', `Argument '${arg.getText(t.ctx.sourceFile)}' may be 'undefined', ` +
|
|
454
|
+
`which is not supported in GDScript. Use 'null' instead.`);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
const args = node.arguments.map((a) => t.emitExpression(a)).join(', ');
|
|
458
|
+
// Handle gd.* helper calls
|
|
459
|
+
if (ts.isPropertyAccessExpression(node.expression)) {
|
|
460
|
+
const obj = node.expression.expression;
|
|
461
|
+
const method = node.expression.name.text;
|
|
462
|
+
// gd.as(value, Type)
|
|
463
|
+
const asResult = tryEmitGdAs(t, node, obj, method);
|
|
464
|
+
if (asResult !== null)
|
|
465
|
+
return asResult;
|
|
466
|
+
// gd.is(value, Type) -> value is Type
|
|
467
|
+
const isResult = tryEmitGdIs(t, node, obj, method);
|
|
468
|
+
if (isResult !== null)
|
|
469
|
+
return isResult;
|
|
470
|
+
// gd.dict([[key, value], ...]) -> {key: value, ...}
|
|
471
|
+
const dictResult = tryEmitGdDict(t, node, obj, method);
|
|
472
|
+
if (dictResult !== null)
|
|
473
|
+
return dictResult;
|
|
474
|
+
// gd.ops.add/sub/mul/div/eq/ne/gt/gte/lt/lte/plus/minus -> operator
|
|
475
|
+
const opsResult = tryEmitGdOps(t, node, obj, method);
|
|
476
|
+
if (opsResult !== null)
|
|
477
|
+
return opsResult;
|
|
478
|
+
// Handle self.method() / self.property() calls
|
|
479
|
+
if (isSelfExpression(obj)) {
|
|
480
|
+
// Check if it's a method call or function (property) call via type checker
|
|
481
|
+
const symbol = t.ctx.checker.getSymbolAtLocation(node.expression);
|
|
482
|
+
if (symbol) {
|
|
483
|
+
const declarations = symbol.getDeclarations();
|
|
484
|
+
if (declarations && declarations.length > 0) {
|
|
485
|
+
const decl = declarations[0];
|
|
486
|
+
if (ts.isPropertyDeclaration(decl)) {
|
|
487
|
+
return `self.${method}.call(${args})`;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
// Method call or default
|
|
492
|
+
return `self.${method}(${args})`;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
const callee = t.emitExpression(node.expression);
|
|
496
|
+
// Check if the callee is a Callable type (function variable, parameter)
|
|
497
|
+
// In GDScript, Callable values must be invoked via .call()
|
|
498
|
+
if (ts.isIdentifier(node.expression)) {
|
|
499
|
+
const symbol = t.ctx.checker.getSymbolAtLocation(node.expression);
|
|
500
|
+
if (symbol) {
|
|
501
|
+
const declarations = symbol.getDeclarations();
|
|
502
|
+
if (declarations && declarations.length > 0) {
|
|
503
|
+
const decl = declarations[0];
|
|
504
|
+
// Local variables and parameters holding callables need .call()
|
|
505
|
+
if (ts.isVariableDeclaration(decl) || ts.isParameter(decl)) {
|
|
506
|
+
const type = t.ctx.checker.getTypeAtLocation(node.expression);
|
|
507
|
+
if (type.getCallSignatures().length > 0 &&
|
|
508
|
+
!type.getConstructSignatures().length) {
|
|
509
|
+
return `${callee}.call(${args})`;
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
return `${callee}(${args})`;
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Check if a logical expression (`||`/`&&`) is in a boolean context where
|
|
519
|
+
* GDScript `or`/`and` returning `bool` is correct. Contexts:
|
|
520
|
+
* - if/while condition
|
|
521
|
+
* - negation (`!expr`)
|
|
522
|
+
* - nested in another `||`/`&&` that is itself in bool context
|
|
523
|
+
* - wrapped in `bool()` call
|
|
524
|
+
* - used as a standalone expression statement (not assigned)
|
|
525
|
+
*/
|
|
526
|
+
function isLogicalBoolContext(node) {
|
|
527
|
+
let current = node;
|
|
528
|
+
let parent = current.parent;
|
|
529
|
+
// Walk up through parenthesized expressions
|
|
530
|
+
while (parent && ts.isParenthesizedExpression(parent)) {
|
|
531
|
+
current = parent;
|
|
532
|
+
parent = parent.parent;
|
|
533
|
+
}
|
|
534
|
+
if (!parent)
|
|
535
|
+
return true;
|
|
536
|
+
// if/while/for condition
|
|
537
|
+
if (ts.isIfStatement(parent) && parent.expression === current)
|
|
538
|
+
return true;
|
|
539
|
+
if (ts.isWhileStatement(parent) && parent.expression === current)
|
|
540
|
+
return true;
|
|
541
|
+
if (ts.isForStatement(parent) && parent.condition === current)
|
|
542
|
+
return true;
|
|
543
|
+
// Negation: !expr
|
|
544
|
+
if (ts.isPrefixUnaryExpression(parent) &&
|
|
545
|
+
parent.operator === ts.SyntaxKind.ExclamationToken)
|
|
546
|
+
return true;
|
|
547
|
+
// Nested logical: part of another || or &&
|
|
548
|
+
if (ts.isBinaryExpression(parent) &&
|
|
549
|
+
(parent.operatorToken.kind === ts.SyntaxKind.BarBarToken ||
|
|
550
|
+
parent.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken))
|
|
551
|
+
return true;
|
|
552
|
+
// Wrapped in bool() call — walk up through ternary/parens to find it
|
|
553
|
+
if (isInsideBoolCall(current))
|
|
554
|
+
return true;
|
|
555
|
+
// Expression statement (standalone, not assigned)
|
|
556
|
+
if (ts.isExpressionStatement(parent))
|
|
557
|
+
return true;
|
|
558
|
+
return false;
|
|
559
|
+
}
|
|
560
|
+
/** Walk up ancestors to check if this node is inside a `bool()` call. */
|
|
561
|
+
function isInsideBoolCall(node) {
|
|
562
|
+
let current = node.parent;
|
|
563
|
+
while (current) {
|
|
564
|
+
// Skip transparent wrappers
|
|
565
|
+
if (ts.isParenthesizedExpression(current) ||
|
|
566
|
+
ts.isConditionalExpression(current)) {
|
|
567
|
+
current = current.parent;
|
|
568
|
+
continue;
|
|
569
|
+
}
|
|
570
|
+
// Found bool() call
|
|
571
|
+
if (ts.isCallExpression(current) &&
|
|
572
|
+
ts.isIdentifier(current.expression) &&
|
|
573
|
+
current.expression.text === 'bool')
|
|
574
|
+
return true;
|
|
575
|
+
// Anything else breaks the chain
|
|
576
|
+
break;
|
|
577
|
+
}
|
|
578
|
+
return false;
|
|
579
|
+
}
|
|
580
|
+
/** Check if an expression evaluates to `self` (i.e., is `this`) */
|
|
581
|
+
function isSelfExpression(node) {
|
|
582
|
+
return node.kind === ts.SyntaxKind.ThisKeyword;
|
|
583
|
+
}
|
|
584
|
+
// ---- Binary Expressions ----
|
|
585
|
+
export function emitBinaryExpression(t, node) {
|
|
586
|
+
// Nullish coalescing (??) -> not supported
|
|
587
|
+
if (node.operatorToken.kind === ts.SyntaxKind.QuestionQuestionToken) {
|
|
588
|
+
t.addDiagnostic(node, 'error', 'Nullish coalescing (`??`) is not supported in GDScript');
|
|
589
|
+
}
|
|
590
|
+
// Nullish coalescing assignment (??=) -> not supported
|
|
591
|
+
if (node.operatorToken.kind === ts.SyntaxKind.QuestionQuestionEqualsToken) {
|
|
592
|
+
t.addDiagnostic(node, 'error', 'Nullish coalescing assignment (`??=`) is not supported in GDScript');
|
|
593
|
+
}
|
|
594
|
+
// `x in y` -- GDScript only supports `in` on Dictionary and String.
|
|
595
|
+
if (node.operatorToken.kind === ts.SyntaxKind.InKeyword) {
|
|
596
|
+
checkInOperatorRhs(t, node);
|
|
597
|
+
}
|
|
598
|
+
// Error when `||`/`&&` is used as a non-boolean value.
|
|
599
|
+
// GDScript `or`/`and` return `bool`, not the operand like JS/TS.
|
|
600
|
+
// User can wrap in `bool()` to acknowledge the bool return and suppress this error.
|
|
601
|
+
if (node.operatorToken.kind === ts.SyntaxKind.BarBarToken ||
|
|
602
|
+
node.operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {
|
|
603
|
+
if (!isLogicalBoolContext(node)) {
|
|
604
|
+
const resultType = t.ctx.checker.getTypeAtLocation(node);
|
|
605
|
+
const isBoolResult = !!(resultType.flags & ts.TypeFlags.BooleanLike);
|
|
606
|
+
if (!isBoolResult) {
|
|
607
|
+
const op = node.operatorToken.kind === ts.SyntaxKind.BarBarToken ? '||' : '&&';
|
|
608
|
+
t.addDiagnostic(node, 'type-error', `\`${op}\` used as a non-boolean value. GDScript \`or\`/\`and\` return \`bool\`, ` +
|
|
609
|
+
`not the operand. Wrap in \`bool()\` to accept bool result, or use a ternary ` +
|
|
610
|
+
`(\`a ? a : b\`) for value coalescing.`);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
const left = t.emitExpression(node.left);
|
|
615
|
+
const right = t.emitExpression(node.right);
|
|
616
|
+
const op = binaryOperator(node.operatorToken.kind);
|
|
617
|
+
return `${left} ${op} ${right}`;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Report an error if the right-hand side of a `x in y` expression resolves
|
|
621
|
+
* to a type that GDScript doesn't support with `in`. Only `Dictionary`
|
|
622
|
+
* (object-like types) and `String` are valid; arrays, Packed*Array, and
|
|
623
|
+
* value types like `Vector2`/`Color` are rejected.
|
|
624
|
+
*/
|
|
625
|
+
function checkInOperatorRhs(t, node) {
|
|
626
|
+
const rhs = node.right;
|
|
627
|
+
const checker = t.ctx.checker;
|
|
628
|
+
const type = checker.getTypeAtLocation(rhs);
|
|
629
|
+
// Collapse union types to their non-null constituents
|
|
630
|
+
const baseTypes = type.isUnion()
|
|
631
|
+
? type.types.filter((u) => !(u.flags & ts.TypeFlags.Null) && !(u.flags & ts.TypeFlags.Undefined))
|
|
632
|
+
: [type];
|
|
633
|
+
for (const bt of baseTypes) {
|
|
634
|
+
const banned = classifyInRhsType(bt, checker, t.ctx.diagInfo);
|
|
635
|
+
if (banned) {
|
|
636
|
+
t.addDiagnostic(node, 'type-error', `The \`in\` operator cannot be used with ${banned} in GDScript. ` +
|
|
637
|
+
`Only Dictionary and String support \`in\`.`);
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
// ---- Operator Mapping ----
|
|
643
|
+
export function binaryOperator(kind) {
|
|
644
|
+
switch (kind) {
|
|
645
|
+
case ts.SyntaxKind.PlusToken:
|
|
646
|
+
return '+';
|
|
647
|
+
case ts.SyntaxKind.MinusToken:
|
|
648
|
+
return '-';
|
|
649
|
+
case ts.SyntaxKind.AsteriskToken:
|
|
650
|
+
return '*';
|
|
651
|
+
case ts.SyntaxKind.SlashToken:
|
|
652
|
+
return '/';
|
|
653
|
+
case ts.SyntaxKind.PercentToken:
|
|
654
|
+
return '%';
|
|
655
|
+
case ts.SyntaxKind.AsteriskAsteriskToken:
|
|
656
|
+
return '**';
|
|
657
|
+
case ts.SyntaxKind.EqualsEqualsEqualsToken:
|
|
658
|
+
return '==';
|
|
659
|
+
case ts.SyntaxKind.ExclamationEqualsEqualsToken:
|
|
660
|
+
return '!=';
|
|
661
|
+
case ts.SyntaxKind.EqualsEqualsToken:
|
|
662
|
+
return '==';
|
|
663
|
+
case ts.SyntaxKind.ExclamationEqualsToken:
|
|
664
|
+
return '!=';
|
|
665
|
+
case ts.SyntaxKind.LessThanToken:
|
|
666
|
+
return '<';
|
|
667
|
+
case ts.SyntaxKind.LessThanEqualsToken:
|
|
668
|
+
return '<=';
|
|
669
|
+
case ts.SyntaxKind.GreaterThanToken:
|
|
670
|
+
return '>';
|
|
671
|
+
case ts.SyntaxKind.GreaterThanEqualsToken:
|
|
672
|
+
return '>=';
|
|
673
|
+
case ts.SyntaxKind.AmpersandAmpersandToken:
|
|
674
|
+
return 'and';
|
|
675
|
+
case ts.SyntaxKind.BarBarToken:
|
|
676
|
+
return 'or';
|
|
677
|
+
case ts.SyntaxKind.EqualsToken:
|
|
678
|
+
return '=';
|
|
679
|
+
case ts.SyntaxKind.PlusEqualsToken:
|
|
680
|
+
return '+=';
|
|
681
|
+
case ts.SyntaxKind.MinusEqualsToken:
|
|
682
|
+
return '-=';
|
|
683
|
+
case ts.SyntaxKind.AsteriskEqualsToken:
|
|
684
|
+
return '*=';
|
|
685
|
+
case ts.SyntaxKind.SlashEqualsToken:
|
|
686
|
+
return '/=';
|
|
687
|
+
case ts.SyntaxKind.PercentEqualsToken:
|
|
688
|
+
return '%=';
|
|
689
|
+
case ts.SyntaxKind.AmpersandToken:
|
|
690
|
+
return '&';
|
|
691
|
+
case ts.SyntaxKind.BarToken:
|
|
692
|
+
return '|';
|
|
693
|
+
case ts.SyntaxKind.CaretToken:
|
|
694
|
+
return '^';
|
|
695
|
+
case ts.SyntaxKind.LessThanLessThanToken:
|
|
696
|
+
return '<<';
|
|
697
|
+
case ts.SyntaxKind.GreaterThanGreaterThanToken:
|
|
698
|
+
return '>>';
|
|
699
|
+
case ts.SyntaxKind.InKeyword:
|
|
700
|
+
return 'in';
|
|
701
|
+
case ts.SyntaxKind.InstanceOfKeyword:
|
|
702
|
+
return 'is';
|
|
703
|
+
default:
|
|
704
|
+
return '??';
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
export function unaryOperator(op) {
|
|
708
|
+
switch (op) {
|
|
709
|
+
case ts.SyntaxKind.ExclamationToken:
|
|
710
|
+
return 'not ';
|
|
711
|
+
case ts.SyntaxKind.MinusToken:
|
|
712
|
+
return '-';
|
|
713
|
+
case ts.SyntaxKind.PlusToken:
|
|
714
|
+
return '+';
|
|
715
|
+
case ts.SyntaxKind.TildeToken:
|
|
716
|
+
return '~';
|
|
717
|
+
default:
|
|
718
|
+
return '';
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
// ---- String Literals ----
|
|
722
|
+
export function emitStringLiteral(t, node) {
|
|
723
|
+
// Get the raw source text which preserves escape sequences
|
|
724
|
+
const raw = node.getText(t.ctx.sourceFile);
|
|
725
|
+
// If already double-quoted, use as-is
|
|
726
|
+
if (raw.startsWith('"')) {
|
|
727
|
+
return raw;
|
|
728
|
+
}
|
|
729
|
+
// Single-quoted -> double-quoted with proper escaping
|
|
730
|
+
const inner = node.text.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
731
|
+
return `"${inner}"`;
|
|
732
|
+
}
|
|
733
|
+
export function escapeGdString(text) {
|
|
734
|
+
return text.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
735
|
+
}
|
|
736
|
+
// ---- Template Literals ----
|
|
737
|
+
export function emitTemplateExpression(t, node) {
|
|
738
|
+
let result = `"${t.escapeGdString(node.head.text)}"`;
|
|
739
|
+
for (const span of node.templateSpans) {
|
|
740
|
+
const expr = t.emitExpression(span.expression);
|
|
741
|
+
result += ` + str(${expr})`;
|
|
742
|
+
if (span.literal.text) {
|
|
743
|
+
result += ` + "${t.escapeGdString(span.literal.text)}"`;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
return result;
|
|
747
|
+
}
|
|
748
|
+
// ---- Lambda ----
|
|
749
|
+
export function emitLambda(t, node) {
|
|
750
|
+
const params = t.emitParameters(node.parameters);
|
|
751
|
+
// Return type
|
|
752
|
+
const returnType = tsTypeNodeToGdType(node.type, t.ctx.checker, t.ctx.sourceFile, t.currentClassName);
|
|
753
|
+
const returnAnnotation = returnType ? ` -> ${returnType}` : '';
|
|
754
|
+
if (ts.isBlock(node.body)) {
|
|
755
|
+
// Multi-line lambda: return header only. Body will be emitted by emitLambdaBody().
|
|
756
|
+
return `func(${params})${returnAnnotation}:`;
|
|
757
|
+
}
|
|
758
|
+
// Single expression lambda
|
|
759
|
+
const body = t.emitExpression(node.body);
|
|
760
|
+
return `func(${params})${returnAnnotation}: return ${body}`;
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Check if an expression is a block-body lambda (arrow function or function expression with a block body).
|
|
764
|
+
*/
|
|
765
|
+
export function isBlockLambda(node) {
|
|
766
|
+
return ((ts.isArrowFunction(node) || ts.isFunctionExpression(node)) &&
|
|
767
|
+
ts.isBlock(node.body));
|
|
768
|
+
}
|
|
769
|
+
/**
|
|
770
|
+
* Emit the body of a block lambda. Call this after the line containing the lambda header.
|
|
771
|
+
*/
|
|
772
|
+
export function emitLambdaBody(t, node) {
|
|
773
|
+
if (!ts.isBlock(node.body))
|
|
774
|
+
return;
|
|
775
|
+
t.emitter.indent();
|
|
776
|
+
if (node.body.statements.length === 0) {
|
|
777
|
+
const pos = t.getLineAndCol(node.body);
|
|
778
|
+
t.emitter.writeLine('pass', pos.line, pos.col);
|
|
779
|
+
}
|
|
780
|
+
else {
|
|
781
|
+
t.visitBlock(node.body);
|
|
782
|
+
}
|
|
783
|
+
t.emitter.dedent();
|
|
784
|
+
}
|
|
785
|
+
// ---- Multi-line Dict ----
|
|
786
|
+
/** Emit a multi-line GDScript dict with proper indentation */
|
|
787
|
+
export function emitMultiLineDict(t, entries) {
|
|
788
|
+
const innerIndent = t.emitter.getIndentStr(t.emitter.getIndentLevel() + 1);
|
|
789
|
+
const outerIndent = t.emitter.getIndentStr();
|
|
790
|
+
const lines = entries.map((e) => `${innerIndent}${e},`);
|
|
791
|
+
return `{\n${lines.join('\n')}\n${outerIndent}}`;
|
|
792
|
+
}
|
|
793
|
+
//# sourceMappingURL=expressions.js.map
|