@defold-typescript/transpiler 0.52.0 → 0.54.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.
@@ -40,6 +40,13 @@ export interface CompanionClosure {
40
40
  * companion takes its own `require` of the same module instead.
41
41
  */
42
42
  readonly importBindings: readonly string[];
43
+ /**
44
+ * The unedited `setup-debug` managed block's statements, in source order, or
45
+ * empty. They are exempt from the order rule because the emit runs them ahead
46
+ * of the companion's `require`, so the debugger starts before anything the
47
+ * companion loads.
48
+ */
49
+ readonly bootstrap: readonly ts.Statement[];
43
50
  /** Shapes a split cannot preserve. Empty means the source is splittable. */
44
51
  readonly violations: readonly ClosureViolation[];
45
52
  }
@@ -0,0 +1,21 @@
1
+ import * as ts from "typescript";
2
+ export declare const DEBUG_BLOCK_BEGIN = "// defold-typescript:setup-debug BEGIN \u2014 managed block, do not edit";
3
+ export declare const DEBUG_BLOCK_END = "// defold-typescript:setup-debug END";
4
+ export declare const DEBUG_MANAGED_BLOCK = "// defold-typescript:setup-debug BEGIN \u2014 managed block, do not edit\nimport * as lldebugger from \"lldebugger.debug\";\n\nif (sys.get_engine_info().is_debug) {\n lldebugger.start();\n}\n\n// defold-typescript:setup-debug END";
5
+ export interface ManagedBootstrap {
6
+ /** The top-level statements wholly between the sentinels, in source order. */
7
+ readonly statements: readonly ts.Statement[];
8
+ /**
9
+ * Whether the text between the sentinels is the canonical body token for
10
+ * token, so line endings, quote style, comments and optional semicolons never
11
+ * decide it.
12
+ */
13
+ readonly canonical: boolean;
14
+ }
15
+ /**
16
+ * The `setup-debug` managed block in a source, located the way
17
+ * `upsertManagedBlock` locates it: exactly one BEGIN and one END, BEGIN first.
18
+ * Any other sentinel shape is one `setup-debug` itself refuses to edit, so it
19
+ * is not a managed block at all.
20
+ */
21
+ export declare function findManagedBootstrap(sourceFile: ts.SourceFile): ManagedBootstrap | undefined;
package/dist/index.d.ts CHANGED
@@ -3,6 +3,8 @@ export { COMPANION_INTERNAL_FIELD, computeCompanionClosure } from "./companion-c
3
3
  export type { ComponentAnimationIndex } from "./component-animation-index";
4
4
  export { buildComponentAnimationIndex, componentIdOfSameObjectAddress, } from "./component-animation-index";
5
5
  export { buildConfigKeyIndex, readGameProjectSetting } from "./config-key-index";
6
+ export type { ManagedBootstrap } from "./debug-bootstrap";
7
+ export { DEBUG_BLOCK_BEGIN, DEBUG_BLOCK_END, DEBUG_MANAGED_BLOCK, findManagedBootstrap, } from "./debug-bootstrap";
6
8
  export { findEmittedRequires, LUALIB_REQUIRE_NAME } from "./emitted-requires";
7
9
  export type { GuiFlipbookIndex } from "./gui-flipbook-index";
8
10
  export { buildGuiFlipbookIndex } from "./gui-flipbook-index";