@defold-typescript/transpiler 0.29.0 → 0.31.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.
Files changed (37) hide show
  1. package/dist/animation-sources.d.ts +6 -0
  2. package/dist/{sprite-animation-index.d.ts → component-animation-index.d.ts} +4 -4
  3. package/dist/config-key-index.d.ts +1 -0
  4. package/dist/gui-flipbook-index.d.ts +8 -0
  5. package/dist/gui-node-index.d.ts +21 -0
  6. package/dist/index.d.ts +21 -8
  7. package/dist/index.js +1317 -289
  8. package/dist/library-dependencies.d.ts +47 -0
  9. package/dist/scene-address-declaration.d.ts +14 -0
  10. package/dist/scene-collection-roles.d.ts +30 -0
  11. package/dist/scene-component-index.d.ts +20 -0
  12. package/dist/scene-documents.d.ts +21 -0
  13. package/dist/scene-naming-context.d.ts +66 -0
  14. package/dist/scene-object-path-index.d.ts +4 -1
  15. package/dist/url-address-literals.d.ts +10 -0
  16. package/dist/url-address-slots.d.ts +3 -1
  17. package/dist/url-cross-world-address.d.ts +41 -0
  18. package/dist/url-fragment-reachability.d.ts +3 -0
  19. package/package.json +2 -2
  20. package/src/animation-sources.ts +90 -0
  21. package/src/component-animation-index.ts +399 -0
  22. package/src/config-key-index.ts +28 -2
  23. package/src/gui-flipbook-index.ts +91 -0
  24. package/src/gui-node-index.ts +42 -4
  25. package/src/index.ts +66 -10
  26. package/src/library-dependencies.ts +337 -0
  27. package/src/scene-address-declaration.ts +74 -0
  28. package/src/scene-collection-roles.ts +267 -0
  29. package/src/scene-component-index.ts +74 -6
  30. package/src/scene-documents.ts +186 -0
  31. package/src/scene-naming-context.ts +130 -0
  32. package/src/scene-object-path-index.ts +172 -33
  33. package/src/url-address-literals.ts +115 -0
  34. package/src/url-address-slots.ts +23 -2
  35. package/src/url-cross-world-address.ts +109 -0
  36. package/src/url-fragment-reachability.ts +72 -93
  37. package/src/sprite-animation-index.ts +0 -241
