Closed
Description
In the dom library there are several types which are sum (union) types.
IDBKey and SerializedScriptValue are two examples - both include numbers, strings and JavaScript arrays (Lists) among other things, and neither includes functions or arbitrary user defined types.
We are forced to use Dynamic for these types.
If typedef could do a simple renaming we could generate more readable interfaces.
e.g.
interface IDBFactory {
int cmp(Dynamic first, Dynamic second);
}
could become
/** Documentation about IDBKey in one place. */
typedef IDBKey = Dynamic;
interface IDBFactory {
int cmp(IDBKey first, IDBKey second); // Tools can navigate to the definition.
}