Simple framework adapter props for columns and default row objects.
- Package
@sheetwrite/svelte- Source
packages/svelte/src/props.ts#L68
Declaration
export type SheetwriteProps< Row extends Record<string, CellScalartype CellScalar = string | number | boolean | null;type CellScalar = string | number | boolean | null;type CellScalar =
| string
| number
| boolean
| null;A scalar that can be displayed directly.API reference →>, Id extends RowBridgeIdtype RowBridgeId = string | number;type RowBridgeId = string | number;type RowBridgeId =
string | number;A stable host identity for one data-space row.API reference → = RowBridgeIdtype RowBridgeId = string | number;type RowBridgeId = string | number;type RowBridgeId =
string | number;A stable host identity for one data-space row.API reference →,> = Omit< SheetwriteGridPropsinterface SheetwriteGridProps<
Id extends RowBridgeId = RowBridgeId,
> {
rowBridge?: RowBridge<Id>;
onRowDelta?: RowBridgeHandler<Id>;
onMutationRejected?: GridAdapterEventHandlers["onMutationRejected"];
onRendererFallback?: GridAdapterEventHandlers["onRendererFallback"];
onDatasourceError?: GridAdapterEventHandlers["onDatasourceError"];
onExportError?: GridAdapterEventHandlers["onExportError"];
onReady?: GridAdapterEventHandlers["onReady"];
className?: string;
style?: CSSProperties;
fallback?: ReactNode;
height?: number | string;
fill?: true;
// … 33 more lines — see the API reference
}interface SheetwriteGridProps<
Id extends RowBridgeId = RowBridgeId,
> {
rowBridge?: RowBridge<Id>;
onRowDelta?: RowBridgeHandler<Id>;
onMutationRejected?: GridAdapterEventHandlers["onMutationRejected"];
onRendererFallback?: GridAdapterEventHandlers["onRendererFallback"];
onDatasourceError?: GridAdapterEventHandlers["onDatasourceError"];
onExportError?: GridAdapterEventHandlers["onExportError"];
onReady?: GridAdapterEventHandlers["onReady"];
className?: string;
style?: CSSProperties;
fallback?: ReactNode;
height?: number | string;
fill?: true;
// … 33 more lines — see the API reference
}interface SheetwriteGridProps<
Id extends RowBridgeId =
RowBridgeId,
> {
rowBridge?: RowBridge<Id>;
onRowDelta?: RowBridgeHandler<Id>;
onMutationRejected?: GridAdapterEventHandlers["onMutationRejected"];
onRendererFallback?: GridAdapterEventHandlers["onRendererFallback"];
onDatasourceError?: GridAdapterEventHandlers["onDatasourceError"];
onExportError?: GridAdapterEventHandlers["onExportError"];
onReady?: GridAdapterEventHandlers["onReady"];
className?: string;
style?: CSSProperties;
fallback?: ReactNode;
height?: number | string;
fill?: true;
workbook: Workbook;
data?: ColumnarData;
datasource?: DataSource;
// … 58 more lines — see the API reference
}Advanced framework adapter props for workbook data or datasource ownership.API reference →<Id>, "workbook" | "data" | "datasource" | "height" | "fill" | "rowBridge"> & GridSizePropstype GridSizeProps =
| { height: number | string; fill?: never }
| { fill: true; height?: never };type GridSizeProps =
| { height: number | string; fill?: never }
| { fill: true; height?: never };type GridSizeProps =
| {
height: number | string;
fill?: never;
}
| {
fill: true;
height?: never;
};Explicit width and height accepted by framework adapters.API reference → & { columns: readonly SimpleColumninterface SimpleColumn<Row extends Record<string, CellScalar>> {
key: keyof Row & string;
title: string;
width?: number;
type?: CellFormat;
numberFormat?: string;
headerStyle?: CellStyle;
editor?: string;
cellStyle?: CellStyle;
visible?: boolean;
}interface SimpleColumn<Row extends Record<string, CellScalar>> {
key: keyof Row & string;
title: string;
width?: number;
type?: CellFormat;
numberFormat?: string;
headerStyle?: CellStyle;
editor?: string;
cellStyle?: CellStyle;
visible?: boolean;
}interface SimpleColumn<
Row extends Record<
string,
CellScalar
>,
> {
key: keyof Row & string;
title: string;
width?: number;
type?: CellFormat;
numberFormat?: string;
headerStyle?: CellStyle;
editor?: string;
cellStyle?: CellStyle;
visible?: boolean;
}Column definition accepted by the adapters’ simple row-object API.API reference →<Row>[]; defaultRows: readonly Row[]; sheetName?: string; getRowId?: (row: Row, index: number) => Id; createRowId?: (context: RowBridgeInsertContextinterface RowBridgeInsertContext {
readonly sheet: SheetId;
readonly at: number;
readonly offset: number;
readonly transactionId: string;
}interface RowBridgeInsertContext {
readonly sheet: SheetId;
readonly at: number;
readonly offset: number;
readonly transactionId: string;
}interface RowBridgeInsertContext {
readonly sheet: SheetId;
readonly at: number;
readonly offset: number;
readonly transactionId: string;
}Context supplied when a canonical row insertion needs a host identity.API reference →) => Id; };