@@ -0,0 +1,6 @@
1
+ import { type SceneMessage } from "./scene-text-format";
2
+ export declare function resourceKey(resource: string): string;
3
+ export declare function normalizeDocumentKey(path: string): string;
4
+ export declare function declaredAnimations(document: SceneMessage): Set<string>;
5
+ export declare function readAnimationSources(assets: ReadonlyMap<string, string>, unresolved: string[]): Map<string, Set<string>>;
6
+ export declare function animationSetEntries(document: SceneMessage): string[];
@@ -1,10 +1,10 @@
1
- export interface SpriteAnimationIndex {
1
+ export interface ComponentAnimationIndex {
2
2
  readonly byScriptResource: ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>;
3
- readonly tileSetByScriptResource: ReadonlyMap<string, ReadonlyMap<string, string>>;
3
+ readonly sourceByScriptResource: ReadonlyMap<string, ReadonlyMap<string, ReadonlyMap<string, string>>>;
4
4
  readonly unresolved: readonly string[];
5
5
  }
6
- export declare function buildSpriteAnimationIndex(input: {
6
+ export declare function buildComponentAnimationIndex(input: {
7
7
  scenes: ReadonlyMap<string, string>;
8
8
  assets: ReadonlyMap<string, string>;
9
- }): SpriteAnimationIndex;
9
+ }): ComponentAnimationIndex;
10
10
  export declare function componentIdOfSameObjectAddress(address: string): string | undefined;
@@ -1 +1,2 @@
1
1
  export declare function buildConfigKeyIndex(gameProjectText: string): ReadonlySet<string>;
2
+ export declare function readGameProjectSetting(gameProjectText: string, section: string, key: string): string | undefined;
@@ -0,0 +1,8 @@
1
+ export interface GuiFlipbookIndex {
2
+ readonly byScriptResource: ReadonlyMap<string, ReadonlyMap<string, ReadonlySet<string>>>;
3
+ readonly unresolved: readonly string[];
4
+ }
5
+ export declare function buildGuiFlipbookIndex(input: {
6
+ scenes: ReadonlyMap<string, string>;
7
+ assets: ReadonlyMap<string, string>;
8
+ }): GuiFlipbookIndex;
@@ -1,5 +1,26 @@
1
+ import { type SceneMessage } from "./scene-text-format";
1
2
  export interface GuiNodeIndex {
2
3
  readonly byScriptResource: ReadonlyMap<string, ReadonlySet<string>>;
3
4
  readonly unresolved: readonly string[];
4
5
  }
6
+ /**
7
+ * The gui-script resource one already-parsed `.gui` names, keyed the way this
8
+ * index keys it. Exported so the naming-context resolver reaches a gui script
9
+ * through the same rule rather than a second reader — the aggregation on top
10
+ * differs on purpose (this index refuses a resource two scenes claim, while two
11
+ * scenes driving one gui script really is two naming contexts), but the key
12
+ * shape has one owner.
13
+ */
14
+ export declare function guiScriptResourceOf(document: SceneMessage): string | undefined;
15
+ /**
16
+ * Every `.gui` document's display path mapped to the gui-script resource it
17
+ * names, skipping a `.gui` that names none and one this parser cannot read.
18
+ *
19
+ * The map `buildScriptNamingContexts` consumes, built once here so the editor
20
+ * plugin and the CLI reach a gui script through one reader. Unlike
21
+ * `buildGuiNodeIndex` it records no ambiguity: two `.gui` scenes driving one gui
22
+ * script really are two naming contexts, while they would make that script's
23
+ * node ids unanswerable.
24
+ */
25
+ export declare function guiScriptResourcesOf(documents: ReadonlyMap<string, string>): ReadonlyMap<string, string>;
5
26
  export declare function buildGuiNodeIndex(documents: ReadonlyMap<string, string>): GuiNodeIndex;
package/dist/index.d.ts CHANGED
@@ -1,25 +1,38 @@
1
- export { buildConfigKeyIndex } from "./config-key-index";
1
+ export type { ComponentAnimationIndex } from "./component-animation-index";
2
+ export { buildComponentAnimationIndex, componentIdOfSameObjectAddress, } from "./component-animation-index";
3
+ export { buildConfigKeyIndex, readGameProjectSetting } from "./config-key-index";
4
+ export type { GuiFlipbookIndex } from "./gui-flipbook-index";
5
+ export { buildGuiFlipbookIndex } from "./gui-flipbook-index";
2
6
  export type { GuiNodeIndex } from "./gui-node-index";
3
- export { buildGuiNodeIndex } from "./gui-node-index";
7
+ export { buildGuiNodeIndex, guiScriptResourceOf, guiScriptResourcesOf, } from "./gui-node-index";
4
8
  export { buildInputActionIndex } from "./input-action-index";
9
+ export type { ExtensionDependency, LibraryIncludedEntries, LibrarySceneDocument, LibrarySceneDocuments, LibrarySharedEntry, } from "./library-dependencies";
10
+ export { archiveWrapperOf, isContainedResourcePath, LIBRARY_DEPENDENCY_ROOT, libraryIncludedEntries, readGameProjectDependencies, readLibrarySceneDocuments, } from "./library-dependencies";
5
11
  export { findMainEntryFactoryImports } from "./main-entry-factory-imports";
6
12
  export type { BuildConfig, ScriptKind, SourceOutputKind } from "./output-paths";
7
13
  export { computeOutputRel, DEFAULT_INCLUDE, parseBuildConfig, SCRIPT_SUFFIX_BY_KIND, stripIncludeBase, } from "./output-paths";
8
14
  export { getProgramDiagnostics } from "./program-diagnostics";
9
15
  export { isDefignoredPath, SCAFFOLDED_DEFIGNORE_LINES } from "./project-resources";
10
- export type { SceneComponentIndex } from "./scene-component-index";
11
- export { buildSceneComponentIndex } from "./scene-component-index";
16
+ export { buildSceneAddressDeclaration } from "./scene-address-declaration";
17
+ export type { SceneCollectionRoles, SceneCollectionRolesInput } from "./scene-collection-roles";
18
+ export { buildSceneCollectionRoles } from "./scene-collection-roles";
19
+ export type { ComponentDeclarations, SceneComponentIndex } from "./scene-component-index";
20
+ export { buildSceneComponentIndex, collectComponentDeclarations, collectComponentIds, } from "./scene-component-index";
21
+ export type { SceneReadHost } from "./scene-documents";
22
+ export { ANIMATION_ASSET_EXTENSIONS, COLLECTION_REFERENCE_EXTENSIONS, displayPathOf, GAME_PROJECT_DOCUMENT, GUI_EXTENSIONS, INPUT_BINDING_EXTENSIONS, isExcludedProjectPath, LIBRARY_SCENE_EXTENSIONS, listProjectResourcePaths, PROJECT_EXTENSIONS, readSceneDocuments, SCENE_EXTENSIONS, } from "./scene-documents";
23
+ export type { NamingContext } from "./scene-naming-context";
24
+ export { buildScriptNamingContexts, relativeAddressesFrom, socketOfAddress, } from "./scene-naming-context";
12
25
  export type { SceneObjectPathIndex } from "./scene-object-path-index";
13
26
  export { buildSceneObjectPathIndex } from "./scene-object-path-index";
14
27
  export type { SceneMessage } from "./scene-text-format";
15
28
  export { parseSceneTextFormat, SceneTextFormatError } from "./scene-text-format";
16
29
  export type { TranspileSession } from "./session";
17
30
  export { createTranspileSession } from "./session";
18
- export type { SpriteAnimationIndex } from "./sprite-animation-index";
19
- export { buildSpriteAnimationIndex, componentIdOfSameObjectAddress, } from "./sprite-animation-index";
20
31
  export type { TranspileDiagnostic, TranspileProjectInput, TranspileProjectResult, TranspileResult, } from "./transpile";
21
32
  export { transpile, transpileProject } from "./transpile";
22
33
  export type { ClassifiedSlot } from "./url-address-slots";
23
- export { addressClassOfArgument, isAddressClass, isFragmentCaret, resolveClassifiedSlotAtPosition, } from "./url-address-slots";
24
- export type { UrlFragmentFinding, UrlFragmentReport } from "./url-fragment-reachability";
34
+ export { addressClassOfArgument, addressEntryOfArgument, isAddressClass, isFragmentCaret, resolveClassifiedSlotAtPosition, } from "./url-address-slots";
35
+ export type { CrossWorldAddressFinding } from "./url-cross-world-address";
36
+ export { checkCrossWorldAddresses, slotRejectsForeignSocket } from "./url-cross-world-address";
37
+ export type { SceneObjectComponents, UrlFragmentFinding, UrlFragmentReport, } from "./url-fragment-reachability";
25
38
  export { checkUrlFragmentReachability } from "./url-fragment-reachability";