ocsigen / ts2ocaml

Generate OCaml bindings from TypeScript definitions via the TypeScript compiler API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@types/screeps doesn't type check.

hilaolu opened this issue · comments

Hi, thanks for this interesting project.
I am trying to use this to gen bindings for @types/screeps but it doesn't type check.
Is there any intrinsic tension between ocaml type system and @types/screeps?

Hi, thank you for trying out ts2ocaml!

Can you provide me the exact type error you've got from the compiler?

I am really sorry for not provide necessary information. But both the ts2ocaml and rescript compiler give me tons of WARN and ERR that I don't know where to get started.

Here is the output of ts2ocaml.

hilaolu@nixos:~/screeps-typescript-starter$ npm install @types/screeps
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'screeps-typescript-starter@3.0.0',
npm WARN EBADENGINE   required: { node: '10.x || 12.x' },
npm WARN EBADENGINE   current: { node: 'v18.19.0', npm: '10.2.3' }
npm WARN EBADENGINE }

up to date, audited 395 packages in 6s

100 packages are looking for funding
  run `npm fund` for details

10 vulnerabilities (5 moderate, 3 high, 2 critical)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
hilaolu@nixos:~/screeps-typescript-starter$ npm install @ocsigen/ts2ocaml@beta
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'screeps-typescript-starter@3.0.0',
npm WARN EBADENGINE   required: { node: '10.x || 12.x' },
npm WARN EBADENGINE   current: { node: 'v18.19.0', npm: '10.2.3' }
npm WARN EBADENGINE }

up to date, audited 395 packages in 1s

100 packages are looking for funding
  run `npm fund` for details

