@constructive-io/sheets 0.14.1 → 0.15.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.
Files changed (60) hide show
  1. package/README.md +231 -157
  2. package/dist/advanced.cjs +7192 -3840
  3. package/dist/advanced.cjs.map +1 -1
  4. package/dist/advanced.d.cts +2 -2
  5. package/dist/advanced.d.ts +2 -2
  6. package/dist/advanced.js +5 -5
  7. package/dist/auth.cjs.map +1 -1
  8. package/dist/auth.js +3 -3
  9. package/dist/chunk-CJ4PRA64.js +312 -0
  10. package/dist/chunk-CJ4PRA64.js.map +1 -0
  11. package/dist/chunk-II3MSNRO.js +18 -0
  12. package/dist/chunk-II3MSNRO.js.map +1 -0
  13. package/dist/{chunk-BYAYBXVB.js → chunk-J7KK4UWI.js} +6 -6
  14. package/dist/chunk-MBSHDF55.js +839 -0
  15. package/dist/chunk-MBSHDF55.js.map +1 -0
  16. package/dist/chunk-MOFFS5WQ.js +128 -0
  17. package/dist/chunk-MOFFS5WQ.js.map +1 -0
  18. package/dist/chunk-VCBY2AMT.js +8920 -0
  19. package/dist/chunk-VCBY2AMT.js.map +1 -0
  20. package/dist/{chunk-YJZFHL2D.js → chunk-ZOQDSOMO.js} +50 -312
  21. package/dist/chunk-ZOQDSOMO.js.map +1 -0
  22. package/dist/date-editor-ORCB43ZM.js +346 -0
  23. package/dist/date-editor-ORCB43ZM.js.map +1 -0
  24. package/dist/{grid-cell-types-C2-ocDS7.d.cts → grid-cell-types-YNIVK4hN.d.cts} +71 -18
  25. package/dist/{grid-cell-types-C2-ocDS7.d.ts → grid-cell-types-YNIVK4hN.d.ts} +71 -18
  26. package/dist/index.cjs +22733 -12052
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.cts +1432 -266
  29. package/dist/index.d.ts +1432 -266
  30. package/dist/index.js +12688 -6097
  31. package/dist/index.js.map +1 -1
  32. package/dist/sheets-context-Bb7ZoNBg.d.cts +436 -0
  33. package/dist/sheets-context-CPuf31LS.d.ts +436 -0
  34. package/dist/testing.cjs +1170 -589
  35. package/dist/testing.cjs.map +1 -1
  36. package/dist/testing.d.cts +80 -11
  37. package/dist/testing.d.ts +80 -11
  38. package/dist/testing.js +778 -147
  39. package/dist/testing.js.map +1 -1
  40. package/package.json +4 -5
  41. package/dist/chunk-4EZ6A23C.js +0 -44
  42. package/dist/chunk-4EZ6A23C.js.map +0 -1
  43. package/dist/chunk-6Y7CZ5VS.js +0 -168
  44. package/dist/chunk-6Y7CZ5VS.js.map +0 -1
  45. package/dist/chunk-BGL6EBTE.js +0 -446
  46. package/dist/chunk-BGL6EBTE.js.map +0 -1
  47. package/dist/chunk-ER3FIDK7.js +0 -4383
  48. package/dist/chunk-ER3FIDK7.js.map +0 -1
  49. package/dist/chunk-GZM2CSTR.js +0 -279
  50. package/dist/chunk-GZM2CSTR.js.map +0 -1
  51. package/dist/chunk-X7DHTSOX.js +0 -21
  52. package/dist/chunk-X7DHTSOX.js.map +0 -1
  53. package/dist/chunk-YJZFHL2D.js.map +0 -1
  54. package/dist/date-editor-G26WKILO.js +0 -358
  55. package/dist/date-editor-G26WKILO.js.map +0 -1
  56. package/dist/map-picker-ZUGGOIZS.js +0 -290
  57. package/dist/map-picker-ZUGGOIZS.js.map +0 -1
  58. package/dist/sheets-context-CHUVJCff.d.ts +0 -245
  59. package/dist/sheets-context-C_MkTxXm.d.cts +0 -245
  60. /package/dist/{chunk-BYAYBXVB.js.map → chunk-J7KK4UWI.js.map} +0 -0
