C: \ DEV \ OpenCMS \ Site \ Frontend \ Scripts \ LIES \ sinnovations> TSC sinnovations.listv iewbase.ts --module amd C: /dev/OpenCMS/Website/Frontend/Scripts/libs/sinnovations/sinnovations.listviewb ase. ts (11,5): error TS2025: columns of a public property of an exported class have or use the private type "KnockoutObservableArray".
/// <reference path="../../typings/knockout/knockout.d.ts" /> import ko = require('knockout'); interface Column { label: string; } var _templateBase = '/Frontend/Templates/ListView/'; class ListViewBase<T> { columns: KnockoutObservableArray<Column> = ko.observableArray([]); rows: KnockoutObservableArray<T> = ko.observableArray([]); constructor(public templateHeaderRow = _templateBase+'DefaultTableHeaderTemplate', public templateBodyRow = _templateBase + 'DefaultTableRowTemplate') { } addColumn(column: Column) { this.columns.push(column); } addRow(row: T) { this.rows.push(row); } static configure(templateBase) { _templateBase = templateBase; } } export = ListViewBase;
I understand the error, but I donβt know how else to get the effect above. Does anyone have a solution for exporting some interfaces by class, which is exported as export = class?
typescript
Poul K. sΓΈrensen
source share