@candidstartup/infinisheet-types 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +22 -5
- package/dist/index.js +20 -19
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -187,8 +187,15 @@ interface StorageError extends InfinisheetError {
|
|
|
187
187
|
/** Convenience method that creates a {@link StorageError} */
|
|
188
188
|
declare function storageError(message: string, statusCode?: number): StorageError;
|
|
189
189
|
|
|
190
|
+
/** Identifier for a blob of data in a blob store */
|
|
190
191
|
type BlobId = string;
|
|
192
|
+
/** Identifier for a workflow triggered writing to {@link LogMetadata.pending} */
|
|
191
193
|
type WorkflowId = string;
|
|
194
|
+
/**
|
|
195
|
+
* Identifier for an entry in an {@link EventLog}.
|
|
196
|
+
*
|
|
197
|
+
* Incrementing integer.
|
|
198
|
+
*/
|
|
192
199
|
type SequenceId = bigint;
|
|
193
200
|
/**
|
|
194
201
|
* Metadata stored in an {@link EventLog} entry
|
|
@@ -324,7 +331,6 @@ interface ItemOffsetMapping {
|
|
|
324
331
|
* Implementation of {@link ItemOffsetMapping} for use when all items have a fixed size
|
|
325
332
|
*/
|
|
326
333
|
declare class FixedSizeItemOffsetMapping implements ItemOffsetMapping {
|
|
327
|
-
#private;
|
|
328
334
|
/**
|
|
329
335
|
* @param itemSize - Size to use for all items
|
|
330
336
|
*/
|
|
@@ -332,13 +338,13 @@ declare class FixedSizeItemOffsetMapping implements ItemOffsetMapping {
|
|
|
332
338
|
itemSize(_itemIndex: number): number;
|
|
333
339
|
itemOffset(itemIndex: number): number;
|
|
334
340
|
offsetToItem(offset: number): [itemIndex: number, startOffset: number];
|
|
341
|
+
private fixedItemSize;
|
|
335
342
|
}
|
|
336
343
|
|
|
337
344
|
/**
|
|
338
345
|
* Implementation of {@link ItemOffsetMapping} for use when initial items have variable sizes.
|
|
339
346
|
*/
|
|
340
347
|
declare class VariableSizeItemOffsetMapping implements ItemOffsetMapping {
|
|
341
|
-
#private;
|
|
342
348
|
/**
|
|
343
349
|
* @param defaultItemSize - Size to use for all other items
|
|
344
350
|
* @param sizes - Array of sizes to use for the initial items, one size per item
|
|
@@ -347,6 +353,8 @@ declare class VariableSizeItemOffsetMapping implements ItemOffsetMapping {
|
|
|
347
353
|
itemSize(itemIndex: number): number;
|
|
348
354
|
itemOffset(itemIndex: number): number;
|
|
349
355
|
offsetToItem(offset: number): [itemIndex: number, startOffset: number];
|
|
356
|
+
private defaultItemSize;
|
|
357
|
+
private sizes;
|
|
350
358
|
}
|
|
351
359
|
|
|
352
360
|
/** Possible spreadsheet error values
|
|
@@ -392,6 +400,13 @@ interface SpreadsheetData<Snapshot> {
|
|
|
392
400
|
subscribe(onDataChange: () => void): () => void;
|
|
393
401
|
/** Return a snapshot to use when accessing values at a consistent point in time */
|
|
394
402
|
getSnapshot(): Snapshot;
|
|
403
|
+
/**
|
|
404
|
+
* Return load status at the time the snapshot was created
|
|
405
|
+
*
|
|
406
|
+
* On Success returns true if load has completed, false if still in progress
|
|
407
|
+
* On Err returns most recent error reported by the storage system
|
|
408
|
+
*/
|
|
409
|
+
getLoadStatus(snapshot: Snapshot): Result<boolean, StorageError>;
|
|
395
410
|
/** Number of rows in the spreadsheet */
|
|
396
411
|
getRowCount(snapshot: Snapshot): number;
|
|
397
412
|
/** {@link ItemOffsetMapping} which describes sizes and offsets to start of rows */
|
|
@@ -408,7 +423,7 @@ interface SpreadsheetData<Snapshot> {
|
|
|
408
423
|
*
|
|
409
424
|
* @returns `Ok` if the change was successfully applied
|
|
410
425
|
*/
|
|
411
|
-
setCellValueAndFormat(row: number, column: number, value: CellValue, format: string | undefined):
|
|
426
|
+
setCellValueAndFormat(row: number, column: number, value: CellValue, format: string | undefined): ResultAsync<void, SpreadsheetDataError>;
|
|
412
427
|
/** Check whether value and format are valid to set for specified cell
|
|
413
428
|
*
|
|
414
429
|
* @returns `Ok` if the value and format are valid
|
|
@@ -418,13 +433,14 @@ interface SpreadsheetData<Snapshot> {
|
|
|
418
433
|
declare class EmptySpreadsheetData implements SpreadsheetData<number> {
|
|
419
434
|
subscribe(_onDataChange: () => void): () => void;
|
|
420
435
|
getSnapshot(): number;
|
|
436
|
+
getLoadStatus(_snapshot: number): Result<boolean, StorageError>;
|
|
421
437
|
getRowCount(_snapshot: number): number;
|
|
422
438
|
getRowItemOffsetMapping(_snapshot: number): ItemOffsetMapping;
|
|
423
439
|
getColumnCount(_snapshot: number): number;
|
|
424
440
|
getColumnItemOffsetMapping(_snapshot: number): ItemOffsetMapping;
|
|
425
441
|
getCellValue(_snapshot: number, _row: number, _column: number): CellValue;
|
|
426
442
|
getCellFormat(_snapshot: number, _row: number, _column: number): string | undefined;
|
|
427
|
-
setCellValueAndFormat(_row: number, _column: number, _value: CellValue, _format: string | undefined):
|
|
443
|
+
setCellValueAndFormat(_row: number, _column: number, _value: CellValue, _format: string | undefined): ResultAsync<void, SpreadsheetDataError>;
|
|
428
444
|
isValidCellValueAndFormat(_row: number, _column: number, _value: CellValue, _format: string | undefined): Result<void, ValidationError>;
|
|
429
445
|
}
|
|
430
446
|
|
|
@@ -445,4 +461,5 @@ declare function rowColRefToCoords(ref: RowColRef): RowColCoords;
|
|
|
445
461
|
/** Converts {@link RowColCoords} to a {@link RowColRef} */
|
|
446
462
|
declare function rowColCoordsToRef(row: number | undefined, col: number | undefined): RowColRef;
|
|
447
463
|
|
|
448
|
-
export {
|
|
464
|
+
export { EmptySpreadsheetData, FixedSizeItemOffsetMapping, ResultAsync, VariableSizeItemOffsetMapping, colRefToIndex, conflictError, err, errAsync, indexToColRef, infinisheetRangeError, ok, okAsync, rowColCoordsToRef, rowColRefToCoords, splitRowColRef, storageError, validationError };
|
|
465
|
+
export type { AddEntryError, BlobId, CellError, CellErrorValue, CellValue, ColRef, ConflictError, Err, EventLog, InfinisheetError, InfinisheetRangeError, ItemOffsetMapping, LogEntry, LogMetadata, MetadataError, Ok, QueryError, QueryValue, Result, RowColCoords, RowColRef, SequenceId, SpreadsheetData, SpreadsheetDataError, StorageError, TruncateError, ValidationError, WorkflowId };
|
package/dist/index.js
CHANGED
|
@@ -56,20 +56,20 @@ class FixedSizeItemOffsetMapping {
|
|
|
56
56
|
* @param itemSize - Size to use for all items
|
|
57
57
|
*/
|
|
58
58
|
constructor(itemSize) {
|
|
59
|
-
this
|
|
59
|
+
this.fixedItemSize = itemSize;
|
|
60
60
|
}
|
|
61
61
|
itemSize(_itemIndex) {
|
|
62
|
-
return this
|
|
62
|
+
return this.fixedItemSize;
|
|
63
63
|
}
|
|
64
64
|
itemOffset(itemIndex) {
|
|
65
|
-
return itemIndex * this
|
|
65
|
+
return itemIndex * this.fixedItemSize;
|
|
66
66
|
}
|
|
67
67
|
offsetToItem(offset) {
|
|
68
|
-
const itemIndex = Math.floor(offset / this
|
|
69
|
-
const startOffset = itemIndex * this
|
|
68
|
+
const itemIndex = Math.floor(offset / this.fixedItemSize);
|
|
69
|
+
const startOffset = itemIndex * this.fixedItemSize;
|
|
70
70
|
return [itemIndex, startOffset];
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
fixedItemSize;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
/**
|
|
@@ -81,42 +81,42 @@ class VariableSizeItemOffsetMapping {
|
|
|
81
81
|
* @param sizes - Array of sizes to use for the initial items, one size per item
|
|
82
82
|
*/
|
|
83
83
|
constructor(defaultItemSize, sizes) {
|
|
84
|
-
this
|
|
85
|
-
this
|
|
84
|
+
this.defaultItemSize = defaultItemSize;
|
|
85
|
+
this.sizes = sizes;
|
|
86
86
|
}
|
|
87
87
|
itemSize(itemIndex) {
|
|
88
|
-
return (itemIndex < this
|
|
88
|
+
return (itemIndex < this.sizes.length) ? this.sizes[itemIndex] : this.defaultItemSize;
|
|
89
89
|
}
|
|
90
90
|
itemOffset(itemIndex) {
|
|
91
91
|
let offset = 0;
|
|
92
|
-
let length = this
|
|
92
|
+
let length = this.sizes.length;
|
|
93
93
|
if (itemIndex > length) {
|
|
94
94
|
const numDefaultSize = itemIndex - length;
|
|
95
|
-
offset = numDefaultSize * this
|
|
95
|
+
offset = numDefaultSize * this.defaultItemSize;
|
|
96
96
|
}
|
|
97
97
|
else {
|
|
98
98
|
length = itemIndex;
|
|
99
99
|
}
|
|
100
100
|
for (let i = 0; i < length; i++) {
|
|
101
|
-
offset += this
|
|
101
|
+
offset += this.sizes[i];
|
|
102
102
|
}
|
|
103
103
|
return offset;
|
|
104
104
|
}
|
|
105
105
|
offsetToItem(offset) {
|
|
106
106
|
let startOffset = 0;
|
|
107
|
-
for (const [i, size] of this
|
|
107
|
+
for (const [i, size] of this.sizes.entries()) {
|
|
108
108
|
if (startOffset + size > offset) {
|
|
109
109
|
return [i, startOffset];
|
|
110
110
|
}
|
|
111
111
|
startOffset += size;
|
|
112
112
|
}
|
|
113
|
-
const itemIndex = Math.floor((offset - startOffset) / this
|
|
114
|
-
startOffset += itemIndex * this
|
|
115
|
-
const length = this
|
|
113
|
+
const itemIndex = Math.floor((offset - startOffset) / this.defaultItemSize);
|
|
114
|
+
startOffset += itemIndex * this.defaultItemSize;
|
|
115
|
+
const length = this.sizes.length;
|
|
116
116
|
return [itemIndex + length, startOffset];
|
|
117
117
|
}
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
defaultItemSize;
|
|
119
|
+
sizes;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
const rowItemOffsetMapping = new FixedSizeItemOffsetMapping(30);
|
|
@@ -124,13 +124,14 @@ const columnItemOffsetMapping = new FixedSizeItemOffsetMapping(100);
|
|
|
124
124
|
class EmptySpreadsheetData {
|
|
125
125
|
subscribe(_onDataChange) { return () => { }; }
|
|
126
126
|
getSnapshot() { return 0; }
|
|
127
|
+
getLoadStatus(_snapshot) { return ok(true); }
|
|
127
128
|
getRowCount(_snapshot) { return 0; }
|
|
128
129
|
getRowItemOffsetMapping(_snapshot) { return rowItemOffsetMapping; }
|
|
129
130
|
getColumnCount(_snapshot) { return 0; }
|
|
130
131
|
getColumnItemOffsetMapping(_snapshot) { return columnItemOffsetMapping; }
|
|
131
132
|
getCellValue(_snapshot, _row, _column) { return null; }
|
|
132
133
|
getCellFormat(_snapshot, _row, _column) { return undefined; }
|
|
133
|
-
setCellValueAndFormat(_row, _column, _value, _format) { return
|
|
134
|
+
setCellValueAndFormat(_row, _column, _value, _format) { return errAsync(storageError("Not implemented", 501)); }
|
|
134
135
|
isValidCellValueAndFormat(_row, _column, _value, _format) { return ok(); }
|
|
135
136
|
}
|
|
136
137
|
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/Result.ts","../src/ResultAsync.ts","../src/Error.ts","../src/EventLog.ts","../src/FixedSizeItemOffsetMapping.ts","../src/VariableSizeItemOffsetMapping.ts","../src/SpreadsheetData.ts","../src/RowColRef.ts"],"sourcesContent":["import type { Ok as neverthrow_Ok, Err as neverthrow_Err } from \"neverthrow\";\nimport { err as neverthrow_err, ok as neverthrow_ok } from \"neverthrow\";\n\n/**\n * An `Ok` instance is the *successful* variant of the {@link Result} type, \n * representing a successful outcome from an operation which may fail.\n * \n * Implemented using [`neverthrow`](https://github.com/supermacro/neverthrow)\n * \n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n */\nexport interface Ok<T,E> extends neverthrow_Ok<T,E> {}\n\n/**\n * An `Err` instance is the failure variant of the {@link Result} type, \n * representing a failure outcome from an operation which may fail.\n * \n * Implemented using [`neverthrow`](https://github.com/supermacro/neverthrow)\n * \n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n */\nexport interface Err<T,E> extends neverthrow_Err<T,E> {}\n\n/**\n * A `Result` represents success ({@link Ok}) or failure ({@link Err}).\n * \n * Compatible with [`neverthrow`](https://github.com/supermacro/neverthrow)\n * \n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n */\nexport type Result<T,E> = Ok<T,E> | Err<T,E>;\n\n/**\n * Create an instance of {@link Ok}.\n *\n * If you need to create an instance with a specific type (as you do whenever you\n * are not constructing immediately for a function return or as an argument to a\n * function), you can use a type parameter:\n *\n * ```ts\n * const yayNumber = ok<number, string>(12);\n * ```\n *\n * Note: passing nothing will produce a `Result<void, E>`, passing `undefined` will\n * produce a `Result<undefined, E>` which is compatible with `Result<void, E>`.\n *\n * ```ts\n * const normalResult = ok<number, string>(42);\n * const explicitUndefined = ok<undefined, string>(undefined);\n * const implicitVoid = ok<void, string>();\n * ```\n *\n * In the context of an immediate function return, or an arrow function with a\n * single expression value, you do not have to specify the types, so this can be\n * quite convenient.\n *\n * ```ts\n * const arrowValidate = (data: SomeData): Result<void, string> =>\n * isValid(data) ? ok() : err('something was wrong!');\n *\n * function fnValidate(data: someData): Result<void, string> {\n * return isValid(data) ? ok() : err('something was wrong');\n * }\n * ```\n *\n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n * @param value - The value to wrap in a `Result.Ok`.\n */\nexport function ok<T, E = never>(value: T): Ok<T, E>\nexport function ok<_T extends void = void, E = never>(value: void): Ok<void, E>\nexport function ok<T, E = never>(value: T): Ok<T, E> {\n return neverthrow_ok<T,E>(value); \n}\n\n/**\n * Create an instance of {@link Err}.\n *\n * If you need to create an instance with a specific type (as you do whenever you\n * are not constructing immediately for a function return or as an argument to a\n * function), you can use a type parameter:\n *\n * ```ts\n * const notString = err<number, string>('something went wrong');\n * ```\n *\n * Note: passing nothing will produce a `Result<T, void>`, passing `undefined` will\n * produce a `Result<T, undefined>` which is compatible with `Result<T, void>`.\n *\n * ```ts\n * const normalResult = err<number, string>('oh no');\n * const explicitUndefined = err<number, undefined>(undefined);\n * const implicitVoid = err<number, void>();\n * ```\n *\n * In the context of an immediate function return, or an arrow function with a\n * single expression value, you do not have to specify the types, so this can be\n * quite convenient.\n *\n * ```ts\n * const arrowValidate = (data: SomeData): Result<number, string> =>\n * isValid(data) ? ok(42) : err('something went wrong');\n *\n * function fnValidate(data: someData): Result<number, string> {\n * return isValid(data) ? ok(42) : err('something went wrong');\n * }\n * ```\n *\n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n * @param err - The value to wrap in a `Result.Err`.\n */\nexport function err<T = never, E extends string = string>(err: E): Err<T, E>\nexport function err<T = never, E = unknown>(err: E): Err<T, E>\nexport function err<T = never, _E extends void = void>(err: void): Err<T, void>\nexport function err<T = never, E = unknown>(err: E): Err<T, E> {\n return neverthrow_err<T,E>(err)\n}\n","import { errAsync as neverthrow_errAsync, okAsync as neverthrow_okAsync, ResultAsync as neverthrow_ResultAsync } from \"neverthrow\";\n\n// Needed for Intellisense links\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Result, Ok, Err } from \"./Result\"\n\n/**\n * `ResultAsync` allows you to work with asynchronous Results in a type safe way\n * \n * `ResultAsync<T,E>` is a wrapper around `Promise<Result<T,E>>` which provides the same methods for chaining different\n * `Result` and `ResultAsync` together as {@link Result}, while also chaining the asynchronous operations together using\n * `Promise.then`.\n * \n * `ResultAsync` is *thenable* (implements `PromiseLike<T>`) so can be used in most places that a `Promise` can, including with `await`.\n * \n * Compatible with [`neverthrow`](https://github.com/supermacro/neverthrow)\n * \n * @typeParam T - The type of the value contained in the `ResultAsync` for the success case\n * @typeParam E - The type of the error contained in the `ResultAsync` for the failure case\n */\nexport class ResultAsync<T,E> extends neverthrow_ResultAsync<T,E> {}\n\n/**\n * Create an instance of `ResultAsync` containing an {@link Ok} variant of {@link Result}\n *\n * Equivalent to `new ResultAsync(Promise.resolve(new Ok(value)))`\n *\n * @typeParam T - The type of the value contained in the `ResultAsync` for the success case\n * @typeParam E - The type of the error contained in the `ResultAsync` for the failure case\n * @param value - The value to wrap in a `Result.Ok`.\n */\nexport function okAsync<T, E = never>(value: T): ResultAsync<T, E>\nexport function okAsync<_T extends void = void, E = never>(value: void): ResultAsync<void, E>\nexport function okAsync<T, E = never>(value: T): ResultAsync<T, E> {\n return neverthrow_okAsync(value);\n}\n\n/**\n * Create an instance of `ResultAsync` containing an {@link Err} variant of {@link Result}\n *\n * Equivalent to `new ResultAsync(Promise.resolve(new Err(err)))`\n *\n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n * @param err - The value to wrap in a `Result.Err`.\n */\nexport function errAsync<T = never, E = unknown>(err: E): ResultAsync<T, E>\nexport function errAsync<T = never, _E extends void = void>(err: void): ResultAsync<T, void>\nexport function errAsync<T = never, E = unknown>(err: E): ResultAsync<T, E> {\n return neverthrow_errAsync<T,E>(err)\n}\n","/** Common properties for Infinisheet errors */\nexport interface InfinisheetError {\n /** Discriminated union tag */\n type: string,\n\n /** End user message describing the problem */\n message: string,\n}\n\n/** \n * Attempt to access data that is outside the available range\n * \n */\nexport interface InfinisheetRangeError extends InfinisheetError {\n /** Discriminated union tag */\n type: 'InfinisheetRangeError',\n\n};\n\n/** Convenience method that creates an {@link InfinisheetRangeError} */\nexport function infinisheetRangeError(message: string): InfinisheetRangeError {\n return { type: 'InfinisheetRangeError', message };\n}\n\n/** Type that represents an error when validating data passed to an API */\nexport interface ValidationError extends InfinisheetError {\n /** Discriminated union tag */\n type: 'ValidationError'\n};\n\n/** Convenience method that creates a {@link ValidationError} */\nexport function validationError(message: string): ValidationError {\n return { type: 'ValidationError', message };\n}\n\n/** Type that represents an error when accessing data in persistent storage */\nexport interface StorageError extends InfinisheetError {\n /** Discriminated union tag */\n type: 'StorageError',\n\n /** HTTP style status code\n * \n * Describes the type of problem encountered. Expected to be a 4XX or 5XX code.\n */\n statusCode?: number | undefined,\n};\n\n/** Convenience method that creates a {@link StorageError} */\nexport function storageError(message: string, statusCode?: number): StorageError {\n return { type: 'StorageError', message, statusCode };\n}","import { ResultAsync } from \"./ResultAsync\";\nimport { StorageError, InfinisheetError, InfinisheetRangeError } from \"./Error\"\n\nexport type BlobId = string;\nexport type WorkflowId = string;\nexport type SequenceId = bigint;\n\n/**\n * Metadata stored in an {@link EventLog} entry\n */\nexport interface LogMetadata {\n /** Stores a reference to a snapshot of the complete log up to and including this entry */\n snapshot?: BlobId | undefined;\n\n /** Stores a reference to an external history of the event log up to and including the previous entry */\n history?: BlobId | undefined;\n\n /** Indicates that a background workflow is pending */\n pending?: WorkflowId | undefined;\n}\n\n/** \n * Type that represents an entry in an {@link EventLog}\n * \n * Base interface that clients will typically implement multiple times.\n * Each concrete implementation will define its own data properties that\n * need to be serialized into the event log.\n * \n * Properties defined here are common metadata which require special handling\n * by any `EventLog` implementation.\n * \n * All data properties are immutable once an entry has been added to the log. Metadata\n * properties (apart from `type`) may change over time.\n */\nexport interface LogEntry extends LogMetadata {\n /** Used as a discriminated union tag by implementations */\n type: string;\n};\n\n/** \n * Type that represents a consistency conflict when adding a {@link LogEntry} to an {@link EventLog}\n * \n * Occurs when an attempt is made to add an entry with a sequence id that is not\n * the next available in the log.\n * \n * Typically happens when another client makes a change since you last read the log.\n * Sync with the additional log entries and then try again.\n */\nexport interface ConflictError extends InfinisheetError {\n /** Discriminated union tag */\n type: 'ConflictError',\n\n /** Next available sequence id */\n nextSequenceId: SequenceId;\n};\n\n/** Convenience method that creates a {@link ConflictError} */\nexport function conflictError(message: string, nextSequenceId: SequenceId): ConflictError {\n return { type: 'ConflictError', message, nextSequenceId };\n}\n\n/** Errors that can be returned by {@link EventLog} `addEntry` method */\nexport type AddEntryError = ConflictError | StorageError;\n\n/** Errors that can be returned by {@link EventLog} `query` method */\nexport type QueryError = InfinisheetRangeError | StorageError;\n\n/** Errors that can be returned by {@link EventLog} `truncate` method */\nexport type TruncateError = InfinisheetRangeError | StorageError;\n\n/** Errors that can be returned by {@link EventLog} `setMetadata` method */\nexport type MetadataError = InfinisheetRangeError | StorageError;\n\n/** A range of {@link LogEntry} values returned by querying an {@link EventLog} */\nexport interface QueryValue<T extends LogEntry> {\n /** Sequence id corresponding to the first entry in `entries`\n * \n * All other entries have consecutive ascending sequence ids\n */\n startSequenceId: SequenceId;\n\n /** \n * Sequence id after the final entry in `entries`\n * \n * If query was up to the `end` sequence id AND\n * `isComplete` is true, this is the next available\n * sequence id for `addEntry`. \n */\n endSequenceId: SequenceId;\n\n /** True if all the requested entries have been returned\n * \n * Queries may return fewer entries than requested. If \n * `isComplete` is `false`, repeat the query starting\n * from `nextSequenceId`.\n */\n isComplete: boolean;\n\n /** The {@link LogEntry} records returned by the query */\n entries: T[];\n}\n\n/** Abstract interface representing an event log\n * \n * \n */\nexport interface EventLog<T extends LogEntry> {\n /** \n * Add an entry to the log with the given sequence id\n * \n * The `sequenceId` must be the next available sequence id in the log. This is returned as `endSequenceId` when\n * making a query for the `last` entry in the log. Returns a {@link ConflictError} if not the next available id.\n * Any other problem with serializing the entry will return a {@link StorageError}.\n */\n addEntry(entry: T, sequenceId: SequenceId): ResultAsync<void,AddEntryError>;\n\n /**\n * Set some or all of a log entry's metadata fields\n *\n * Changes are atomic. Either all of the specified fields are updated or none are.\n */\n setMetadata(sequenceId: SequenceId, metaData: LogMetadata): ResultAsync<void,MetadataError>;\n\n /** Return a range of entries from `first` to `last` inclusive \n * \n * The event log may return fewer entries than requested. If so, repeat the query starting from `nextSequenceId`.\n * \n * @param start - `SequenceId` of first entry to return. \n * Use `'start'` to query from the first entry in the log. \n * Use `'snapshot'` to query from the most recent entry with a snapshot, or the first if no snapshot is defined.\n * \n * @param end - `SequenceId` one after the last entry to return.\n * Use `'end'` to query everything to the end of the log.\n */\n query(start: SequenceId | 'snapshot' | 'start', end: SequenceId | 'end'): ResultAsync<QueryValue<T>,QueryError>;\n\n /** All entries prior to `start` are removed from the log. */\n truncate(start: SequenceId): ResultAsync<void,TruncateError>\n}","import type { ItemOffsetMapping } from './ItemOffsetMapping';\n\n/**\n * Implementation of {@link ItemOffsetMapping} for use when all items have a fixed size\n */\nexport class FixedSizeItemOffsetMapping implements ItemOffsetMapping {\n /**\n * @param itemSize - Size to use for all items\n */\n constructor (itemSize: number) {\n this.#fixedItemSize = itemSize;\n }\n\n itemSize(_itemIndex: number): number {\n return this.#fixedItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n return itemIndex * this.#fixedItemSize;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n const itemIndex = Math.floor(offset / this.#fixedItemSize);\n const startOffset = itemIndex * this.#fixedItemSize;\n\n return [itemIndex, startOffset];\n }\n\n #fixedItemSize: number;\n}\n\n","import type { ItemOffsetMapping } from './ItemOffsetMapping';\n\n/**\n * Implementation of {@link ItemOffsetMapping} for use when initial items have variable sizes.\n */\nexport class VariableSizeItemOffsetMapping implements ItemOffsetMapping {\n /**\n * @param defaultItemSize - Size to use for all other items\n * @param sizes - Array of sizes to use for the initial items, one size per item\n */\n constructor (defaultItemSize: number, sizes: number[]) {\n this.#defaultItemSize = defaultItemSize;\n this.#sizes = sizes;\n }\n\n itemSize(itemIndex: number): number {\n return (itemIndex < this.#sizes.length) ? this.#sizes[itemIndex]! : this.#defaultItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n let offset = 0;\n let length = this.#sizes.length;\n if (itemIndex > length) {\n const numDefaultSize = itemIndex - length;\n offset = numDefaultSize * this.#defaultItemSize;\n } else {\n length = itemIndex;\n }\n \n for (let i = 0; i < length; i ++)\n {\n offset += this.#sizes[i]!;\n }\n\n return offset;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n let startOffset = 0;\n for (const [i,size] of this.#sizes.entries()) {\n if (startOffset + size > offset) {\n return [i, startOffset];\n }\n startOffset += size;\n }\n\n const itemIndex = Math.floor((offset - startOffset) / this.#defaultItemSize);\n startOffset += itemIndex * this.#defaultItemSize;\n\n const length = this.#sizes.length;\n return [itemIndex+length, startOffset];\n }\n\n #defaultItemSize: number;\n #sizes: number[];\n}\n","import type { ItemOffsetMapping } from \"./ItemOffsetMapping\";\nimport { FixedSizeItemOffsetMapping } from \"./FixedSizeItemOffsetMapping\";\nimport { Result, err, ok } from \"./Result\";\nimport { ValidationError, StorageError, storageError } from \"./Error\";\n\n/** Possible spreadsheet error values\n * \n * Includes those that can be returned by `ERROR.TYPE` and additional values\n * introduced by more recent versions of Excel.\n*/\nexport type CellErrorValue = '#NULL!' | \n '#DIV/0!' |\n '#VALUE!' |\n '#REF!' |\n '#NAME?' |\n '#NUM!' |\n '#N/A' |\n '#GETTING_DATA' |\n '#SPILL!' |\n '#UNKNOWN!' |\n '#FIELD!' |\n '#CALC!';\n\n/** Type that represents an error value stored in a cell\n * \n * Defined as a discriminated union so that additional cell value types\n * can be added in future.\n */\nexport interface CellError {\n /** Discriminated union tag */\n type: 'CellError',\n\n /** {@link CellErrorValue | Error Value} */\n value: CellErrorValue;\n};\n\n/** Possible types for a cell value \n * \n * The native JavaScript types string, number and boolean represent the *Text*, *Number* and *Logical*\n * spreadsheet data types. {@link CellError} represents an *Error Value*.\n * \n * Undefined is used to represent a cell with no defined value. Null represents a cell that has been\n * explicitly marked as empty. \n*/\nexport type CellValue = string | number | boolean | null | undefined | CellError\n\n/** Types of error that can be returned by {@link SpreadsheetData} methods */\nexport type SpreadsheetDataError = ValidationError | StorageError;\n\n/**\n * Interface used to access the data in a spreadsheet\n * \n * The data exposed through the interface may change over time outside of any changes made through the interface. The caller\n * can use the {@link subscribe} method to be notified when the data changes. When reading data, the caller must first request\n * a snapshot using {@link getSnapshot}. All values returned by gettors are relative to a specified snapshot. The values will be\n * consistent with each other as long as the same snapshot is used.\n * \n * @typeParam Snapshot - Type of snapshot. Implementations are free to use whatever type makes sense for them.\n */\nexport interface SpreadsheetData<Snapshot> {\n /** Subscribe to data changes */\n subscribe(onDataChange: () => void): () => void,\n\n /** Return a snapshot to use when accessing values at a consistent point in time */\n getSnapshot(): Snapshot,\n\n /** Number of rows in the spreadsheet */\n getRowCount(snapshot: Snapshot): number,\n\n /** {@link ItemOffsetMapping} which describes sizes and offsets to start of rows */\n getRowItemOffsetMapping(snapshot: Snapshot): ItemOffsetMapping,\n\n /** Number of columns in the spreadsheet */\n getColumnCount(snapshot: Snapshot): number,\n\n /** {@link ItemOffsetMapping} which describes sizes and offsets to start of columns */\n getColumnItemOffsetMapping(snapshot: Snapshot): ItemOffsetMapping,\n\n /** Value of specified cell using 0-based row and column indexes */\n getCellValue(snapshot: Snapshot, row: number, column: number): CellValue;\n\n /** Format of specified cell using 0-based row and column indexes */\n getCellFormat(snapshot: Snapshot, row: number, column: number): string | undefined;\n\n /** Set value and format of specified cell\n * \n * @returns `Ok` if the change was successfully applied\n */\n setCellValueAndFormat(row: number, column: number, value: CellValue, format: string | undefined): Result<void,SpreadsheetDataError>\n\n /** Check whether value and format are valid to set for specified cell\n * \n * @returns `Ok` if the value and format are valid\n */\n isValidCellValueAndFormat(row: number, column: number, value: CellValue, format: string | undefined): Result<void,ValidationError>\n}\n\nconst rowItemOffsetMapping = new FixedSizeItemOffsetMapping(30);\nconst columnItemOffsetMapping = new FixedSizeItemOffsetMapping(100);\n\nexport class EmptySpreadsheetData implements SpreadsheetData<number> {\n subscribe(_onDataChange: () => void) { return () => {}; }\n getSnapshot() { return 0; }\n \n getRowCount(_snapshot: number) { return 0; }\n getRowItemOffsetMapping(_snapshot: number): ItemOffsetMapping { return rowItemOffsetMapping; }\n getColumnCount(_snapshot: number) { return 0; }\n getColumnItemOffsetMapping(_snapshot: number): ItemOffsetMapping { return columnItemOffsetMapping; }\n getCellValue(_snapshot: number, _row: number, _column: number): CellValue { return null; }\n getCellFormat(_snapshot: number, _row: number, _column: number): string|undefined { return undefined; }\n setCellValueAndFormat(_row: number, _column: number, _value: CellValue, _format: string | undefined): Result<void,SpreadsheetDataError> \n { return err(storageError(\"Not implemented\", 501)); }\n isValidCellValueAndFormat(_row: number, _column: number, _value: CellValue, _format: string | undefined): Result<void,ValidationError> \n { return ok(); }\n}\n\n","/** Classic Spreadsheet reference to Column (e.g \"A\") */\nexport type ColRef = string;\n\n/** Classic Spreadsheet reference to Cell (e.g. \"A1\"), Row (e.g. \"1\") or Column (e.g \"A\") */\nexport type RowColRef = string;\n\n/** Equivalent to {@link RowColRef} as coordinate pair. \"A1\" has coords [0,0], \"1\" is [0,undefined] and \"A\" is [undefined,0] */\nexport type RowColCoords = [row: number|undefined, col: number|undefined];\n\n/** Converts a {@link ColRef} to the 0-based index of the column */\nexport function colRefToIndex(col: ColRef): number {\n let n = 0;\n for (let i = 0; i < col.length; i ++) {\n n = col.charCodeAt(i) - 64 + n * 26;\n }\n return n-1;\n}\n\n/** Converts a 0-based column index to a {@link ColRef} */\nexport function indexToColRef(index: number): ColRef {\n let ret = \"\";\n index ++;\n while (index > 0) {\n index --;\n const remainder = index % 26;\n index = Math.floor(index / 26);\n ret = String.fromCharCode(65+remainder) + ret;\n }\n return ret;\n}\n\n/** Splits a RowColRef into a 0-based row index and a {@link ColRef} */\nexport function splitRowColRef(ref: RowColRef): [row: number|undefined, col: ColRef|undefined] {\n const re = /^([A-Z]*)(\\d*)$/;\n const found = ref.match(re);\n if (!found)\n return [undefined,undefined];\n\n const col = found[1];\n const row = found[2] ? parseInt(found[2]) : 0;\n return [(row>0) ? row-1 : undefined, col ? col : undefined];\n}\n\n/** Converts a {@link RowColRef} to {@link RowColCoords} */\nexport function rowColRefToCoords(ref: RowColRef): RowColCoords {\n const [row,col] = splitRowColRef(ref);\n return [row, col ? colRefToIndex(col) : undefined];\n}\n\n/** Converts {@link RowColCoords} to a {@link RowColRef} */\nexport function rowColCoordsToRef(row: number|undefined, col: number|undefined): RowColRef {\n if (row !== undefined) {\n if (col !== undefined) {\n return indexToColRef(col) + (row+1);\n } else {\n return (row+1).toString();\n }\n } else {\n if (col !== undefined) {\n return indexToColRef(col);\n } else {\n return \"\";\n }\n }\n}"],"names":["neverthrow_ok","neverthrow_err","neverthrow_ResultAsync","neverthrow_okAsync","neverthrow_errAsync"],"mappings":";;AA0EM,SAAU,EAAE,CAAe,KAAQ,EAAA;AACvC,IAAA,OAAOA,IAAa,CAA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,GAAG,GAAC,CAAC,GAAG,SAAS,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC;AAC7D;AAEA;AACM,SAAU,iBAAiB,CAAC,GAAc,EAAA;IAC9C,MAAM,CAAC,GAAG,EAAC,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC;AACrC,IAAA,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;AACpD;AAEA;AACgB,SAAA,iBAAiB,CAAC,GAAqB,EAAE,GAAqB,EAAA;AAC5E,IAAA,IAAI,GAAG,KAAK,SAAS,EAAE;AACrB,QAAA,IAAI,GAAG,KAAK,SAAS,EAAE;YACrB,OAAO,aAAa,CAAC,GAAG,CAAC,IAAI,GAAG,GAAC,CAAC,CAAC;;aAC9B;YACL,OAAO,CAAC,GAAG,GAAC,CAAC,EAAE,QAAQ,EAAE;;;SAEtB;AACL,QAAA,IAAI,GAAG,KAAK,SAAS,EAAE;AACrB,YAAA,OAAO,aAAa,CAAC,GAAG,CAAC;;aACpB;AACL,YAAA,OAAO,EAAE;;;AAGf;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/Result.ts","../src/ResultAsync.ts","../src/Error.ts","../src/EventLog.ts","../src/FixedSizeItemOffsetMapping.ts","../src/VariableSizeItemOffsetMapping.ts","../src/SpreadsheetData.ts","../src/RowColRef.ts"],"sourcesContent":["import type { Ok as neverthrow_Ok, Err as neverthrow_Err } from \"neverthrow\";\nimport { err as neverthrow_err, ok as neverthrow_ok } from \"neverthrow\";\n\n/**\n * An `Ok` instance is the *successful* variant of the {@link Result} type, \n * representing a successful outcome from an operation which may fail.\n * \n * Implemented using [`neverthrow`](https://github.com/supermacro/neverthrow)\n * \n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n */\nexport interface Ok<T,E> extends neverthrow_Ok<T,E> {}\n\n/**\n * An `Err` instance is the failure variant of the {@link Result} type, \n * representing a failure outcome from an operation which may fail.\n * \n * Implemented using [`neverthrow`](https://github.com/supermacro/neverthrow)\n * \n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n */\nexport interface Err<T,E> extends neverthrow_Err<T,E> {}\n\n/**\n * A `Result` represents success ({@link Ok}) or failure ({@link Err}).\n * \n * Compatible with [`neverthrow`](https://github.com/supermacro/neverthrow)\n * \n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n */\nexport type Result<T,E> = Ok<T,E> | Err<T,E>;\n\n/**\n * Create an instance of {@link Ok}.\n *\n * If you need to create an instance with a specific type (as you do whenever you\n * are not constructing immediately for a function return or as an argument to a\n * function), you can use a type parameter:\n *\n * ```ts\n * const yayNumber = ok<number, string>(12);\n * ```\n *\n * Note: passing nothing will produce a `Result<void, E>`, passing `undefined` will\n * produce a `Result<undefined, E>` which is compatible with `Result<void, E>`.\n *\n * ```ts\n * const normalResult = ok<number, string>(42);\n * const explicitUndefined = ok<undefined, string>(undefined);\n * const implicitVoid = ok<void, string>();\n * ```\n *\n * In the context of an immediate function return, or an arrow function with a\n * single expression value, you do not have to specify the types, so this can be\n * quite convenient.\n *\n * ```ts\n * const arrowValidate = (data: SomeData): Result<void, string> =>\n * isValid(data) ? ok() : err('something was wrong!');\n *\n * function fnValidate(data: someData): Result<void, string> {\n * return isValid(data) ? ok() : err('something was wrong');\n * }\n * ```\n *\n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n * @param value - The value to wrap in a `Result.Ok`.\n */\nexport function ok<T, E = never>(value: T): Ok<T, E>\nexport function ok<_T extends void = void, E = never>(value: void): Ok<void, E>\nexport function ok<T, E = never>(value: T): Ok<T, E> {\n return neverthrow_ok<T,E>(value); \n}\n\n/**\n * Create an instance of {@link Err}.\n *\n * If you need to create an instance with a specific type (as you do whenever you\n * are not constructing immediately for a function return or as an argument to a\n * function), you can use a type parameter:\n *\n * ```ts\n * const notString = err<number, string>('something went wrong');\n * ```\n *\n * Note: passing nothing will produce a `Result<T, void>`, passing `undefined` will\n * produce a `Result<T, undefined>` which is compatible with `Result<T, void>`.\n *\n * ```ts\n * const normalResult = err<number, string>('oh no');\n * const explicitUndefined = err<number, undefined>(undefined);\n * const implicitVoid = err<number, void>();\n * ```\n *\n * In the context of an immediate function return, or an arrow function with a\n * single expression value, you do not have to specify the types, so this can be\n * quite convenient.\n *\n * ```ts\n * const arrowValidate = (data: SomeData): Result<number, string> =>\n * isValid(data) ? ok(42) : err('something went wrong');\n *\n * function fnValidate(data: someData): Result<number, string> {\n * return isValid(data) ? ok(42) : err('something went wrong');\n * }\n * ```\n *\n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n * @param err - The value to wrap in a `Result.Err`.\n */\nexport function err<T = never, E extends string = string>(err: E): Err<T, E>\nexport function err<T = never, E = unknown>(err: E): Err<T, E>\nexport function err<T = never, _E extends void = void>(err: void): Err<T, void>\nexport function err<T = never, E = unknown>(err: E): Err<T, E> {\n return neverthrow_err<T,E>(err)\n}\n","import { errAsync as neverthrow_errAsync, okAsync as neverthrow_okAsync, ResultAsync as neverthrow_ResultAsync } from \"neverthrow\";\n\n// Needed for Intellisense links\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport { Result, Ok, Err } from \"./Result\"\n\n/**\n * `ResultAsync` allows you to work with asynchronous Results in a type safe way\n * \n * `ResultAsync<T,E>` is a wrapper around `Promise<Result<T,E>>` which provides the same methods for chaining different\n * `Result` and `ResultAsync` together as {@link Result}, while also chaining the asynchronous operations together using\n * `Promise.then`.\n * \n * `ResultAsync` is *thenable* (implements `PromiseLike<T>`) so can be used in most places that a `Promise` can, including with `await`.\n * \n * Compatible with [`neverthrow`](https://github.com/supermacro/neverthrow)\n * \n * @typeParam T - The type of the value contained in the `ResultAsync` for the success case\n * @typeParam E - The type of the error contained in the `ResultAsync` for the failure case\n */\nexport class ResultAsync<T,E> extends neverthrow_ResultAsync<T,E> {}\n\n/**\n * Create an instance of `ResultAsync` containing an {@link Ok} variant of {@link Result}\n *\n * Equivalent to `new ResultAsync(Promise.resolve(new Ok(value)))`\n *\n * @typeParam T - The type of the value contained in the `ResultAsync` for the success case\n * @typeParam E - The type of the error contained in the `ResultAsync` for the failure case\n * @param value - The value to wrap in a `Result.Ok`.\n */\nexport function okAsync<T, E = never>(value: T): ResultAsync<T, E>\nexport function okAsync<_T extends void = void, E = never>(value: void): ResultAsync<void, E>\nexport function okAsync<T, E = never>(value: T): ResultAsync<T, E> {\n return neverthrow_okAsync(value);\n}\n\n/**\n * Create an instance of `ResultAsync` containing an {@link Err} variant of {@link Result}\n *\n * Equivalent to `new ResultAsync(Promise.resolve(new Err(err)))`\n *\n * @typeParam T - The type of the value contained in the `Result` for the success case\n * @typeParam E - The type of the error contained in the `Result` for the failure case\n * @param err - The value to wrap in a `Result.Err`.\n */\nexport function errAsync<T = never, E = unknown>(err: E): ResultAsync<T, E>\nexport function errAsync<T = never, _E extends void = void>(err: void): ResultAsync<T, void>\nexport function errAsync<T = never, E = unknown>(err: E): ResultAsync<T, E> {\n return neverthrow_errAsync<T,E>(err)\n}\n","/** Common properties for Infinisheet errors */\nexport interface InfinisheetError {\n /** Discriminated union tag */\n type: string,\n\n /** End user message describing the problem */\n message: string,\n}\n\n/** \n * Attempt to access data that is outside the available range\n * \n */\nexport interface InfinisheetRangeError extends InfinisheetError {\n /** Discriminated union tag */\n type: 'InfinisheetRangeError',\n\n};\n\n/** Convenience method that creates an {@link InfinisheetRangeError} */\nexport function infinisheetRangeError(message: string): InfinisheetRangeError {\n return { type: 'InfinisheetRangeError', message };\n}\n\n/** Type that represents an error when validating data passed to an API */\nexport interface ValidationError extends InfinisheetError {\n /** Discriminated union tag */\n type: 'ValidationError'\n};\n\n/** Convenience method that creates a {@link ValidationError} */\nexport function validationError(message: string): ValidationError {\n return { type: 'ValidationError', message };\n}\n\n/** Type that represents an error when accessing data in persistent storage */\nexport interface StorageError extends InfinisheetError {\n /** Discriminated union tag */\n type: 'StorageError',\n\n /** HTTP style status code\n * \n * Describes the type of problem encountered. Expected to be a 4XX or 5XX code.\n */\n statusCode?: number | undefined,\n};\n\n/** Convenience method that creates a {@link StorageError} */\nexport function storageError(message: string, statusCode?: number): StorageError {\n return { type: 'StorageError', message, statusCode };\n}","import { ResultAsync } from \"./ResultAsync\";\nimport { StorageError, InfinisheetError, InfinisheetRangeError } from \"./Error\"\n\n/** Identifier for a blob of data in a blob store */\nexport type BlobId = string;\n\n/** Identifier for a workflow triggered writing to {@link LogMetadata.pending} */\nexport type WorkflowId = string;\n\n/** \n * Identifier for an entry in an {@link EventLog}.\n * \n * Incrementing integer.\n*/\nexport type SequenceId = bigint;\n\n/**\n * Metadata stored in an {@link EventLog} entry\n */\nexport interface LogMetadata {\n /** Stores a reference to a snapshot of the complete log up to and including this entry */\n snapshot?: BlobId | undefined;\n\n /** Stores a reference to an external history of the event log up to and including the previous entry */\n history?: BlobId | undefined;\n\n /** Indicates that a background workflow is pending */\n pending?: WorkflowId | undefined;\n}\n\n/** \n * Type that represents an entry in an {@link EventLog}\n * \n * Base interface that clients will typically implement multiple times.\n * Each concrete implementation will define its own data properties that\n * need to be serialized into the event log.\n * \n * Properties defined here are common metadata which require special handling\n * by any `EventLog` implementation.\n * \n * All data properties are immutable once an entry has been added to the log. Metadata\n * properties (apart from `type`) may change over time.\n */\nexport interface LogEntry extends LogMetadata {\n /** Used as a discriminated union tag by implementations */\n type: string;\n};\n\n/** \n * Type that represents a consistency conflict when adding a {@link LogEntry} to an {@link EventLog}\n * \n * Occurs when an attempt is made to add an entry with a sequence id that is not\n * the next available in the log.\n * \n * Typically happens when another client makes a change since you last read the log.\n * Sync with the additional log entries and then try again.\n */\nexport interface ConflictError extends InfinisheetError {\n /** Discriminated union tag */\n type: 'ConflictError',\n\n /** Next available sequence id */\n nextSequenceId: SequenceId;\n};\n\n/** Convenience method that creates a {@link ConflictError} */\nexport function conflictError(message: string, nextSequenceId: SequenceId): ConflictError {\n return { type: 'ConflictError', message, nextSequenceId };\n}\n\n/** Errors that can be returned by {@link EventLog} `addEntry` method */\nexport type AddEntryError = ConflictError | StorageError;\n\n/** Errors that can be returned by {@link EventLog} `query` method */\nexport type QueryError = InfinisheetRangeError | StorageError;\n\n/** Errors that can be returned by {@link EventLog} `truncate` method */\nexport type TruncateError = InfinisheetRangeError | StorageError;\n\n/** Errors that can be returned by {@link EventLog} `setMetadata` method */\nexport type MetadataError = InfinisheetRangeError | StorageError;\n\n/** A range of {@link LogEntry} values returned by querying an {@link EventLog} */\nexport interface QueryValue<T extends LogEntry> {\n /** Sequence id corresponding to the first entry in `entries`\n * \n * All other entries have consecutive ascending sequence ids\n */\n startSequenceId: SequenceId;\n\n /** \n * Sequence id after the final entry in `entries`\n * \n * If query was up to the `end` sequence id AND\n * `isComplete` is true, this is the next available\n * sequence id for `addEntry`. \n */\n endSequenceId: SequenceId;\n\n /** True if all the requested entries have been returned\n * \n * Queries may return fewer entries than requested. If \n * `isComplete` is `false`, repeat the query starting\n * from `nextSequenceId`.\n */\n isComplete: boolean;\n\n /** The {@link LogEntry} records returned by the query */\n entries: T[];\n}\n\n/** Abstract interface representing an event log\n * \n * \n */\nexport interface EventLog<T extends LogEntry> {\n /** \n * Add an entry to the log with the given sequence id\n * \n * The `sequenceId` must be the next available sequence id in the log. This is returned as `endSequenceId` when\n * making a query for the `last` entry in the log. Returns a {@link ConflictError} if not the next available id.\n * Any other problem with serializing the entry will return a {@link StorageError}.\n */\n addEntry(entry: T, sequenceId: SequenceId): ResultAsync<void,AddEntryError>;\n\n /**\n * Set some or all of a log entry's metadata fields\n *\n * Changes are atomic. Either all of the specified fields are updated or none are.\n */\n setMetadata(sequenceId: SequenceId, metaData: LogMetadata): ResultAsync<void,MetadataError>;\n\n /** Return a range of entries from `first` to `last` inclusive \n * \n * The event log may return fewer entries than requested. If so, repeat the query starting from `nextSequenceId`.\n * \n * @param start - `SequenceId` of first entry to return. \n * Use `'start'` to query from the first entry in the log. \n * Use `'snapshot'` to query from the most recent entry with a snapshot, or the first if no snapshot is defined.\n * \n * @param end - `SequenceId` one after the last entry to return.\n * Use `'end'` to query everything to the end of the log.\n */\n query(start: SequenceId | 'snapshot' | 'start', end: SequenceId | 'end'): ResultAsync<QueryValue<T>,QueryError>;\n\n /** All entries prior to `start` are removed from the log. */\n truncate(start: SequenceId): ResultAsync<void,TruncateError>\n}","import type { ItemOffsetMapping } from './ItemOffsetMapping';\n\n/**\n * Implementation of {@link ItemOffsetMapping} for use when all items have a fixed size\n */\nexport class FixedSizeItemOffsetMapping implements ItemOffsetMapping {\n /**\n * @param itemSize - Size to use for all items\n */\n constructor (itemSize: number) {\n this.fixedItemSize = itemSize;\n }\n\n itemSize(_itemIndex: number): number {\n return this.fixedItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n return itemIndex * this.fixedItemSize;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n const itemIndex = Math.floor(offset / this.fixedItemSize);\n const startOffset = itemIndex * this.fixedItemSize;\n\n return [itemIndex, startOffset];\n }\n\n private fixedItemSize: number;\n}\n\n","import type { ItemOffsetMapping } from './ItemOffsetMapping';\n\n/**\n * Implementation of {@link ItemOffsetMapping} for use when initial items have variable sizes.\n */\nexport class VariableSizeItemOffsetMapping implements ItemOffsetMapping {\n /**\n * @param defaultItemSize - Size to use for all other items\n * @param sizes - Array of sizes to use for the initial items, one size per item\n */\n constructor (defaultItemSize: number, sizes: number[]) {\n this.defaultItemSize = defaultItemSize;\n this.sizes = sizes;\n }\n\n itemSize(itemIndex: number): number {\n return (itemIndex < this.sizes.length) ? this.sizes[itemIndex]! : this.defaultItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n let offset = 0;\n let length = this.sizes.length;\n if (itemIndex > length) {\n const numDefaultSize = itemIndex - length;\n offset = numDefaultSize * this.defaultItemSize;\n } else {\n length = itemIndex;\n }\n \n for (let i = 0; i < length; i ++)\n {\n offset += this.sizes[i]!;\n }\n\n return offset;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n let startOffset = 0;\n for (const [i,size] of this.sizes.entries()) {\n if (startOffset + size > offset) {\n return [i, startOffset];\n }\n startOffset += size;\n }\n\n const itemIndex = Math.floor((offset - startOffset) / this.defaultItemSize);\n startOffset += itemIndex * this.defaultItemSize;\n\n const length = this.sizes.length;\n return [itemIndex+length, startOffset];\n }\n\n private defaultItemSize: number;\n private sizes: number[];\n}\n","import type { ItemOffsetMapping } from \"./ItemOffsetMapping\";\nimport { FixedSizeItemOffsetMapping } from \"./FixedSizeItemOffsetMapping\";\nimport { Result, ok } from \"./Result\";\nimport { ResultAsync, errAsync } from \"./ResultAsync\";\nimport { ValidationError, StorageError, storageError } from \"./Error\";\n\n/** Possible spreadsheet error values\n * \n * Includes those that can be returned by `ERROR.TYPE` and additional values\n * introduced by more recent versions of Excel.\n*/\nexport type CellErrorValue = '#NULL!' | \n '#DIV/0!' |\n '#VALUE!' |\n '#REF!' |\n '#NAME?' |\n '#NUM!' |\n '#N/A' |\n '#GETTING_DATA' |\n '#SPILL!' |\n '#UNKNOWN!' |\n '#FIELD!' |\n '#CALC!';\n\n/** Type that represents an error value stored in a cell\n * \n * Defined as a discriminated union so that additional cell value types\n * can be added in future.\n */\nexport interface CellError {\n /** Discriminated union tag */\n type: 'CellError',\n\n /** {@link CellErrorValue | Error Value} */\n value: CellErrorValue;\n};\n\n/** Possible types for a cell value \n * \n * The native JavaScript types string, number and boolean represent the *Text*, *Number* and *Logical*\n * spreadsheet data types. {@link CellError} represents an *Error Value*.\n * \n * Undefined is used to represent a cell with no defined value. Null represents a cell that has been\n * explicitly marked as empty. \n*/\nexport type CellValue = string | number | boolean | null | undefined | CellError\n\n/** Types of error that can be returned by {@link SpreadsheetData} methods */\nexport type SpreadsheetDataError = ValidationError | StorageError;\n\n/**\n * Interface used to access the data in a spreadsheet\n * \n * The data exposed through the interface may change over time outside of any changes made through the interface. The caller\n * can use the {@link subscribe} method to be notified when the data changes. When reading data, the caller must first request\n * a snapshot using {@link getSnapshot}. All values returned by gettors are relative to a specified snapshot. The values will be\n * consistent with each other as long as the same snapshot is used.\n * \n * @typeParam Snapshot - Type of snapshot. Implementations are free to use whatever type makes sense for them.\n */\nexport interface SpreadsheetData<Snapshot> {\n /** Subscribe to data changes */\n subscribe(onDataChange: () => void): () => void,\n\n /** Return a snapshot to use when accessing values at a consistent point in time */\n getSnapshot(): Snapshot,\n\n /** \n * Return load status at the time the snapshot was created \n * \n * On Success returns true if load has completed, false if still in progress\n * On Err returns most recent error reported by the storage system\n */\n getLoadStatus(snapshot: Snapshot): Result<boolean,StorageError>,\n\n /** Number of rows in the spreadsheet */\n getRowCount(snapshot: Snapshot): number,\n\n /** {@link ItemOffsetMapping} which describes sizes and offsets to start of rows */\n getRowItemOffsetMapping(snapshot: Snapshot): ItemOffsetMapping,\n\n /** Number of columns in the spreadsheet */\n getColumnCount(snapshot: Snapshot): number,\n\n /** {@link ItemOffsetMapping} which describes sizes and offsets to start of columns */\n getColumnItemOffsetMapping(snapshot: Snapshot): ItemOffsetMapping,\n\n /** Value of specified cell using 0-based row and column indexes */\n getCellValue(snapshot: Snapshot, row: number, column: number): CellValue;\n\n /** Format of specified cell using 0-based row and column indexes */\n getCellFormat(snapshot: Snapshot, row: number, column: number): string | undefined;\n\n /** Set value and format of specified cell\n * \n * @returns `Ok` if the change was successfully applied\n */\n setCellValueAndFormat(row: number, column: number, value: CellValue, format: string | undefined): ResultAsync<void,SpreadsheetDataError>\n\n /** Check whether value and format are valid to set for specified cell\n * \n * @returns `Ok` if the value and format are valid\n */\n isValidCellValueAndFormat(row: number, column: number, value: CellValue, format: string | undefined): Result<void,ValidationError>\n}\n\nconst rowItemOffsetMapping = new FixedSizeItemOffsetMapping(30);\nconst columnItemOffsetMapping = new FixedSizeItemOffsetMapping(100);\n\nexport class EmptySpreadsheetData implements SpreadsheetData<number> {\n subscribe(_onDataChange: () => void) { return () => {}; }\n getSnapshot() { return 0; }\n \n getLoadStatus(_snapshot: number): Result<boolean,StorageError> { return ok(true); }\n getRowCount(_snapshot: number) { return 0; }\n getRowItemOffsetMapping(_snapshot: number): ItemOffsetMapping { return rowItemOffsetMapping; }\n getColumnCount(_snapshot: number) { return 0; }\n getColumnItemOffsetMapping(_snapshot: number): ItemOffsetMapping { return columnItemOffsetMapping; }\n getCellValue(_snapshot: number, _row: number, _column: number): CellValue { return null; }\n getCellFormat(_snapshot: number, _row: number, _column: number): string|undefined { return undefined; }\n setCellValueAndFormat(_row: number, _column: number, _value: CellValue, _format: string | undefined): ResultAsync<void,SpreadsheetDataError> \n { return errAsync(storageError(\"Not implemented\", 501)); }\n isValidCellValueAndFormat(_row: number, _column: number, _value: CellValue, _format: string | undefined): Result<void,ValidationError> \n { return ok(); }\n}\n\n","/** Classic Spreadsheet reference to Column (e.g \"A\") */\nexport type ColRef = string;\n\n/** Classic Spreadsheet reference to Cell (e.g. \"A1\"), Row (e.g. \"1\") or Column (e.g \"A\") */\nexport type RowColRef = string;\n\n/** Equivalent to {@link RowColRef} as coordinate pair. \"A1\" has coords [0,0], \"1\" is [0,undefined] and \"A\" is [undefined,0] */\nexport type RowColCoords = [row: number|undefined, col: number|undefined];\n\n/** Converts a {@link ColRef} to the 0-based index of the column */\nexport function colRefToIndex(col: ColRef): number {\n let n = 0;\n for (let i = 0; i < col.length; i ++) {\n n = col.charCodeAt(i) - 64 + n * 26;\n }\n return n-1;\n}\n\n/** Converts a 0-based column index to a {@link ColRef} */\nexport function indexToColRef(index: number): ColRef {\n let ret = \"\";\n index ++;\n while (index > 0) {\n index --;\n const remainder = index % 26;\n index = Math.floor(index / 26);\n ret = String.fromCharCode(65+remainder) + ret;\n }\n return ret;\n}\n\n/** Splits a RowColRef into a 0-based row index and a {@link ColRef} */\nexport function splitRowColRef(ref: RowColRef): [row: number|undefined, col: ColRef|undefined] {\n const re = /^([A-Z]*)(\\d*)$/;\n const found = ref.match(re);\n if (!found)\n return [undefined,undefined];\n\n const col = found[1];\n const row = found[2] ? parseInt(found[2]) : 0;\n return [(row>0) ? row-1 : undefined, col ? col : undefined];\n}\n\n/** Converts a {@link RowColRef} to {@link RowColCoords} */\nexport function rowColRefToCoords(ref: RowColRef): RowColCoords {\n const [row,col] = splitRowColRef(ref);\n return [row, col ? colRefToIndex(col) : undefined];\n}\n\n/** Converts {@link RowColCoords} to a {@link RowColRef} */\nexport function rowColCoordsToRef(row: number|undefined, col: number|undefined): RowColRef {\n if (row !== undefined) {\n if (col !== undefined) {\n return indexToColRef(col) + (row+1);\n } else {\n return (row+1).toString();\n }\n } else {\n if (col !== undefined) {\n return indexToColRef(col);\n } else {\n return \"\";\n }\n }\n}"],"names":["neverthrow_ok","neverthrow_err","neverthrow_ResultAsync","neverthrow_okAsync","neverthrow_errAsync"],"mappings":";;AA0EM,SAAU,EAAE,CAAe,KAAQ,EAAA;AACvC,IAAA,OAAOA,IAAa,CAAM,KAAK,CAAC;AAClC;AA0CM,SAAU,GAAG,CAAyB,GAAM,EAAA;AAChD,IAAA,OAAOC,KAAc,CAAM,GAAG,CAAC;AACjC;;AClHA;;;;;;;;;;;;;AAaG;AACG,MAAO,WAAiB,SAAQC,aAA2B,CAAA;AAAG;AAa9D,SAAU,OAAO,CAAe,KAAQ,EAAA;AAC5C,IAAA,OAAOC,SAAkB,CAAC,KAAK,CAAC;AAClC;AAaM,SAAU,QAAQ,CAAyB,GAAM,EAAA;AACrD,IAAA,OAAOC,UAAmB,CAAM,GAAG,CAAC;AACtC;;AC/BA;AACM,SAAU,qBAAqB,CAAC,OAAe,EAAA;AACnD,IAAA,OAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,OAAO,EAAE;AACnD;AAQA;AACM,SAAU,eAAe,CAAC,OAAe,EAAA;AAC7C,IAAA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE;AAC7C;AAcA;AACgB,SAAA,YAA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E,QAAQ,EAAE;;;SAEtB;AACL,QAAA,IAAI,GAAG,KAAK,SAAS,EAAE;AACrB,YAAA,OAAO,aAAa,CAAC,GAAG,CAAC;;aACpB;AACL,YAAA,OAAO,EAAE;;;AAGf;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@candidstartup/infinisheet-types",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"description": "Common types for the InfiniSheet packages",
|
|
6
6
|
"author": "Tim Wiegand <tim.wiegand@thecandidstartup.org>",
|
|
7
7
|
"license": "BSD-3-Clause",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"neverthrow": "^8.2.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "03b639807d367f0c167dc5b6653b3935412cbde8"
|
|
56
56
|
}
|