Incrementally validate the operation count and exact encoded payload size
without constructing a JSON string. Compact operation ranges are measured by
their serialized fields; their logical cell area is deliberately irrelevant.
Declaration
function validateTransactionResources (
Referenced by
Workspace packages depending on @sheetwrite/core
@sheetwrite/benchdependency
@sheetwrite/docs-startdependency
@sheetwrite/reactdependency
@sheetwrite/sveltedependency
@sheetwrite/vuedependency
@sheetwrite/xlsxdependency
Public exports naming validateTransactionResources
type DocumentOp =
| {
op: "set";
addr: CellAddress;
value: CellValue;
style?: CellStyle;
}
| { op: "setRange"; range: Range; cells: SnapshotCell[] }
| { op: "setBlock"; range: Range; block: PackedCellBlock }
| {
op: "restoreBlock";
range: Range;
encoding: "deflate-json-v1";
decodedBytes: number;
data: string;
// … 100 more lines — see the API reference
} type DocumentOp =
| {
op : "set" ;
addr : CellAddress ;
value : CellValue ;
style ?: CellStyle ;
}
| { op : "setRange" ; range : Range ; cells : SnapshotCell [] }
| { op : "setBlock" ; range : Range ; block : PackedCellBlock }
| {
op : "restoreBlock" ;
range : Range ;
encoding : "deflate-json-v1" ;
decodedBytes : number ;
data : string ;
// … 100 more lines — see the API reference
} type DocumentOp =
| {
op : "set" ;
addr : CellAddress ;
value : CellValue ;
style ?: CellStyle ;
}
| {
op : "setRange" ;
range : Range ;
cells : SnapshotCell [];
}
| {
op : "setBlock" ;
range : Range ;
block : PackedCellBlock ;
}
| {
op : "restoreBlock" ;
// … 175 more lines — see the API reference
} Exhaustive serializable operation union for workbook mutations. API reference → interface TransactionResourceLimits {
maxOperations: number;
maxEncodedBytes: number;
} interface TransactionResourceLimits {
maxOperations : number ;
maxEncodedBytes : number ;
} interface TransactionResourceLimits {
maxOperations : number ;
maxEncodedBytes : number ;
} Public ceilings shared by transaction producers, persistence, transport, and replay. Limits measure the submitted operation array itself, not the logical cell area covered by compact operations. API reference → type TransactionResourceValidationResult =
| { ok: true; operationCount: number; encodedBytes: number }
| {
ok: false;
issue: Extract<
MutationIssue,
{ kind: "resource-limit" } | { kind: "invalid-operation" }
>;
}; type TransactionResourceValidationResult =
| { ok : true ; operationCount : number ; encodedBytes : number }
| {
ok : false ;
issue : Extract <
MutationIssue ,
{ kind : "resource-limit" } | { kind : "invalid-operation" }
>;
}; type TransactionResourceValidationResult =
| {
ok : true ;
operationCount : number ;
encodedBytes : number ;
}
| {
ok : false ;
issue : Extract <
MutationIssue ,
| {
kind : "resource-limit" ;
}
| {
kind : "invalid-operation" ;
}
>;
}; Successful byte/count inspection or one structured transaction rejection. API reference →