AnyhowStep / tsql

A SQL query-builder/ORM
37 stars 3 forks source link

Explicitly add type annotations to exported constants in expr-library #283

Open AnyhowStep opened 4 years ago

AnyhowStep commented 4 years ago

Instead of,

export const concat = makeOperator1ToN<OperatorType.CONCAT, string, string>(
    OperatorType.CONCAT,
    tm.string(),
    TypeHint.STRING
);

Use this,

export const concat : Operator1ToN<string, string> = makeOperator1ToN<OperatorType.CONCAT, string, string>(
    OperatorType.CONCAT,
    tm.string(),
    TypeHint.STRING
);

We cannot rely on type inference. We need to explicitly add type annotations or AMD declaration emit will break.

Keep an eye on this, https://github.com/microsoft/TypeScript/issues/37267