UNPKG

@nfdi4plants/swate-components

Version:

Customizable React components for ontology annotation, based on Swate and the ARC.

154 lines 10.6 kB
import { CompositeCell_$union } from './CompositeCell.fs.js'; import { int32 } from '@fable-org/fable-library-js/Int32.js'; import { Option } from '@fable-org/fable-library-js/Option.js'; import { CompositeHeader_$union } from './CompositeHeader.fs.js'; import { IEnumerator, IMap } from '@fable-org/fable-library-js/Util.js'; import { Union } from '@fable-org/fable-library-js/Types.js'; import { TypeInfo } from '@fable-org/fable-library-js/Reflection.js'; import { FSharpList } from '@fable-org/fable-library-js/List.js'; import { CompositeColumn } from './CompositeColumn.fs.js'; /** * Get an empty cell fitting for related column header. * * `columCellOption` is used to decide between `CompositeCell.Term` or `CompositeCell.Unitized`. `columCellOption` can be any other cell in the same column, preferably the first one. */ export declare function getEmptyCellForHeader(header: CompositeHeader_$union, columCellOption: Option<CompositeCell_$union>): CompositeCell_$union; export declare function ensureCellHashInValueMap(value: CompositeCell_$union, valueMap: IMap<int32, CompositeCell_$union>): int32; export type ColumnValueRefs_$union = ColumnValueRefs<0> | ColumnValueRefs<1>; export type ColumnValueRefs_$cases = { 0: ["Constant", [int32]]; 1: ["Sparse", [IMap<int32, int32>]]; }; export declare function ColumnValueRefs_Constant(Item: int32): ColumnValueRefs<0>; export declare function ColumnValueRefs_Sparse(Item: IMap<int32, int32>): ColumnValueRefs<1>; export declare class ColumnValueRefs<Tag extends keyof ColumnValueRefs_$cases> extends Union<Tag, ColumnValueRefs_$cases[Tag][0]> { readonly tag: Tag; readonly fields: ColumnValueRefs_$cases[Tag][1]; constructor(tag: Tag, fields: ColumnValueRefs_$cases[Tag][1]); cases(): string[]; } export declare function ColumnValueRefs_$reflection(): TypeInfo; export declare function ColumnValueRefs__get_RowCount(this$: ColumnValueRefs_$union): Option<[int32, int32]>; export declare function ColumnValueRefs__Copy(this$: ColumnValueRefs_$union): ColumnValueRefs_$union; export declare function ColumnValueRefs__ToSparse_Z524259A4(this$: ColumnValueRefs_$union, rowCount: int32): ColumnValueRefs_$union; export declare function ColumnValueRefs__AsSparse(this$: ColumnValueRefs_$union): IMap<int32, int32>; export declare function ColumnValueRefs__AsConstant(this$: ColumnValueRefs_$union): int32; export declare function ColumnValueRefs_fromCellColumn_14896151<$a extends Iterable<CompositeCell_$union>>(column: $a, previousRowCount: int32, valueMap: IMap<int32, CompositeCell_$union>): ColumnValueRefs_$union; export declare function ColumnValueRefs__ToCellColumn_Z2609C9DD(this$: ColumnValueRefs_$union, valueMap: IMap<int32, CompositeCell_$union>, rowCount: int32, header: CompositeHeader_$union): CompositeCell_$union[]; export declare class ArcTableValues implements Iterable<[[int32, int32], CompositeCell_$union]> { _columns: IMap<int32, ColumnValueRefs_$union>; _valueMap: IMap<int32, CompositeCell_$union>; _rowCount: int32; constructor(cols: IMap<int32, ColumnValueRefs_$union>, valueMap: IMap<int32, CompositeCell_$union>, rowCount: int32); get Columns(): IMap<int32, ColumnValueRefs_$union>; set Columns(columns: IMap<int32, ColumnValueRefs_$union>); get ColumnCount(): int32; get ValueMap(): IMap<int32, CompositeCell_$union>; set ValueMap(valueMap: IMap<int32, CompositeCell_$union>); get RowCount(): int32; set RowCount(rowCount: int32); static fromCellColumns(columns: CompositeCell_$union[][]): ArcTableValues; static fromRefColumns<$a extends Iterable<ColumnValueRefs_$union>>(columns: $a, valueMap: IMap<int32, CompositeCell_$union>, rowCount: int32): ArcTableValues; static init(): ArcTableValues; ToCellColumns(headers: CompositeHeader_$union[]): CompositeCell_$union[][]; RescanValueMap(): void; Copy(): ArcTableValues; GetHashCode(): int32; Equals(other: any): boolean; Item(crIndices: [int32, int32]): CompositeCell_$union; GetEnumerator(): IEnumerator<[[int32, int32], CompositeCell_$union]>; [Symbol.iterator](): Iterator<[[int32, int32], CompositeCell_$union]>; "System.Collections.IEnumerable.GetEnumerator"(): IEnumerator<any>; } export declare function ArcTableValues_$reflection(): TypeInfo; export declare function ArcTableValues_$ctor_39436F7C(cols: IMap<int32, ColumnValueRefs_$union>, valueMap: IMap<int32, CompositeCell_$union>, rowCount: int32): ArcTableValues; export declare function $007CIsUniqueExistingHeader$007C_$007C(existingHeaders: Iterable<CompositeHeader_$union>, input: CompositeHeader_$union): Option<int32>; /** * Returns the column index of the duplicate unique column in `existingHeaders`. */ export declare function tryFindDuplicateUnique(newHeader: CompositeHeader_$union, existingHeaders: Iterable<CompositeHeader_$union>): Option<int32>; /** * Returns the column index of the duplicate unique column in `existingHeaders`. */ export declare function tryFindDuplicateUniqueInArray(existingHeaders: Iterable<CompositeHeader_$union>): FSharpList<{ HeaderType: CompositeHeader_$union; Index1: int32; Index2: int32; }>; /** * Checks if given column index is valid for given number of columns. * * if `allowAppend` = true => `0 < index <= columnCount` * * if `allowAppend` = false => `0 < index < columnCount` */ export declare function SanityChecks_validateColumnIndex(index: int32, columnCount: int32, allowAppend: boolean): void; /** * Checks if given index is valid for given number of rows. * * if `allowAppend` = true => `0 < index <= rowCount` * * if `allowAppend` = false => `0 < index < rowCount` */ export declare function SanityChecks_validateRowIndex(index: int32, rowCount: int32, allowAppend: boolean): void; export declare function SanityChecks_validateColumn(column: CompositeColumn): void; export declare function SanityChecks_validateCellColumns(headers: CompositeHeader_$union[], columns: CompositeCell_$union[][], raiseException: boolean): boolean; export declare function SanityChecks_validateArcTableValues(headers: CompositeHeader_$union[], values: ArcTableValues, raiseException: boolean): boolean; export declare function Unchecked_tryGetCellAt(column: int32, row: int32, values: ArcTableValues): Option<CompositeCell_$union>; export declare function Unchecked_getCellWithDefault(column: int32, row: int32, headers: CompositeHeader_$union[], values: ArcTableValues): CompositeCell_$union; /** * Add or update a cell in the dictionary. */ export declare function Unchecked_setCellAt(columnIndex: int32, rowIndex: int32, c: CompositeCell_$union, values: ArcTableValues): void; export declare function Unchecked_removeCellAt(columnIndex: int32, rowIndex: int32, values: ArcTableValues): void; export declare function Unchecked_moveCellTo(fromCol: int32, fromRow: int32, toCol: int32, toRow: int32, values: ArcTableValues): void; export declare function Unchecked_removeHeader(index: int32, headers: CompositeHeader_$union[]): void; /** * Remove cells of one Column, change index of cells with higher index to index - 1 */ export declare function Unchecked_removeColumnCells(colIndex: int32, values: ArcTableValues): void; /** * Remove cells of one Column, change index of cells with higher index to index - 1 */ export declare function Unchecked_removeColumnCells_withIndexChange(colIndex: int32, columnCount: int32, values: ArcTableValues): void; export declare function Unchecked_removeRowCells(rowIndex: int32, columnCount: int32, values: ArcTableValues): void; /** * Remove cells of one Row, change index of cells with higher index to index - 1 */ export declare function Unchecked_removeRowCells_withIndexChange(rowIndex: int32, values: ArcTableValues): void; /** * Remove cells of one Row, change index of cells with higher index to index - 1 */ export declare function Unchecked_removeRowRange_withIndexChange(rowStartIndex: int32, rowEndIndex: int32, values: ArcTableValues): void; export declare function Unchecked_moveColumnCellsTo(fromCol: int32, toCol: int32, values: ArcTableValues): void; /** * Add a new column to the ArcTableValues. */ export declare function Unchecked_addRefColumn(newHeader: CompositeHeader_$union, newCol: ColumnValueRefs_$union, rowCount: int32, index: int32, forceReplace: boolean, onlyHeaders: boolean, headers: CompositeHeader_$union[], values: ArcTableValues): void; export declare function Unchecked_addColumn<$a extends Iterable<CompositeCell_$union>>(newHeader: CompositeHeader_$union, newCells: $a, index: int32, forceReplace: boolean, onlyHeaders: boolean, headers: CompositeHeader_$union[], values: ArcTableValues): void; export declare function Unchecked_addColumnFill(newHeader: CompositeHeader_$union, newCell: CompositeCell_$union, index: int32, forceReplace: boolean, onlyHeaders: boolean, headers: CompositeHeader_$union[], values: ArcTableValues): void; export declare function Unchecked_fillMissingCells(headers: CompositeHeader_$union[], values: ArcTableValues): void; export declare function Unchecked_addEmptyRow(index: int32, values: ArcTableValues): void; export declare function Unchecked_addRow(index: int32, newCells: CompositeCell_$union[], headers: CompositeHeader_$union[], values: ArcTableValues): void; export declare function Unchecked_addRows(index: int32, newRows: CompositeCell_$union[][], headers: CompositeHeader_$union[], values: ArcTableValues): void; /** * Returns true, if two composite headers share the same main header string */ export declare function Unchecked_compositeHeaderMainColumnEqual(ch1: CompositeHeader_$union, ch2: CompositeHeader_$union): boolean; /** * Moves a column from one position to another * * This function moves the column from `fromCol` to `toCol` and shifts all columns in between accordingly */ export declare function Unchecked_moveColumnTo(fromCol: int32, toCol: int32, headers: CompositeHeader_$union[], values: ArcTableValues): void; /** * From a list of rows consisting of headers and values, creates a list of combined headers and the values as a sparse matrix * * The values cant be directly taken as they are, as there is no guarantee that the headers are aligned * * This function aligns the headers and values by the main header string * * If keepOrder is true, the order of values per row is kept intact, otherwise the values are allowed to be reordered */ export declare function Unchecked_alignByHeaders(keepOrder: boolean, rows: FSharpList<FSharpList<[CompositeHeader_$union, CompositeCell_$union]>>): [CompositeHeader_$union[], ArcTableValues]; //# sourceMappingURL=ArcTableAux.fs.d.ts.map