bryntum / support

An issues-only repository for the Bryntum project management component suite which includes powerful Grid, Scheduler, Calendar, Kanban Task Board and Gantt chart components all built in pure JS / CSS / TypeScript
https://www.bryntum.com
53 stars 6 forks source link

[Typescript] Engine classes are not available in types definitions #4177

Open SergeyMaltsev opened 2 years ago

SergeyMaltsev commented 2 years ago

Engine classes need documentation to be published in docs and available in typings.

SchedulerProProjectMixin
ConstrainedEarlyEventMixin
HasDateConstraintMixin
HasPercentDoneMixin

and others.

This code could not be compiled with React Typescript app

import { HasPercentDoneMixin } from '@bryntum/gantt/gantt.umd.js';

class MyProject extends HasPercentDoneMixin.derive(ProjectModel) {}

Error is shown

Module '"@bryntum/gantt/gantt.umd.js"' has no exported member 'HasPercentDoneMixin'.  TS2305

     8 | import './App.scss';
     9 |
  > 10 | import { HasPercentDoneMixin } from '@bryntum/gantt/gantt.umd.js';
       |          ^
    11 |
    12 | class MyProject extends HasPercentDoneMixin.derive(ProjectModel) {}
    13 |

Temporarily workaround

// @ts-ignore
import { HasPercentDoneMixin } from '@bryntum/gantt/gantt.umd.js';

class MyProject extends HasPercentDoneMixin.derive(ProjectModel) {}

Related issue https://github.com/bryntum/bryntum-suite/issues/1725

greglecki commented 2 years ago

The workaround doesn't work for me, it gives me an error: Cannot read properties of undefined (reading 'derive')

SergeyMaltsev commented 2 years ago

@greglecki which version did you use for checking?