@@ -428,13 +428,8 @@ export namespace System_TableSchema {
428
428
type Scope = ScopedSchemaName < TInputScope , typeof tableSchemaFactorySubScope > ;
429
429
430
430
type CellValueType = TreeNodeFromImplicitAllowedTypes < TCellSchema > ;
431
- type CellInsertableType = InsertableTreeNodeFromImplicitAllowedTypes < TCellSchema > ;
432
-
433
431
type ColumnValueType = TreeNodeFromImplicitAllowedTypes < TColumnSchema > ;
434
- type ColumnInsertableType = InsertableTreeNodeFromImplicitAllowedTypes < TColumnSchema > ;
435
-
436
432
type RowValueType = TreeNodeFromImplicitAllowedTypes < TRowSchema > ;
437
- type RowInsertableType = InsertableTreeNodeFromImplicitAllowedTypes < TRowSchema > ;
438
433
439
434
/**
440
435
* {@link Table } fields.
@@ -488,7 +483,7 @@ export namespace System_TableSchema {
488
483
public insertColumn ( {
489
484
column,
490
485
index,
491
- } : TableSchema . InsertColumnParameters < ColumnInsertableType > ) : ColumnValueType {
486
+ } : TableSchema . InsertColumnParameters < TColumnSchema > ) : ColumnValueType {
492
487
if ( index === undefined ) {
493
488
// TypeScript is unable to narrow the types correctly here, hence the cast.
494
489
// See: https://github.com/microsoft/TypeScript/issues/52144
@@ -508,7 +503,7 @@ export namespace System_TableSchema {
508
503
public insertRows ( {
509
504
index,
510
505
rows,
511
- } : TableSchema . InsertRowsParameters < RowInsertableType > ) : RowValueType [ ] {
506
+ } : TableSchema . InsertRowsParameters < TRowSchema > ) : RowValueType [ ] {
512
507
if ( index === undefined ) {
513
508
// TypeScript is unable to narrow the types correctly here, hence the cast.
514
509
// See: https://github.com/microsoft/TypeScript/issues/52144
@@ -525,7 +520,7 @@ export namespace System_TableSchema {
525
520
return rows as unknown as RowValueType [ ] ;
526
521
}
527
522
528
- public setCell ( { key, cell } : TableSchema . SetCellParameters < CellInsertableType > ) : void {
523
+ public setCell ( { key, cell } : TableSchema . SetCellParameters < TCellSchema > ) : void {
529
524
const { columnId, rowId } = key ;
530
525
const row = this . getRow ( rowId ) ;
531
526
if ( row !== undefined ) {
@@ -708,7 +703,7 @@ export namespace TableSchema {
708
703
* @sealed @internal
709
704
*/
710
705
export interface IRow <
711
- TCell extends ImplicitAllowedTypes ,
706
+ TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes ,
712
707
TProps extends ImplicitAnnotatedFieldSchema = ImplicitAnnotatedFieldSchema ,
713
708
> {
714
709
/**
@@ -835,7 +830,9 @@ export namespace TableSchema {
835
830
* {@link TableSchema.ITable.insertColumn } parameters.
836
831
* @internal
837
832
*/
838
- export interface InsertColumnParameters < TInsertableColumn > {
833
+ export interface InsertColumnParameters <
834
+ TColumn extends ImplicitAllowedTypes = ImplicitAllowedTypes ,
835
+ > {
839
836
/**
840
837
* The index at which to insert the new column.
841
838
* @remarks If not provided, the column will be appended to the end of the table.
@@ -845,14 +842,16 @@ export namespace TableSchema {
845
842
/**
846
843
* The column to insert.
847
844
*/
848
- readonly column : TInsertableColumn ;
845
+ readonly column : InsertableTreeNodeFromImplicitAllowedTypes < TColumn > ;
849
846
}
850
847
851
848
/**
852
849
* {@link TableSchema.ITable.insertRows } parameters.
853
850
* @internal
854
851
*/
855
- export interface InsertRowsParameters < TInsertableRow > {
852
+ export interface InsertRowsParameters <
853
+ TRow extends ImplicitAllowedTypes = ImplicitAllowedTypes ,
854
+ > {
856
855
/**
857
856
* The index at which to insert the new rows.
858
857
* @remarks If not provided, the rows will be appended to the end of the table.
@@ -862,14 +861,16 @@ export namespace TableSchema {
862
861
/**
863
862
* The rows to insert.
864
863
*/
865
- readonly rows : TInsertableRow [ ] ;
864
+ readonly rows : InsertableTreeNodeFromImplicitAllowedTypes < TRow > [ ] ;
866
865
}
867
866
868
867
/**
869
868
* {@link TableSchema.ITable.setCell } parameters.
870
869
* @internal
871
870
*/
872
- export interface SetCellParameters < TInsertableCell > {
871
+ export interface SetCellParameters <
872
+ TColumn extends ImplicitAllowedTypes = ImplicitAllowedTypes ,
873
+ > {
873
874
/**
874
875
* The key to uniquely identify a cell in a table.
875
876
*/
@@ -878,17 +879,17 @@ export namespace TableSchema {
878
879
/**
879
880
* The cell to set.
880
881
*/
881
- readonly cell : TInsertableCell ;
882
+ readonly cell : InsertableTreeNodeFromImplicitAllowedTypes < TColumn > ;
882
883
}
883
884
884
885
/**
885
886
* A table.
886
887
* @sealed @internal
887
888
*/
888
889
export interface ITable <
889
- TCell extends ImplicitAllowedTypes ,
890
- TColumn extends ImplicitAllowedTypes ,
891
- TRow extends ImplicitAllowedTypes ,
890
+ TCell extends ImplicitAllowedTypes = ImplicitAllowedTypes ,
891
+ TColumn extends ImplicitAllowedTypes = ImplicitAllowedTypes ,
892
+ TRow extends ImplicitAllowedTypes = ImplicitAllowedTypes ,
892
893
> {
893
894
/**
894
895
* The table's columns.
@@ -922,25 +923,21 @@ export namespace TableSchema {
922
923
* @throws Throws an error if the column is already in the tree, or if the specified index is out of range.
923
924
*/
924
925
insertColumn (
925
- params : InsertColumnParameters < InsertableTreeNodeFromImplicitAllowedTypes < TColumn > > ,
926
+ params : InsertColumnParameters < TColumn > ,
926
927
) : TreeNodeFromImplicitAllowedTypes < TColumn > ;
927
928
928
929
/**
929
930
* Inserts 0 or more rows into the table.
930
931
* @throws Throws an error if any of the rows are already in the tree, or if the specified index is out of range.
931
932
*/
932
- insertRows (
933
- params : InsertRowsParameters < InsertableTreeNodeFromImplicitAllowedTypes < TRow > > ,
934
- ) : TreeNodeFromImplicitAllowedTypes < TRow > [ ] ;
933
+ insertRows ( params : InsertRowsParameters < TRow > ) : TreeNodeFromImplicitAllowedTypes < TRow > [ ] ;
935
934
936
935
/**
937
936
* Sets the cell at the specified location in the table.
938
937
* @remarks To remove a cell, call {@link TableSchema.ITable.removeCell} instead.
939
938
* @privateRemarks TODO: add overload that takes column/row nodes?
940
939
*/
941
- setCell (
942
- params : SetCellParameters < InsertableTreeNodeFromImplicitAllowedTypes < TCell > > ,
943
- ) : void ;
940
+ setCell ( params : SetCellParameters < TCell > ) : void ;
944
941
945
942
/**
946
943
* Removes the specified column from the table.
0 commit comments