10 vulnerabilities (5 moderate, 3 high, 2 critical)

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
hilaolu@nixos:~/screeps-typescript-starter$ npx ts2ocaml res --preset full --output-dir src node_modules/@types/screeps/index.d.ts
warn: unsupported property name '[PWR_GENERATE_OPS]' in PropertySignature at line 861, col 5 of node_modules/@types/screeps/index.d.ts
> 861 |     [PWR_GENERATE_OPS]: {
      |     ^^^^^^^^^^^^^^^^^^^^^
> 862 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 863 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 864 |         cooldown: 50;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 865 |         effect: [1, 2, 4, 6, 8];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 866 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_OPERATE_SPAWN]' in PropertySignature at line 867, col 5 of node_modules/@types/screeps/index.d.ts
> 867 |     [PWR_OPERATE_SPAWN]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^
> 868 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 869 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 870 |         cooldown: 300;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 871 |         duration: 1000;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 872 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 873 |         ops: 100;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 874 |         effect: [0.9, 0.7, 0.5, 0.35, 0.2];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 875 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_OPERATE_TOWER]' in PropertySignature at line 876, col 5 of node_modules/@types/screeps/index.d.ts
> 876 |     [PWR_OPERATE_TOWER]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^
> 877 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 878 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 879 |         cooldown: 10;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 880 |         duration: 100;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 881 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 882 |         ops: 10;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 883 |         effect: [1.1, 1.2, 1.3, 1.4, 1.5];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 884 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_OPERATE_STORAGE]' in PropertySignature at line 885, col 5 of node_modules/@types/screeps/index.d.ts
> 885 |     [PWR_OPERATE_STORAGE]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^^^
> 886 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 887 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 888 |         cooldown: 800;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 889 |         duration: 1000;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 890 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 891 |         ops: 100;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 892 |         effect: [500000, 1000000, 2000000, 4000000, 7000000];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 893 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_OPERATE_LAB]' in PropertySignature at line 894, col 5 of node_modules/@types/screeps/index.d.ts
> 894 |     [PWR_OPERATE_LAB]: {
      |     ^^^^^^^^^^^^^^^^^^^^
> 895 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 896 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 897 |         cooldown: 50;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 898 |         duration: 1000;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 899 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 900 |         ops: 10;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 901 |         effect: [2, 4, 6, 8, 10];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 902 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_OPERATE_EXTENSION]' in PropertySignature at line 903, col 5 of node_modules/@types/screeps/index.d.ts
> 903 |     [PWR_OPERATE_EXTENSION]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
> 904 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 905 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 906 |         cooldown: 50;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 907 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 908 |         ops: 2;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 909 |         effect: [0.2, 0.4, 0.6, 0.8, 1.0];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 910 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_OPERATE_OBSERVER]' in PropertySignature at line 911, col 5 of node_modules/@types/screeps/index.d.ts
> 911 |     [PWR_OPERATE_OBSERVER]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^
> 912 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 913 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 914 |         cooldown: 400;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 915 |         duration: [200, 400, 600, 800, 1000];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 916 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 917 |         ops: 10;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 918 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_OPERATE_TERMINAL]' in PropertySignature at line 919, col 5 of node_modules/@types/screeps/index.d.ts
> 919 |     [PWR_OPERATE_TERMINAL]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^
> 920 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 921 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 922 |         cooldown: 500;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 923 |         duration: 1000;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 924 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 925 |         ops: 100;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 926 |         effect: [0.9, 0.8, 0.7, 0.6, 0.5];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 927 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_DISRUPT_SPAWN]' in PropertySignature at line 928, col 5 of node_modules/@types/screeps/index.d.ts
> 928 |     [PWR_DISRUPT_SPAWN]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^
> 929 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 930 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 931 |         cooldown: 5;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 932 |         range: 20;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 933 |         ops: 10;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 934 |         duration: [1, 2, 3, 4, 5];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 935 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_DISRUPT_TOWER]' in PropertySignature at line 936, col 5 of node_modules/@types/screeps/index.d.ts
> 936 |     [PWR_DISRUPT_TOWER]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^
> 937 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 938 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 939 |         cooldown: 0;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 940 |         duration: 5;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 941 |         range: 50;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 942 |         ops: 10;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 943 |         effect: [0.9, 0.8, 0.7, 0.6, 0.5];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 944 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_DISRUPT_SOURCE]' in PropertySignature at line 945, col 5 of node_modules/@types/screeps/index.d.ts
> 945 |     [PWR_DISRUPT_SOURCE]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^^
> 946 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 947 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 948 |         cooldown: 100;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 949 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 950 |         ops: 100;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 951 |         duration: [100, 200, 300, 400, 500];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 952 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_SHIELD]' in PropertySignature at line 953, col 5 of node_modules/@types/screeps/index.d.ts
> 953 |     [PWR_SHIELD]: {
      |     ^^^^^^^^^^^^^^^
> 954 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 955 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 956 |         effect: [5000, 10000, 15000, 20000, 25000];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 957 |         duration: 50;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 958 |         cooldown: 20;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 959 |         energy: 100;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 960 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_REGEN_SOURCE]' in PropertySignature at line 961, col 5 of node_modules/@types/screeps/index.d.ts
> 961 |     [PWR_REGEN_SOURCE]: {
      |     ^^^^^^^^^^^^^^^^^^^^^
> 962 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 963 |         level: [10, 11, 12, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 964 |         cooldown: 100;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 965 |         duration: 300;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 966 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 967 |         effect: [50, 100, 150, 200, 250];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 968 |         period: 15;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 969 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_REGEN_MINERAL]' in PropertySignature at line 970, col 5 of node_modules/@types/screeps/index.d.ts
> 970 |     [PWR_REGEN_MINERAL]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^
> 971 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 972 |         level: [10, 11, 12, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 973 |         cooldown: 100;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 974 |         duration: 100;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 975 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 976 |         effect: [2, 4, 6, 8, 10];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 977 |         period: 10;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 978 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_DISRUPT_TERMINAL]' in PropertySignature at line 979, col 5 of node_modules/@types/screeps/index.d.ts
> 979 |     [PWR_DISRUPT_TERMINAL]: {
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^
> 980 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 981 |         level: [20, 21, 22, 23, 24];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 982 |         cooldown: 8;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 983 |         duration: 10;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 984 |         range: 50;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 985 |         ops: [50, 40, 30, 20, 10];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 986 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_FORTIFY]' in PropertySignature at line 987, col 5 of node_modules/@types/screeps/index.d.ts
> 987 |     [PWR_FORTIFY]: {
      |     ^^^^^^^^^^^^^^^^
> 988 |         className: POWER_CLASS["OPERATOR"];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 989 |         level: [0, 2, 7, 14, 22];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 990 |         cooldown: 5;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 991 |         range: 3;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 992 |         ops: 5;
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 993 |         duration: [1, 2, 3, 4, 5];
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 994 |     };
      | ^^^^^^^
warn: unsupported property name '[PWR_OPERATE_POWER]' in PropertySignature at line 995, col 5 of node_modules/@types/screeps/index.d.ts
>  995 |     [PWR_OPERATE_POWER]: {
       |     ^^^^^^^^^^^^^^^^^^^^^^
>  996 |         className: POWER_CLASS["OPERATOR"];
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  997 |         level: [10, 11, 12, 14, 22];
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  998 |         cooldown: 800;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>  999 |         range: 3;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1000 |         duration: 1000;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1001 |         ops: 200;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1002 |         effect: [1, 2, 3, 4, 5];
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1003 |     };
       | ^^^^^^^
warn: unsupported property name '[PWR_OPERATE_CONTROLLER]' in PropertySignature at line 1004, col 5 of node_modules/@types/screeps/index.d.ts
> 1004 |     [PWR_OPERATE_CONTROLLER]: {
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1005 |         className: POWER_CLASS["OPERATOR"];
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1006 |         level: [20, 21, 22, 23, 24];
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1007 |         cooldown: 800;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1008 |         range: 3;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1009 |         duration: 1000;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1010 |         ops: 200;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1011 |         effect: [10, 20, 30, 40, 50];
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1012 |     };
       | ^^^^^^^
warn: unsupported property name '[PWR_OPERATE_FACTORY]' in PropertySignature at line 1013, col 5 of node_modules/@types/screeps/index.d.ts
> 1013 |     [PWR_OPERATE_FACTORY]: {
       |     ^^^^^^^^^^^^^^^^^^^^^^^^
> 1014 |         className: POWER_CLASS["OPERATOR"];
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1015 |         level: [0, 2, 7, 14, 22];
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1016 |         cooldown: 1000;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1017 |         range: 3;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1018 |         duration: 1000;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1019 |         ops: 100;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 1020 |     };
       | ^^^^^^^
warn: unsupported TypeNode kind: ConditionalType at line 1735, col 74 of node_modules/@types/screeps/index.d.ts
> 1735 | type BodyPartDefinition<T extends BodyPartConstant = BodyPartConstant> = T extends any ? {
       |                                                                          ^^^^^^^^^^^^^^^^^
> 1736 |         /**
       | ^^^^^^^^^^^
> 1737 |          * One of the `RESOURCE_*` constants.
       | ^^^^^^^^^^^
> 1738 |          *
       | ^^^^^^^^^^^
> 1739 |          * If the body part is boosted, this property specifies the mineral type which is used for boosting.
       | ^^^^^^^^^^^
> 1740 |          */
       | ^^^^^^^^^^^
> 1741 |         boost?: keyof (typeof BOOSTS)[T];
       | ^^^^^^^^^^^
> 1742 |         /**
       | ^^^^^^^^^^^
> 1743 |          * One of the body part types constants.
       | ^^^^^^^^^^^
> 1744 |          */
       | ^^^^^^^^^^^
> 1745 |         type: T;
       | ^^^^^^^^^^^
> 1746 |         /**
       | ^^^^^^^^^^^
> 1747 |          * The remaining amount of hit points of this body part.
       | ^^^^^^^^^^^
> 1748 |          */
       | ^^^^^^^^^^^
> 1749 |         hits: number;
       | ^^^^^^^^^^^
> 1750 |     }
       | ^^^^^^^^^^^
> 1751 |     : never;
       | ^^^^^^^^^^^^
warn: unsupported TypeNode kind: MappedType at line 1826, col 94 of node_modules/@types/screeps/index.d.ts
> 1826 | type LookForAtAreaResult<T, K extends keyof LookAtTypes = keyof LookAtTypes> = { type: K } & { [P in K]: T };
       |                                                                                              ^^^^^^^^^^^^^^^
warn: unsupported property name '[OpaqueTagSymbol]' in PropertyDeclaration at line 2030, col 9 of node_modules/@types/screeps/index.d.ts
> 2030 |         private [OpaqueTagSymbol]: T;
       |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported TypeNode kind: ConditionalType at line 2034, col 18 of node_modules/@types/screeps/index.d.ts
> 2034 | type fromId<T> = T extends Id<infer R> ? R : never;
       |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: type predicate is not supported and treated as boolean at line 2198, col 54 of node_modules/@types/screeps/index.d.ts
> 2198 | type FilterFunction<T, S extends T> = (object: T) => object is S;
       |                                                      ^^^^^^^^^^^
warn: unsupported property name '[EVENT_ATTACK]' in PropertySignature at line 2672, col 5 of node_modules/@types/screeps/index.d.ts
> 2672 |     [EVENT_ATTACK]: {
       |     ^^^^^^^^^^^^^^^^^
> 2673 |         targetId: string;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2674 |         damage: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2675 |         attackType: EventAttackType;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2676 |     };
       | ^^^^^^^
warn: unsupported property name '[EVENT_OBJECT_DESTROYED]' in PropertySignature at line 2677, col 5 of node_modules/@types/screeps/index.d.ts
> 2677 |     [EVENT_OBJECT_DESTROYED]: {
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2678 |         type: EventDestroyType;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2679 |     };
       | ^^^^^^^
warn: unsupported property name '[EVENT_ATTACK_CONTROLLER]' in PropertySignature at line 2680, col 5 of node_modules/@types/screeps/index.d.ts
> 2680 |     [EVENT_ATTACK_CONTROLLER]: null;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[EVENT_BUILD]' in PropertySignature at line 2681, col 5 of node_modules/@types/screeps/index.d.ts
> 2681 |     [EVENT_BUILD]: {
       |     ^^^^^^^^^^^^^^^^
> 2682 |         targetId: string;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2683 |         amount: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2684 |         energySpent: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2685 |     };
       | ^^^^^^^
warn: unsupported property name '[EVENT_HARVEST]' in PropertySignature at line 2686, col 5 of node_modules/@types/screeps/index.d.ts
> 2686 |     [EVENT_HARVEST]: {
       |     ^^^^^^^^^^^^^^^^^^
> 2687 |         targetId: string;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2688 |         amount: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2689 |     };
       | ^^^^^^^
warn: unsupported property name '[EVENT_HEAL]' in PropertySignature at line 2690, col 5 of node_modules/@types/screeps/index.d.ts
> 2690 |     [EVENT_HEAL]: {
       |     ^^^^^^^^^^^^^^^
> 2691 |         targetId: string;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2692 |         amount: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2693 |         healType: EventHealType;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2694 |     };
       | ^^^^^^^
warn: unsupported property name '[EVENT_REPAIR]' in PropertySignature at line 2695, col 5 of node_modules/@types/screeps/index.d.ts
> 2695 |     [EVENT_REPAIR]: {
       |     ^^^^^^^^^^^^^^^^^
> 2696 |         targetId: string;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2697 |         amount: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2698 |         energySpent: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2699 |     };
       | ^^^^^^^
warn: unsupported property name '[EVENT_RESERVE_CONTROLLER]' in PropertySignature at line 2700, col 5 of node_modules/@types/screeps/index.d.ts
> 2700 |     [EVENT_RESERVE_CONTROLLER]: {
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2701 |         amount: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^
> 2702 |     };
       | ^^^^^^^
warn: unsupported property name '[EVENT_UPGRADE_CONTROLLER]' in PropertySignature at line 2703, col 5 of node_modules/@types/screeps/index.d.ts
> 2703 |     [EVENT_UPGRADE_CONTROLLER]: {
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 2704 |         amount: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^
> 2705 |         energySpent: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^
> 2706 |     };
       | ^^^^^^^
warn: unsupported property name '[EVENT_EXIT]' in PropertySignature at line 2707, col 5 of node_modules/@types/screeps/index.d.ts
> 2707 |     [EVENT_EXIT]: {
       |     ^^^^^^^^^^^^^^^
> 2708 |         room: string;
       | ^^^^^^^^^^^^^^^^^^^^^
> 2709 |         x: number;
       | ^^^^^^^^^^^^^^^^^^^^^
> 2710 |         y: number;
       | ^^^^^^^^^^^^^^^^^^^^^
> 2711 |     };
       | ^^^^^^^
warn: unsupported property name '[EVENT_POWER]' in PropertySignature at line 2712, col 5 of node_modules/@types/screeps/index.d.ts
> 2712 |     [EVENT_POWER]: {
       |     ^^^^^^^^^^^^^^^^
> 2713 |         targetId: string;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2714 |         power: PowerConstant;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2715 |     };
       | ^^^^^^^
warn: unsupported property name '[EVENT_TRANSFER]' in PropertySignature at line 2716, col 5 of node_modules/@types/screeps/index.d.ts
> 2716 |     [EVENT_TRANSFER]: {
       |     ^^^^^^^^^^^^^^^^^^^
> 2717 |         targetId: string;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2718 |         resourceType: ResourceConstant;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2719 |         amount: number;
       | ^^^^^^^^^^^^^^^^^^^^^^^^^
> 2720 |     };
       | ^^^^^^^
warn: unsupported TypeNode kind: ConditionalType at line 4898, col 8 of node_modules/@types/screeps/index.d.ts
> 4898 |     ): UNLIMITED_STORE extends true ? null
       |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 4899 |         : R extends undefined ? ResourceConstant extends POSSIBLE_RESOURCES ? number
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 4900 |             : null
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 4901 |         : R extends POSSIBLE_RESOURCES ? number
       | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 4902 |         : null;
       | ^^^^^^^^^^^^^^^
