-
Notifications
You must be signed in to change notification settings - Fork 4
Common Issues with dts2as
This error usually indicates that dts2as
has encountered some TypeScript syntax that it does not recognize. Please report a bug on Github. Be sure to include a link to download the d.ts file that you passed to dts2as
, along with the command line arguments that you specified.
As a workaround, if you are familiar with TypeScript, you may try modifying the d.ts file to use slightly different syntax. TypeScript is very flexible, and there is often more than one way to expose a JavaScript API. The generated ActionScript usually changes when you use different TypeScript syntax, so it might be possible to bypass the error.
You might also try using the --exclude
argument to omit a specific type, if it isn't a dependency of anything else:
dts2as --exclude com.example.SomeClass --outSWC out.swc file.d.ts
Certain names cannot be used as members of classes or interfaces in ActionScript. When these are encountered by dts2as
they will be skipped. For example, you may not use public
, private
, protected
, or internal
as member names:
public var private:String; //error!
Similarly, you cannot start a member name with a number:
public var 400:String; //error!
To access these properties in ActionScript, use brackets for dynamic access, like this:
var value1:Object = object["private"];
var value2:Object = object["400"];