mobxjs / serializr

Serialize and deserialize complex object graphs to and from JSON and Javascript classes
MIT License
766 stars 52 forks source link

Constructor parameter decorators do not work in TypeScript due to invalid function type for "serializable" #159

Open adamstoffel opened 2 years ago

adamstoffel commented 2 years ago

Attempting to use the @serializable decorator on a constructor parameter fails TS typechecking. image

An additional type overload is necessary:

export function serializable(
    propSchema: PropSchema
): (target: Object, key: string, parameterIndex: number) => void;