warn: unsupported TypeNode kind: ConditionalType at line 4910, col 8 of node_modules/@types/screeps/index.d.ts
> 4910 |     ): R extends undefined ? ResourceConstant extends POSSIBLE_RESOURCES ? number
       |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 4911 |         : null
       | ^^^^^^^^^^^^^^
> 4912 |         : R extends POSSIBLE_RESOURCES ? number
       | ^^^^^^^^^^^^^^
> 4913 |         : null;
       | ^^^^^^^^^^^^^^^
warn: unsupported TypeNode kind: ConditionalType at line 4921, col 8 of node_modules/@types/screeps/index.d.ts
> 4921 |     ): R extends undefined ? ResourceConstant extends POSSIBLE_RESOURCES ? number
       |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 4922 |         : null
       | ^^^^^^^^^^^^^^
> 4923 |         : R extends POSSIBLE_RESOURCES ? number
       | ^^^^^^^^^^^^^^
> 4924 |         : null;
       | ^^^^^^^^^^^^^^^
warn: unsupported TypeNode kind: MappedType at line 4932, col 7 of node_modules/@types/screeps/index.d.ts
> 4932 |     & { [P in POSSIBLE_RESOURCES]: number }
       |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported TypeNode kind: MappedType at line 4933, col 7 of node_modules/@types/screeps/index.d.ts