@@ -0,0 +1,436 @@
1
+ import * as react from 'react';
2
+ import { QueryClient } from '@tanstack/react-query';
3
+ import { TypedDocumentString, ColumnValueKind, ColumnSemantic, ColumnModel, SortSpec, TableModel, DisplayFieldOverrides, MetaQuery, MutationOptions } from '@constructive-io/data';
4
+ import { DocumentNode } from 'graphql';
5
+ import { b as CellType, S as SheetsCell, C as CellCreationMetadata, c as CellCategory, E as EditorProps, d as SheetsRowIdentifier } from './grid-cell-types-YNIVK4hN.js';
6
+
7
+ type ExecutableDocument = TypedDocumentString<any, any> | DocumentNode | string | unknown;
8
+ /** Per-request options. An executor that does not support one ignores it. */
9
+ interface SheetsExecuteOptions {
10
+ /** Aborts the request, for example when the filter or sort it was for has changed. */
11
+ signal?: AbortSignal;
12
+ }
13
+ type SheetsExecuteFn = <T = unknown>(document: ExecutableDocument, variables?: Record<string, unknown>, options?: SheetsExecuteOptions) => Promise<T>;
14
+ /** Durable file metadata for image and upload columns. */
15
+ interface SheetsFileValue {
16
+ id: string;
17
+ key: string;
18
+ bucket_id: string;
19
+ mime: string;
20
+ size: number;
21
+ filename: string;
22
+ /** Public URL supplied by storage, when available. */
23
+ url?: string;
24
+ }
25
+ interface SheetsUploadResult {
26
+ file: SheetsFileValue;
27
+ /** Optional download URL for immediate use. It can expire. */
28
+ url?: string;
29
+ }
30
+ /**
31
+ * Optional upload metadata carried through the seam (third arg). Lets an
32
+ * injected `executeUpload` see the destination field/row and report progress.
33
+ * All fields optional, so existing `(file, path?)` callers stay valid.
34
+ */
35
+ interface SheetsUploadOptions {
36
+ tableName?: string;
37
+ fieldName?: string;
38
+ recordId?: string | number;
39
+ onProgress?: (progress: {
40
+ loaded: number;
41
+ total: number;
42
+ percentage: number;
43
+ }) => void;
44
+ }
45
+ type SheetsUploadFn = (file: File, path?: string, options?: SheetsUploadOptions) => Promise<SheetsUploadResult>;
46
+ /** One error of a GraphQL response. */
47
+ interface SheetsResponseError {
48
+ message: string;
49
+ path?: ReadonlyArray<string | number>;
50
+ extensions?: {
51
+ code?: string;
52
+ context?: Record<string, unknown>;
53
+ };
54
+ }
55
+ /** The data a response carried beside its errors. */
56
+ interface SheetsPartialResult {
57
+ data: unknown;
58
+ errors: readonly SheetsResponseError[];
59
+ }
60
+ /** Every error of the response an error was thrown for, or null when it did not come from a GraphQL response. */
61
+ declare function responseErrorsOf(error: unknown): readonly SheetsResponseError[] | null;
62
+ /** The data an error's response carried, or null. */
63
+ declare function partialResultOf(error: unknown): SheetsPartialResult | null;
64
+ declare function createSheetsExecute(config: SheetsConfig, getToken: () => string | null): SheetsExecuteFn;
65
+ /** Creates an uploader for storage. Direct callers may use the supplied endpoint as storage. */
66
+ declare function createSheetsUpload(config: SheetsConfig, getToken: () => string | null): SheetsUploadFn;
67
+
68
+ /**
69
+ * Injectable logger seam for @constructive-io/sheets.
70
+ *
71
+ * The host app may provide a custom logger via SheetsConfig.logger. The provider
72
+ * installs it into this module singleton (see sheets-provider.tsx), so any module
73
+ * or hook can log without threading the logger through props/context.
74
+ *
75
+ * Default behaviour matches the prior console.* calls. `debug` is omitted from the
76
+ * default logger (no-op) so verbose diagnostics stay silent unless a host opts in.
77
+ */
78
+ interface SheetsLogger {
79
+ debug?(msg: string, ctx?: unknown): void;
80
+ warn(msg: string, ctx?: unknown): void;
81
+ error(msg: string, ctx?: unknown): void;
82
+ }
83
+
84
+ /** Smallest render-column descriptor a cell view needs now. Overridable. */
85
+ interface CellColumnDescriptor {
86
+ key: string;
87
+ name: string;
88
+ cellType: CellType;
89
+ }
90
+ /** Props every native cell view receives. Minimal and overridable. */
91
+ interface CellProps {
92
+ cell: SheetsCell;
93
+ value: unknown;
94
+ colKey: string;
95
+ rowId: string;
96
+ rowIndex: number;
97
+ column: CellColumnDescriptor;
98
+ isEditing: boolean;
99
+ onStartEdit: () => void;
100
+ disabled: boolean;
101
+ readOnlyReason?: string;
102
+ /** True when this is the grid's active (keyboard cursor) cell; a view may then offer actions (for example open a linked record). */
103
+ isActive?: boolean;
104
+ }
105
+
106
+ /** Schema-only inputs used to DETECT a cell type. Never the runtime value. */
107
+ interface CellTypeMatchInput {
108
+ gqlType: string;
109
+ isArray: boolean;
110
+ /** @deprecated The server no longer sends it; match on `kind`, `semantic` or `column` instead. */
111
+ pgAlias?: string | null;
112
+ pgType?: string | null;
113
+ subtype?: string | null;
114
+ fieldName?: string;
115
+ /** Value kind from the table model, or null when the cell is not a table-model column. */
116
+ kind?: ColumnValueKind | null;
117
+ /** Presentation hint from the table model (email, url, image, ...), or null. */
118
+ semantic?: ColumnSemantic | null;
119
+ /** The full table-model column, or null when the cell is not a table-model column. */
120
+ column?: ColumnModel | null;
121
+ }
122
+ /** Context handed to `toSheetsCell` so a definition can build the neutral cell.
123
+ * Geometry uses the built-in fallback, so no `createGeometry` callback is needed. */
124
+ interface SheetsCellRenderContext {
125
+ metadata: CellCreationMetadata;
126
+ }
127
+ interface CellTypeDefinition<TValue = unknown> {
128
+ /** Stable key. A def whose typeKey equals a built-in (e.g. 'relation') overrides it. */
129
+ typeKey: string;
130
+ category?: CellCategory;
131
+ /** Toolbar / type-picker icon. */
132
+ icon?: React.ComponentType<{
133
+ size?: number;
134
+ }>;
135
+ defaultWidth?: number;
136
+ supportsInlineEdit?: boolean;
137
+ /** DETECTION (schema-only). Highest-priority match wins; omit for typeKey-only. */
138
+ match?: (meta: CellTypeMatchInput) => boolean;
139
+ /** Native DISPLAY. Build the neutral SheetsCell. Omit to keep the built-in renderer. */
140
+ toSheetsCell?: (value: TValue, ctx: SheetsCellRenderContext) => SheetsCell;
141
+ /** Native cell COMPONENT override (the slot target). Omit to keep the built-in view. */
142
+ cell?: React.ComponentType<CellProps>;
143
+ /** Native EDITOR override (DOM portal overlay). Omit to keep the built-in native editor. */
144
+ editorComponent?: React.ComponentType<EditorProps>;
145
+ /** Value -> display/copy/export string. */
146
+ format?: (value: TValue) => string;
147
+ defaultValue?: () => TValue;
148
+ }
149
+ /** Identity helper that pins the generic — `defineCellType<number>({ ... })`. */
150
+ declare function defineCellType<T = unknown>(def: CellTypeDefinition<T>): CellTypeDefinition<T>;
151
+ /** A named bundle of cell types, registered via `SheetsConfig.plugins`. */
152
+ interface CellTypePlugin {
153
+ name: string;
154
+ cellTypes: CellTypeDefinition<any>[];
155
+ }
156
+
157
+ /** The table being operated on. */
158
+ interface AdapterTableContext {
159
+ /** Model of the table (`useTableModel`, `fetchTableModel`). Every document the built-in adapter sends is built from it. */
160
+ model: TableModel;
161
+ /** The table name or `TableModel.key` the caller used. */
162
+ tableName: string;
163
+ }
164
+ /** A normalized list query. */
165
+ interface AdapterListQuery {
166
+ /** A filter in the server's filter input shape. */
167
+ where?: Readonly<Record<string, unknown>>;
168
+ /** Sort, first entry first. Each field must be a sortable column of the model. */
169
+ orderBy?: readonly SortSpec[];
170
+ /** Page size. */
171
+ limit?: number;
172
+ /** Rows to skip. */
173
+ offset?: number;
174
+ /** Relay cursor for forward pagination (infinite/cursor mode). */
175
+ after?: string;
176
+ /** Relation fields to select: every readable relation, none (the default), or these field names. */
177
+ relations?: 'all' | 'none' | readonly string[];
178
+ /**
179
+ * Columns to select, for example the ones a view shows. The primary key and the
180
+ * local key fields of the selected relations are always added. Omitted: every readable column.
181
+ */
182
+ columns?: readonly string[];
183
+ /** Page size of list relations. */
184
+ relationPageSize?: number;
185
+ /** Count all matching rows. Default true. When false, `totalCount` is the number of rows returned. */
186
+ includeTotalCount?: boolean;
187
+ /** Aborts the request, for example when the filter or sort it was for has changed. */
188
+ signal?: AbortSignal;
189
+ }
190
+ interface AdapterPageInfo {
191
+ endCursor?: string | null;
192
+ startCursor?: string | null;
193
+ hasNextPage?: boolean;
194
+ hasPreviousPage?: boolean;
195
+ }
196
+ interface AdapterListResult<T = Record<string, unknown>> {
197
+ rows: T[];
198
+ totalCount: number;
199
+ pageInfo?: AdapterPageInfo;
200
+ }
201
+ interface AdapterTableModelOptions {
202
+ /** Host override for the fields that label a record. */
203
+ displayOverrides?: DisplayFieldOverrides;
204
+ }
205
+ interface SheetsBackendAdapter {
206
+ /** Read the schema metadata. The default adapter checks and runs the July 2026 `_meta` contract. */
207
+ fetchMeta(execute: SheetsExecuteFn): Promise<MetaQuery>;
208
+ /**
209
+ * Model one table of a `_meta` result, by `TableModel.key` or bare name. A
210
+ * failure concerns that table only; other tables keep loading.
211
+ */
212
+ fetchTableModel(execute: SheetsExecuteFn, meta: MetaQuery, tableRef: string, options?: AdapterTableModelOptions): Promise<TableModel>;
213
+ /** Read a page of rows, flattening relation connections into arrays. */
214
+ listRows<T = Record<string, unknown>>(ctx: AdapterTableContext, query: AdapterListQuery, execute: SheetsExecuteFn): Promise<AdapterListResult<T>>;
215
+ /** Create a row; resolves to the created row (or null). */
216
+ createRow<T = Record<string, unknown>>(ctx: AdapterTableContext, data: Record<string, unknown>, execute: SheetsExecuteFn, options?: MutationOptions): Promise<T | null>;
217
+ /** Update a row by its primary key (a scalar for a one-field key, or the key object); resolves to the updated row (or null). */
218
+ updateRow<T = Record<string, unknown>>(ctx: AdapterTableContext, id: SheetsRowIdentifier, patch: Record<string, unknown>, execute: SheetsExecuteFn, options?: MutationOptions): Promise<T | null>;
219
+ /** Delete a row by its primary key (a scalar for a one-field key, or the key object). */
220
+ deleteRow(ctx: AdapterTableContext, id: SheetsRowIdentifier, execute: SheetsExecuteFn, options?: MutationOptions): Promise<void>;
221
+ }
222
+
223
+ /** Per-column upload choices. Each field overrides the matching top-level field. */
224
+ interface SheetsUploadColumnConfig {
225
+ /** Files table (GraphQL type name) to upload into, when the server does not bind the column to one. */
226
+ filesType?: string;
227
+ /** Bucket key to upload into. */
228
+ bucketKey?: string;
229
+ /** Which default bucket to use when no bucket key is set: the public one (true) or the private one (false). */
230
+ isPublic?: boolean;
231
+ /** Owner id for a files table whose uploads need one. */
232
+ ownerId?: string;
233
+ }
234
+ /** How long Sheets keeps retrying a cell write while the server confirms a new file. */
235
+ interface SheetsUploadProcessingConfig {
236
+ /** Give up and offer a manual retry after this long. Default 120 000 ms. */
237
+ timeoutMs?: number;
238
+ /** First wait between attempts. Doubles up to `maxDelayMs`. Default 1 000 ms. */
239
+ initialDelayMs?: number;
240
+ /** Longest wait between attempts. Default 8 000 ms. */
241
+ maxDelayMs?: number;
242
+ }
243
+ interface SheetsUploadConfig {
244
+ /** Bucket key to upload into. Omit to use the default bucket chosen by `isPublic`. */
245
+ bucketKey?: string;
246
+ /** Which default bucket to use when no bucket key is set. Default true (the public default bucket). */
247
+ isPublic?: boolean;
248
+ /** Owner id sent when a files table needs one (entity-scoped storage). */
249
+ ownerId?: string;
250
+ /**
251
+ * Files table (GraphQL type name) for file columns the server does not bind,
252
+ * when the storage service has several files tables.
253
+ */
254
+ filesType?: string;
255
+ /** Per-column choices, keyed by `TableModel.key` or table name, then by column name. */
256
+ columns?: Readonly<Record<string, Readonly<Record<string, SheetsUploadColumnConfig>>>>;
257
+ /** Retry window for a write that waits on the server's file confirmation. */
258
+ processing?: SheetsUploadProcessingConfig;
259
+ }
260
+ /** The choices that apply to one column, after per-column entries are merged over the top level. */
261
+ interface ResolvedUploadChoices {
262
+ filesType: string | null;
263
+ bucketKey: string | null;
264
+ /** The access the default bucket is chosen by. Ignored by the server when a bucket key is set. */
265
+ isPublic: boolean;
266
+ ownerId: string | null;
267
+ }
268
+ interface ProcessingPolicy {
269
+ timeoutMs: number;
270
+ initialDelayMs: number;
271
+ maxDelayMs: number;
272
+ }
273
+
274
+ /**
275
+ * Where saved views are kept.
276
+ *
277
+ * A host passes its own `SheetsViewStorage` as `SheetsConfig.views` (server
278
+ * storage, for example); otherwise the grid keeps views in this browser's
279
+ * local storage, keyed by endpoint, database, identity and table. A stored
280
+ * state is never trusted: the grid validates it against the current table model
281
+ * when it loads (see `validateSheetsViewState`).
282
+ */
283
+ /** Which table's views, for whom. */
284
+ interface SheetsViewStorageScope {
285
+ endpoint: string;
286
+ databaseId: string | null;
287
+ /** The signed-in identity the host reports, or null. */
288
+ identityKey: string | null;
289
+ /** `TableModel.key` of the table. */
290
+ tableKey: string;
291
+ }
292
+ /** One saved view as stored. */
293
+ interface SheetsStoredView {
294
+ id: string;
295
+ name: string;
296
+ /** A `SheetsViewState` when it was saved; validated against the model on load. */
297
+ state: unknown;
298
+ /** ISO timestamp of the last save. */
299
+ updatedAt: string;
300
+ }
301
+ interface SheetsViewStorage {
302
+ /** Every saved view of one table. */
303
+ list(scope: SheetsViewStorageScope): Promise<readonly SheetsStoredView[]>;
304
+ /** Create or replace a view by id. */
305
+ save(scope: SheetsViewStorageScope, view: SheetsStoredView): Promise<void>;
306
+ /** Delete a view by id. */
307
+ remove(scope: SheetsViewStorageScope, viewId: string): Promise<void>;
308
+ /** The view last selected for this table, or null. Optional: without it no view is restored on load. */
309
+ getActiveViewId?(scope: SheetsViewStorageScope): Promise<string | null>;
310
+ setActiveViewId?(scope: SheetsViewStorageScope, viewId: string | null): Promise<void>;
311
+ }
312
+ /** The part of `Storage` this module uses (local storage, or a test double). */
313
+ interface KeyValueStore {
314
+ getItem(key: string): string | null;
315
+ setItem(key: string, value: string): void;
316
+ }
317
+ /**
318
+ * Views in a key-value store, one entry per table scope. Entries that cannot be
319
+ * read are skipped, so one bad entry never loses the others.
320
+ */
321
+ declare function createKeyValueViewStorage(store: KeyValueStore): SheetsViewStorage;
322
+ /** Views kept in memory for this page only (no browser storage, or tests). */
323
+ declare function createMemoryViewStorage(): SheetsViewStorage;
324
+
325
+ /** Map tiles: an `https` URL template with `{z}`, `{x}` and `{y}` (and `{s}` for subdomains), and the attribution the provider requires. */
326
+ interface SheetsMapTiles {
327
+ url: string;
328
+ /** Attribution HTML shown on the map, as the tile provider requires. It is host-supplied, trusted markup. */
329
+ attribution: string;
330
+ /** Letters for `{s}` in the URL (default "abc"). */
331
+ subdomains?: string;
332
+ }
333
+ /** Place search: an endpoint that answers like Nominatim's `/search` (`format=json`: `display_name`, `lat`, `lon`, `place_id`). */
334
+ interface SheetsMapPlaceSearch {
335
+ url: string;
336
+ }
337
+ interface SheetsMapConfig {
338
+ /** Map tiles, or `'off'` to edit shapes as GeoJSON text only. Default: OpenStreetMap. */
339
+ tiles?: SheetsMapTiles | 'off';
340
+ /** Place search for the map's search box, or `'off'` for no search box. Default: OpenStreetMap Nominatim. */
341
+ placeSearch?: SheetsMapPlaceSearch | 'off';
342
+ }
343
+
344
+ interface SheetsAuthEmbedded {
345
+ mode: 'embedded';
346
+ getToken: () => string | null;
347
+ /**
348
+ * Stable, non-secret identity used to isolate cached data between users.
349
+ * Hosts should return the authenticated user/session id, never the token.
350
+ * When omitted, the provider uses an opaque key that changes with the token.
351
+ */
352
+ getIdentityKey?: () => string | null;
353
+ }
354
+ interface SheetsAuthStandalone {
355
+ mode: 'standalone';
356
+ }
357
+ interface SheetsStorageTransport {
358
+ endpoint: string;
359
+ execute: SheetsExecuteFn;
360
+ }
361
+ interface SheetsConfig {
362
+ /** Data endpoint (app-public GraphQL) */
363
+ endpoint: string;
364
+ /** Auth endpoint (auth GraphQL) — required for standalone mode */
365
+ authEndpoint?: string;
366
+ /** Database ID for multi-tenant scoping */
367
+ databaseId?: string;
368
+ /** Auth mode */
369
+ auth: SheetsAuthEmbedded | SheetsAuthStandalone;
370
+ /** Field type overrides (replaces schema-builder smart tags) */
371
+ fieldTypeOverrides?: Record<string, string>;
372
+ /**
373
+ * Fields that label a record of a table (relation chips, pickers, record
374
+ * titles), keyed by `TableModel.key` or table name, in priority order.
375
+ * Tables without an entry use the built-in display rule.
376
+ */
377
+ displayFields?: DisplayFieldOverrides;
378
+ /** Optional: BCP-47 locale for locale-aware date/number formatting (default 'en-US'). */
379
+ locale?: string;
380
+ /**
381
+ * The geometry editor's map: tile URL and attribution, and the place search endpoint.
382
+ * Default: OpenStreetMap tiles and Nominatim search. `tiles: 'off'` edits shapes as
383
+ * GeoJSON text; `placeSearch: 'off'` removes the search box. With a
384
+ * Content-Security-Policy, allow the tile host in `img-src` and the search endpoint in
385
+ * `connect-src`.
386
+ */
387
+ map?: SheetsMapConfig;
388
+ /** Optional: inject custom execute function */
389
+ execute?: SheetsExecuteFn;
390
+ /** Optional: inject custom upload function */
391
+ executeUpload?: SheetsUploadFn;
392
+ /** Storage endpoint for media uploads and download URL lookups. */
393
+ storage?: {
394
+ endpoint: string;
395
+ execute?: SheetsExecuteFn;
396
+ };
397
+ /** Upload choices (bucket, owner, files table, per-column overrides); every field is optional. */
398
+ upload?: SheetsUploadConfig;
399
+ /**
400
+ * Where saved views are kept. Default: this browser's local storage, keyed by endpoint,
401
+ * database, identity and table. A host can supply server storage.
402
+ */
403
+ views?: SheetsViewStorage;
404
+ /** Optional: inject existing QueryClient */
405
+ queryClient?: QueryClient;
406
+ /** Optional: inject a custom backend adapter. Defaults to the PostGraphile adapter. */
407
+ adapter?: SheetsBackendAdapter;
408
+ /** Optional: provider-level cell-type plugins (consumer override layer). */
409
+ plugins?: CellTypePlugin[];
410
+ /** Called on 401/UNAUTHENTICATED before the error is thrown. Host app handles token cleanup. */
411
+ onAuthError?: () => void;
412
+ /** Optional: inject a custom logger. Installed into the module logger singleton by the provider. */
413
+ logger?: SheetsLogger;
414
+ /** Optional: called when a grid/editor/mutation/upload error surfaces. Host app handles reporting. */
415
+ onError?: (error: unknown, ctx?: {
416
+ source?: 'grid' | 'editor' | 'mutation' | 'upload';
417
+ tableName?: string;
418
+ }) => void;
419
+ }
420
+ interface SheetsContextValue {
421
+ config: SheetsConfig;
422
+ execute: SheetsExecuteFn;
423
+ executeUpload: SheetsUploadFn;
424
+ storage?: SheetsStorageTransport;
425
+ canUpload: boolean;
426
+ scopeKey: SheetsScopeKey;
427
+ }
428
+ interface SheetsScopeKey {
429
+ databaseId: string | null;
430
+ endpoint: string;
431
+ identityKey: string | null;
432
+ }
433
+ declare const SheetsContext: react.Context<SheetsContextValue | null>;
434
+ declare function useSheetsContext(): SheetsContextValue;
435
+
436
+ export { type AdapterListQuery as A, type SheetsStoredView as B, type CellProps as C, type SheetsUploadColumnConfig as D, type SheetsUploadConfig as E, type SheetsUploadProcessingConfig as F, type SheetsUploadResult as G, type SheetsViewStorage as H, type SheetsViewStorageScope as I, createKeyValueViewStorage as J, type KeyValueStore as K, createMemoryViewStorage as L, createSheetsExecute as M, createSheetsUpload as N, defineCellType as O, type ProcessingPolicy as P, partialResultOf as Q, type ResolvedUploadChoices as R, type SheetsExecuteFn as S, responseErrorsOf as T, useSheetsContext as U, type SheetsUploadFn as a, type SheetsConfig as b, type CellTypeDefinition as c, type SheetsCellRenderContext as d, type CellTypeMatchInput as e, type SheetsScopeKey as f, type SheetsBackendAdapter as g, type SheetsStorageTransport as h, type AdapterListResult as i, type AdapterPageInfo as j, type AdapterTableContext as k, type AdapterTableModelOptions as l, type CellColumnDescriptor as m, type CellTypePlugin as n, type SheetsAuthEmbedded as o, type SheetsAuthStandalone as p, SheetsContext as q, type SheetsContextValue as r, type SheetsExecuteOptions as s, type SheetsFileValue as t, type SheetsLogger as u, type SheetsMapConfig as v, type SheetsMapPlaceSearch as w, type SheetsMapTiles as x, type SheetsPartialResult as y, type SheetsResponseError as z };