Go with the idea @basarat has and use the class. A class exists both a type and a value.
The value can be initialized. Flow recognizes the proposed property initializer syntax, so using Flow (for types) and babel (for the proposed function support) you can declare your class as this :
// @flow export class MyType { code: number; type: number = 1; };
The stream and the types that it allows you to determine are missing at javascript runtime. This is why type declarations do not support value initializers.
source share