> 4933 |     & { [P in Exclude<ResourceConstant, POSSIBLE_RESOURCES>]: 0 };
       |       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported TypeNode kind: MappedType at line 4956, col 40 of node_modules/@types/screeps/index.d.ts
> 4956 | type GenericStore = GenericStoreBase & { [P in ResourceConstant]: number };
       |                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported TypeNode kind: ConditionalType at line 5017, col 12 of node_modules/@types/screeps/index.d.ts
> 5017 |     owner: T extends STRUCTURE_CONTROLLER ? Owner | undefined : Owner;
       |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_EXTENSION]' in PropertySignature at line 5716, col 5 of node_modules/@types/screeps/index.d.ts
> 5716 |     [STRUCTURE_EXTENSION]: StructureExtension;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_RAMPART]' in PropertySignature at line 5717, col 5 of node_modules/@types/screeps/index.d.ts
> 5717 |     [STRUCTURE_RAMPART]: StructureRampart;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_ROAD]' in PropertySignature at line 5718, col 5 of node_modules/@types/screeps/index.d.ts
> 5718 |     [STRUCTURE_ROAD]: StructureRoad;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_SPAWN]' in PropertySignature at line 5719, col 5 of node_modules/@types/screeps/index.d.ts
> 5719 |     [STRUCTURE_SPAWN]: StructureSpawn;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_LINK]' in PropertySignature at line 5720, col 5 of node_modules/@types/screeps/index.d.ts
> 5720 |     [STRUCTURE_LINK]: StructureLink;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_WALL]' in PropertySignature at line 5721, col 5 of node_modules/@types/screeps/index.d.ts
> 5721 |     [STRUCTURE_WALL]: StructureWall;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_STORAGE]' in PropertySignature at line 5722, col 5 of node_modules/@types/screeps/index.d.ts
> 5722 |     [STRUCTURE_STORAGE]: StructureStorage;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_TOWER]' in PropertySignature at line 5723, col 5 of node_modules/@types/screeps/index.d.ts
> 5723 |     [STRUCTURE_TOWER]: StructureTower;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_OBSERVER]' in PropertySignature at line 5724, col 5 of node_modules/@types/screeps/index.d.ts
> 5724 |     [STRUCTURE_OBSERVER]: StructureObserver;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_POWER_SPAWN]' in PropertySignature at line 5725, col 5 of node_modules/@types/screeps/index.d.ts
> 5725 |     [STRUCTURE_POWER_SPAWN]: StructurePowerSpawn;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_EXTRACTOR]' in PropertySignature at line 5726, col 5 of node_modules/@types/screeps/index.d.ts
> 5726 |     [STRUCTURE_EXTRACTOR]: StructureExtractor;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_LAB]' in PropertySignature at line 5727, col 5 of node_modules/@types/screeps/index.d.ts
> 5727 |     [STRUCTURE_LAB]: StructureLab;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_TERMINAL]' in PropertySignature at line 5728, col 5 of node_modules/@types/screeps/index.d.ts
> 5728 |     [STRUCTURE_TERMINAL]: StructureTerminal;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_CONTAINER]' in PropertySignature at line 5729, col 5 of node_modules/@types/screeps/index.d.ts
> 5729 |     [STRUCTURE_CONTAINER]: StructureContainer;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_NUKER]' in PropertySignature at line 5730, col 5 of node_modules/@types/screeps/index.d.ts
> 5730 |     [STRUCTURE_NUKER]: StructureNuker;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_FACTORY]' in PropertySignature at line 5731, col 5 of node_modules/@types/screeps/index.d.ts
> 5731 |     [STRUCTURE_FACTORY]: StructureFactory;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_KEEPER_LAIR]' in PropertySignature at line 5732, col 5 of node_modules/@types/screeps/index.d.ts
> 5732 |     [STRUCTURE_KEEPER_LAIR]: StructureKeeperLair;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_CONTROLLER]' in PropertySignature at line 5733, col 5 of node_modules/@types/screeps/index.d.ts
> 5733 |     [STRUCTURE_CONTROLLER]: StructureController;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_POWER_BANK]' in PropertySignature at line 5734, col 5 of node_modules/@types/screeps/index.d.ts
> 5734 |     [STRUCTURE_POWER_BANK]: StructurePowerBank;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_PORTAL]' in PropertySignature at line 5735, col 5 of node_modules/@types/screeps/index.d.ts
> 5735 |     [STRUCTURE_PORTAL]: StructurePortal;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: unsupported property name '[STRUCTURE_INVADER_CORE]' in PropertySignature at line 5736, col 5 of node_modules/@types/screeps/index.d.ts
> 5736 |     [STRUCTURE_INVADER_CORE]: StructureInvaderCore;
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warn: cannot resolve a type operator 'keyof LookAtTypes' at line 1820, col 70 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve a type operator 'keyof LookAtTypes' at line 1826, col 59 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve a type operator 'keyof LookAtTypes' at line 1828, col 66 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve a type operator 'keyof LookAtTypes' at line 1833, col 64 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'FindTypes[T]' at line 2196, col 28 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'FindTypes[T]' at line 2195, col 74 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_ATTACK]' at line 2613, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_OBJECT_DESTROYED]' at line 2618, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_ATTACK_CONTROLLER]' at line 2623, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_BUILD]' at line 2628, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_HARVEST]' at line 2633, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_HEAL]' at line 2638, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_REPAIR]' at line 2643, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_RESERVE_CONTROLLER]' at line 2648, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_UPGRADE_CONTROLLER]' at line 2653, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_EXIT]' at line 2658, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_POWER]' at line 2663, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'EventData[EVENT_TRANSFER]' at line 2668, col 15 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'FindTypes[K]' at line 3915, col 57 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'FindTypes[K]' at line 3941, col 58 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'FindTypes[K]' at line 3961, col 51 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'AllLookAtTypes[T]' at line 4064, col 61 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'FindTypes[K]' at line 4459, col 44 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'AllLookAtTypes[T]' at line 4531, col 85 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'AllLookAtTypes[T]' at line 4541, col 14 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'AllLookAtTypes[T]' at line 4559, col 34 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'AllLookAtTypes[T]' at line 4577, col 33 of node_modules/@types/screeps/index.d.ts
warn: cannot resolve an indexed access type 'ConcreteStructureMap[T]' at line 5743, col 55 of node_modules/@types/screeps/index.d.ts

