/possible_laterjs_typings_bug

LaterJS typings appear to not work with `strictNullChecks` set to `true`. This repo is for replication purposes.

Primary LanguageTypeScript

LaterJS Typings Issue

Current LaterJS typings are not compatible with strictNullChecks on newer versions of TSC.

Steps to Replicate

  1. git clone this repo
  2. npm install
  3. Compile with node_modules/typescript/bin/tsc

This will result in numerous null check errors such as the following:

node_modules/@types/later/index.d.ts(138,9): error TS2411: Property 'Y_b' of type 'number[] | undefined' is not assignable to string index type 'number[]'.

Remedy

Several actions will make the compilation errors go away:

  1. Change strictNullChecks to false. Compilation completes.
  2. Comment out the following lines within interface Recurrence:
        /*
         * Custom Time Periods and Modifiers
         * For acces to custom time periods created as extension to the later static type
         * and modifiers created on the later modifier static type.
         */
        [ timeperiodAndModifierName: string ]: number[];
  1. Change line 145 to [timeperiodAndModifierName: string]: number[] | undefined;.
  2. Use the extends keyword for custom changes.