And the output bindings doesn't type check.

hilaolu@nixos:~/screeps-typescript-starter$ npx rescript
>>>> Start compiling
Dependency on @rescript/core
Dependency Finished
rescript: [1/5] src/screeps.ast
FAILED: src/screeps.ast

  Syntax error!
  /home/hilaolu/screeps-typescript-starter/src/screeps.res:311:57

  309 ┆ }
  310 ┆ module M_ResourceConstantSansEnergy : { type t = Exclude.t<ResourceCon
      ┆ stant.t, RESOURCE_ENERGY.t> }
  311 ┆ module TOMBSTONE_DECAY_PER_PART : { type t = | @as(5) 5 }
  312 ┆ module TERRAIN_MASK_LAVA : { type t = | @as(4) 4 }
  313 ┆ module SurvivalGameInfo : { type t = intf<[#SurvivalGameInfo]> }

  At this point, I'm looking for an uppercased name like `Belt` or `Array`


  Syntax error!
  /home/hilaolu/screeps-typescript-starter/src/screeps.res:311:56-57

  309 ┆ }
  310 ┆ module M_ResourceConstantSansEnergy : { type t = Exclude.t<ResourceCon
      ┆ stant.t, RESOURCE_ENERGY.t> }
  311 ┆ module TOMBSTONE_DECAY_PER_PART : { type t = | @as(5) 5 }
  312 ┆ module TERRAIN_MASK_LAVA : { type t = | @as(4) 4 }
  313 ┆ module SurvivalGameInfo : { type t = intf<[#SurvivalGameInfo]> }

  Did you forget a `}` here?

Most outputs are omitted.

The syntax error is a duplicate of #392, which can manually fixed by renaming the constructors (| @as(5) 5 to | @as(5) Case5). Also, I will release 2.0.0-beta.3 soon, which includes the fix for this issue.

The warnings mostly come from the limitations of ts2ocaml:

  • unsupported property name '[PWR_GENERATE_OPS]'
    • these are something called 'symbol indexers', which are generally hard to use in AltJS.
    • ts2ocaml doesn't support them at the moment, but I think there is some room for improvement. I'll open a separate issue for this.
  • unsupported TypeNode kind: MappedType/ConditionalType
    • these types are impossible to represent in OCaml, so ts2ocaml emits any for these types.
  • cannot resolve a type operator / an indexed access type
    • these types are also hard to represent in OCaml.
    • ts2ocaml tries its best to resolve it at compile time, but it is impossible in this case and ts2ocaml emits any.

Thank you for following this syntax. I am looking forward to it.