@graphite-sports/sdk 0.1.0 → 0.2.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 (2) hide show
  1. package/index.d.ts +661 -124
  2. package/package.json +4 -1
package/index.d.ts CHANGED
@@ -1,34 +1,221 @@
1
1
  import { ChangeEventHandler } from 'react';
2
+ import { ColumnDef } from '@tanstack/react-table';
3
+ import { ColumnHelper } from '@tanstack/table-core';
4
+ import { ComponentProps } from 'react';
5
+ import { CSSProperties } from 'react';
2
6
  import type { DataTag } from '@tanstack/react-query';
3
- import type { FC } from 'react';
7
+ import { FC } from 'react';
4
8
  import { FocusEventHandler } from 'react';
5
9
  import { HTMLInputTypeAttribute } from 'react';
6
10
  import { JSX } from 'react/jsx-runtime';
7
11
  import { KeyboardEventHandler } from 'react';
12
+ import { default as React_2 } from 'react';
13
+ import * as React_3 from 'react';
8
14
  import { ReactNode } from 'react';
9
15
  import type { Ref } from 'react';
10
16
  import { RefObject } from 'react';
17
+ import { RowData } from '@tanstack/react-table';
18
+ import { RowModel } from '@tanstack/table-core';
19
+ import { SortingState } from '@tanstack/react-table';
20
+ import { Tab } from '@headlessui/react';
21
+ import { TabGroup } from '@headlessui/react';
22
+ import { Table as Table_2 } from '@tanstack/table-core';
23
+ import { TableFeature } from '@tanstack/table-core';
24
+ import { TabList } from '@headlessui/react';
25
+ import { TabPanel } from '@headlessui/react';
26
+ import { TabPanels } from '@headlessui/react';
11
27
  import { toast } from 'react-hot-toast';
12
28
  import type { UnusedSkipTokenOptions } from '@tanstack/react-query';
13
29
 
14
- declare type AnyQuerySchema = QuerySchema<QueryFields>;
30
+ export declare type AnyQuerySchema = QuerySchema<QueryFields>;
15
31
 
16
- export declare function AppButton({ type, onClick, disabled: disabledProp, mutates, children, submit, className, loading, value, ref, href, }: Props): JSX.Element;
32
+ export declare function AppButton({ type, onClick, disabled: disabledProp, mutates, children, submit, className, loading, value, ref, href, }: AppButtonProps): JSX.Element;
17
33
 
18
- declare type AppButtonType = 'primary' | 'secondary' | 'danger';
34
+ export declare type AppButtonProps = {
35
+ type?: AppButtonType;
36
+ onClick?: () => void;
37
+ disabled?: boolean;
38
+ /** Disabled while read-only (see `useIsReadonly`). */
39
+ mutates?: boolean;
40
+ children?: ReactNode;
41
+ submit?: boolean;
42
+ className?: string;
43
+ loading?: boolean;
44
+ value?: string;
45
+ ref?: RefObject<HTMLButtonElement | null>;
46
+ /** Makes the button a link to this route, so it can also be opened in a new tab. `onClick` runs before routing. */
47
+ href?: string;
48
+ };
49
+
50
+ export declare type AppButtonType = 'primary' | 'secondary' | 'danger';
51
+
52
+ export declare function AppCheckbox(props: AppCheckboxProps): JSX.Element;
53
+
54
+ export declare type AppCheckboxProps = {
55
+ checked: boolean;
56
+ onChange?(checked: boolean): void;
57
+ name?: string;
58
+ disabled?: boolean;
59
+ tabIndex?: number;
60
+ label?: string | React_2.ReactNode;
61
+ description?: string | React_2.ReactNode;
62
+ stopPropagation?: boolean;
63
+ readonly?: boolean;
64
+ };
65
+
66
+ export declare function AppDisclosure({ header, children, className, defaultOpen, transition, chevron, }: AppDisclosureProps): JSX.Element;
67
+
68
+ export declare type AppDisclosureProps = {
69
+ header: ReactNode;
70
+ children: ReactNode;
71
+ className?: string;
72
+ defaultOpen?: boolean;
73
+ transition?: boolean;
74
+ chevron?: boolean;
75
+ };
19
76
 
20
77
  export declare const AppInput: {
21
- ({ ref, inputRef, ...props }: Props_2 & {
78
+ ({ ref, inputRef, ...props }: AppInputProps & {
22
79
  ref?: React.RefObject<HTMLInputElement | null>;
23
80
  }): JSX.Element;
24
81
  displayName: string;
25
82
  };
26
83
 
27
- declare type ArithmeticOperator = "add" | "subtract";
84
+ export declare type AppInputProps = {
85
+ label?: string;
86
+ description?: string;
87
+ value?: string;
88
+ onChange?: ChangeEventHandler<HTMLInputElement>;
89
+ onBlur?: FocusEventHandler<HTMLInputElement>;
90
+ onFocus?: FocusEventHandler<HTMLInputElement>;
91
+ onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
92
+ type?: HTMLInputTypeAttribute;
93
+ placeholder?: string;
94
+ required?: boolean;
95
+ maxLength?: number;
96
+ pattern?: string;
97
+ disabled?: boolean;
98
+ className?: string;
99
+ tabIndex?: number;
100
+ readonly?: boolean;
101
+ layout?: InputLayout;
102
+ inputRef?: React.RefObject<HTMLInputElement | null>;
103
+ endAdornment?: ReactNode;
104
+ autoFocus?: boolean;
105
+ };
106
+
107
+ export declare function AppListbox<TVal>({ options, value, onChange, label, description, disabled, placeholder, className, direction, readonly: readonlyProp, required, }: AppListboxProps<TVal>): JSX.Element;
108
+
109
+ export declare type AppListboxProps<TVal> = {
110
+ options: Option_2<TVal>[];
111
+ value?: TVal;
112
+ onChange?: (value: TVal) => void;
113
+ label?: React_2.ReactNode;
114
+ description?: React_2.ReactNode;
115
+ placeholder?: React_2.ReactNode;
116
+ disabled?: boolean;
117
+ className?: string;
118
+ direction?: 'up' | 'down';
119
+ readonly?: boolean;
120
+ required?: boolean;
121
+ };
122
+
123
+ export declare function AppNumberInput<IsRequired extends boolean = false>({ label, description, value, onChange, min, max, integer, placeholder, required, disabled, readonly: readonlyProp, className, layout, onKeyDown, onFocus, onBlur, tabIndex, autoFocus, inputRef, }: AppNumberInputProps<IsRequired>): JSX.Element;
124
+
125
+ export declare type AppNumberInputProps<IsRequired extends boolean = false> = {
126
+ label?: string;
127
+ description?: string;
128
+ min?: number | null;
129
+ max?: number | null;
130
+ integer?: boolean;
131
+ placeholder?: string;
132
+ required?: IsRequired;
133
+ disabled?: boolean;
134
+ readonly?: boolean;
135
+ className?: string;
136
+ layout?: InputLayout;
137
+ value?: NullableUnlessRequired<number, IsRequired>;
138
+ onChange?: (value: NullableUnlessRequired<number, IsRequired>) => void;
139
+ onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
140
+ onFocus?: FocusEventHandler<HTMLInputElement>;
141
+ onBlur?: FocusEventHandler<HTMLInputElement>;
142
+ tabIndex?: number;
143
+ autoFocus?: boolean;
144
+ inputRef?: React.RefObject<HTMLInputElement | null>;
145
+ };
146
+
147
+ export declare function AppSwitch(props: AppSwitchProps): JSX.Element;
148
+
149
+ export declare type AppSwitchProps = {
150
+ checked?: boolean;
151
+ onChange?(checked: boolean): void;
152
+ name?: string;
153
+ disabled?: boolean;
154
+ tabIndex?: number;
155
+ label?: string | React_2.ReactNode;
156
+ description?: string | React_2.ReactNode;
157
+ className?: string;
158
+ readonly?: boolean;
159
+ };
160
+
161
+ export declare function AppTab({ className, ...props }: ComponentProps<typeof Tab>): JSX.Element;
28
162
 
29
- declare type ArrayValue<T = Primitive> = Value<T>[];
163
+ export declare function AppTabGroup(props: ComponentProps<typeof TabGroup>): JSX.Element;
30
164
 
31
- declare type BIB = Brand<number, 'bib'>;
165
+ export declare function AppTable<TData extends RowData>({ data, columns, actions, allowSelect, getRowId, getRowState, rowClicked, rowHref, initialPageSize, initialSorting, pageSizes, enableSorting, autoResetPageIndex, emptyTableText, columnVisibilityStorageKey, }: TableProps<TData>): JSX.Element;
166
+
167
+ export declare type AppTableFeatures = typeof appTableFeatures;
168
+
169
+ /**
170
+ * The single feature registry every `AppTable` instance uses. Shared so callers can build their
171
+ * `ColumnDef`s against the same `TFeatures` via {@link createAppTableColumnHelper}.
172
+ */
173
+ export declare const appTableFeatures: {
174
+ columnSizingFeature: TableFeature;
175
+ rowSelectionFeature: TableFeature;
176
+ rowSortingFeature: TableFeature;
177
+ sortedRowModel: (table: Table_2<any, any>) => () => RowModel<any, any>;
178
+ rowPaginationFeature: TableFeature;
179
+ paginatedRowModel: (table: Table_2<any, any>) => () => RowModel<any, any>;
180
+ columnVisibilityFeature: TableFeature;
181
+ };
182
+
183
+ export declare function AppTabList({ className, ...props }: ComponentProps<typeof TabList>): JSX.Element;
184
+
185
+ export declare function AppTabPanel({ className, ...props }: ComponentProps<typeof TabPanel>): JSX.Element;
186
+
187
+ export declare function AppTabPanels(props: ComponentProps<typeof TabPanels>): JSX.Element;
188
+
189
+ /**
190
+ * A tooltip that costs nothing until it is pointed at.
191
+ *
192
+ * `TooltipPrimitive.Root` pulls in around nine components - the tooltip and portal providers,
193
+ * the popper, its anchor, the trigger and a presence wrapper - and mounts all of them whether or
194
+ * not the tooltip will ever be shown. A node graph puts hundreds of tooltips on screen at once,
195
+ * where that machinery dominated every render of the editor. So until the pointer or the
196
+ * keyboard reaches the trigger, only `children` is mounted; the first hover or focus arms the
197
+ * real tooltip and gets replayed onto it.
198
+ */
199
+ export declare function AppTooltip({ children, content, side, open, defaultOpen, onOpenChange, className, shortcut, ...props }: AppTooltipProps): JSX.Element;
200
+
201
+ export declare interface AppTooltipProps {
202
+ children: React_3.ReactNode;
203
+ content: React_3.ReactNode;
204
+ /** The keys that do what the trigger does, shown after `content`. */
205
+ shortcut?: Shortcut;
206
+ /** Preferred side of the trigger to render against. Defaults to "top". */
207
+ side?: 'top' | 'right' | 'bottom' | 'left';
208
+ open?: boolean;
209
+ defaultOpen?: boolean;
210
+ onOpenChange?: (open: boolean) => void;
211
+ className?: string;
212
+ }
213
+
214
+ export declare type ArithmeticOperator = "add" | "subtract";
215
+
216
+ export declare type ArrayValue<T = Primitive> = Value<T>[];
217
+
218
+ export declare type BIB = Brand<number, 'bib'>;
32
219
 
33
220
  /**
34
221
  * Mirrors the backend's `domain_id!` newtype IDs (graphite-engine/src/domain_id.rs) so distinct ID
@@ -36,10 +223,13 @@ declare type BIB = Brand<number, 'bib'>;
36
223
  * `#/components/schemas/<Name>` entry in the OpenAPI schema - see the `DOMAIN_ID_NAMES` redirect in
37
224
  * generate-openapi-types.js, which points the generated schema types at these instead of `number`/`string`.
38
225
  */
39
- declare type Brand<T, B> = T & {
226
+ export declare type Brand<T, B> = T & {
40
227
  readonly __brand: B;
41
228
  };
42
229
 
230
+ /** Stable reference — a new inline `select` on every `queryOptions()` call makes React Query re-select each render. */
231
+ export declare function buildCompetitorsMapped(competitors: CompetitorDAO[]): CompetitorsMapped;
232
+
43
233
  export declare const buildRoute: <Path extends "*" | "/" | "/workspace/:workspaceId" | "/workspace/:workspaceId/event/:eventId" | "/download" | "/login" | "/register" | "/preferences" | "/crate-workspace" | "/workspace/:workspaceId/create-event" | "/workspace/:workspaceId/event/:eventId/dashboard" | "/workspace/:workspaceId/event/:eventId/create-class" | "/workspace/:workspaceId/event/:eventId/class/:classId" | "/workspace/:workspaceId/event/:eventId/create-competitor" | "/workspace/:workspaceId/event/:eventId/create-team" | "/workspace/:workspaceId/event/:eventId/competitor/:competitorId" | "/workspace/:workspaceId/event/:eventId/create-format" | "/workspace/:workspaceId/event/:eventId/format/:formatId" | "/workspace/:workspaceId/event/:eventId/format/:formatId/tests" | "/workspace/:workspaceId/event/:eventId/format/:formatId/tests/:formatTestId" | "/workspace/:workspaceId/event/:eventId/graph" | "/workspace/:workspaceId/event/:eventId/lineage" | "/workspace/:workspaceId/event/:eventId/create-game" | "/workspace/:workspaceId/event/:eventId/game/:gameId" | "/workspace/:workspaceId/event/:eventId/table/:tableId" | "/workspace/:workspaceId/event/:eventId/create-game-format" | "/workspace/:workspaceId/event/:eventId/game-format/:gameFormatId" | "/workspace/:workspaceId/event/:eventId/create-template" | "/workspace/:workspaceId/event/:eventId/template/:templateId" | "/workspace/:workspaceId/event/:eventId/extension/$extensionIdentifier">(path: Path, params: PathParams<Path>, ...query: {
44
234
  '/': undefined;
45
235
  '/download': undefined;
@@ -142,7 +332,7 @@ export declare type ClassDAO = components['schemas']['ClassDAO'];
142
332
 
143
333
  export declare type ClassId = Brand<number, 'classId'>;
144
334
 
145
- declare type ClassResponse = components['schemas']['ClassResponse'];
335
+ export declare type ClassResponse = components['schemas']['ClassResponse'];
146
336
 
147
337
  declare type CommonApiKeyId = Brand<number, 'commonApiKeyId'>;
148
338
 
@@ -152,7 +342,42 @@ export declare type CompetitorDAO = components['schemas']['CompetitorDAO'];
152
342
 
153
343
  export declare type CompetitorId = Brand<number, 'competitorId'>;
154
344
 
155
- declare type CompetitorType = components['schemas']['CompetitorType'];
345
+ export declare type CompetitorInTeamDAO = components['schemas']['CompetitorInTeamDAO'];
346
+
347
+ export declare function competitorLabel(competitorsById: ReadonlyMap<CompetitorId, CompetitorDAO>, competitorId: CompetitorId | null): string;
348
+
349
+ export declare const CompetitorNameLineSpacer: FC<{
350
+ className?: string;
351
+ }>;
352
+
353
+ /**
354
+ * Shows which competitor is picked and lets the user pick another one.
355
+ */
356
+ export declare function CompetitorSelector<IsRequired extends boolean = false>({ value, onChange, onBlurChange, required, competitorsMapped, disabled, placeholder, className, inputClassName, forbiddenCompetitorsRef, }: CompetitorSelectorProps<IsRequired>): JSX.Element;
357
+
358
+ export declare type CompetitorSelectorProps<IsRequired extends boolean = false> = {
359
+ value: NullableUnlessRequired<CompetitorId, IsRequired>;
360
+ onChange?: (value: NullableUnlessRequired<CompetitorId, IsRequired>) => void;
361
+ /**
362
+ * Called when a competitor is picked from the menu.
363
+ */
364
+ onBlurChange?: (value: NullableUnlessRequired<CompetitorId, IsRequired>) => void;
365
+ required?: IsRequired;
366
+ competitorsMapped: CompetitorsMapped;
367
+ disabled?: boolean;
368
+ placeholder?: string;
369
+ className?: string;
370
+ inputClassName?: string;
371
+ onEnterKey?: () => void;
372
+ forbiddenCompetitorsRef?: RefObject<Set<CompetitorId>>;
373
+ };
374
+
375
+ export declare interface CompetitorsMapped {
376
+ byId: Map<CompetitorId, CompetitorDAO>;
377
+ byBib: Map<BIB, CompetitorDAO>;
378
+ }
379
+
380
+ export declare type CompetitorType = components['schemas']['CompetitorType'];
156
381
 
157
382
  declare interface components {
158
383
  schemas: {
@@ -1323,7 +1548,9 @@ declare interface components {
1323
1548
  kind: components["schemas"]["ExtensionKind"];
1324
1549
  };
1325
1550
  /** @enum {string} */
1326
- ExtensionError: "local-extension-not-found" | "failed-to-resolve-extension";
1551
+ ExtensionError: "local-extension-not-found" | "failed-to-resolve-extension" | "failed-to-start" | "invalid-identifier" | "crashed";
1552
+ /** @description A single path segment on every platform without control characters, so it is a safe directory name. */
1553
+ ExtensionIdentifier: string;
1327
1554
  ExtensionKind: {
1328
1555
  /** @constant */
1329
1556
  type: "local";
@@ -1334,9 +1561,19 @@ declare interface components {
1334
1561
  };
1335
1562
  ExtensionPathVariables_for_CommonWorkspaceId: {
1336
1563
  eventId: components["schemas"]["EventId"];
1337
- extensionIdentifier: string;
1564
+ extensionIdent: components["schemas"]["ExtensionIdentifier"];
1338
1565
  workspaceId: components["schemas"]["CommonWorkspaceId"];
1339
1566
  };
1567
+ ExtensionSecretDTO: {
1568
+ isSet: boolean;
1569
+ /** @description Locale, like `en`, to label */
1570
+ label: {
1571
+ [key: string]: string;
1572
+ };
1573
+ name: components["schemas"]["SecretName"];
1574
+ /** Format: date-time */
1575
+ updatedAt?: string | null;
1576
+ };
1340
1577
  /** @description Allows referencing an external resource for extended documentation. */
1341
1578
  ExternalDocumentation: {
1342
1579
  /**
@@ -2336,7 +2573,7 @@ declare interface components {
2336
2573
  /** Format: uint16 */
2337
2574
  InputIdx: InputIdx;
2338
2575
  InstallExtensionBody: {
2339
- identifier: string;
2576
+ identifier: components["schemas"]["ExtensionIdentifier"];
2340
2577
  kind: components["schemas"]["ExtensionKind"];
2341
2578
  };
2342
2579
  InstalledExtensionDTO: {
@@ -2441,6 +2678,10 @@ declare interface components {
2441
2678
  } | {
2442
2679
  operationId: string;
2443
2680
  });
2681
+ /** @description Links the entities a template was created from to its archive entries. */
2682
+ LinkToTemplateMutation: {
2683
+ wiring: components["schemas"]["Wiring"];
2684
+ };
2444
2685
  LoadArchiveQuery: {
2445
2686
  /**
2446
2687
  * @description What to do with a root format contained in the archive.
@@ -2448,6 +2689,9 @@ declare interface components {
2448
2689
  */
2449
2690
  rootFormat: components["schemas"]["RootFormatImport"];
2450
2691
  };
2692
+ LocalExtensionPath: {
2693
+ extensionIdent: components["schemas"]["ExtensionIdentifier"];
2694
+ };
2451
2695
  /**
2452
2696
  * Format: uint32
2453
2697
  * @description Identifies a type parameter within a type expression or node signature.
@@ -2640,6 +2884,10 @@ declare interface components {
2640
2884
  /** @constant */
2641
2885
  type: "unlink-from-template";
2642
2886
  data: components["schemas"]["UnlinkFromTemplateMutation"];
2887
+ } | {
2888
+ /** @constant */
2889
+ type: "link-to-template";
2890
+ data: components["schemas"]["LinkToTemplateMutation"];
2643
2891
  };
2644
2892
  LogEntrySmall: {
2645
2893
  description: string;
@@ -3788,7 +4036,6 @@ declare interface components {
3788
4036
  type: "unterminated-string";
3789
4037
  };
3790
4038
  PatchTableStateMutation: {
3791
- asOwner: components["schemas"]["TableOwnerDTO"];
3792
4039
  /** @description None resets the table state */
3793
4040
  state?: components["schemas"]["TableState"] | null;
3794
4041
  tableId: components["schemas"]["TableId"];
@@ -4456,6 +4703,17 @@ declare interface components {
4456
4703
  /** @description Additional external documentation for this schema. */
4457
4704
  externalDocs?: components["schemas"]["ExternalDocumentation"] | null;
4458
4705
  };
4706
+ /** @description Only `[a-z0-9-]`, at least one character. */
4707
+ SecretName: string;
4708
+ SecretPath: {
4709
+ extensionIdent: components["schemas"]["ExtensionIdentifier"];
4710
+ name: components["schemas"]["SecretName"];
4711
+ };
4712
+ /** @description At most 16 KiB. Its [Debug] does not show the value. */
4713
+ SecretValue: string;
4714
+ SecretValueBody: {
4715
+ value: components["schemas"]["SecretValue"];
4716
+ };
4459
4717
  /**
4460
4718
  * @description Defines a security scheme that can be used by the operations.
4461
4719
  * Supported schemes are HTTP authentication, an API key (either as a
@@ -4823,15 +5081,7 @@ declare interface components {
4823
5081
  nodeId: components["schemas"]["FormatNodeTestId"];
4824
5082
  };
4825
5083
  /** @enum {string} */
4826
- TableOwner: "none" | "nodes" | "user" | "race-office";
4827
- /**
4828
- * @description Same as [TableOwner] but without [TableOwner::None] and [TableOwner::Nodes] as users can't set these.
4829
- * @enum {string}
4830
- */
4831
- TableOwnerDTO: "user" | "race-office";
4832
- TableOwnerQuery: {
4833
- asOwner: components["schemas"]["TableOwnerDTO"];
4834
- };
5084
+ TableOwner: "nodes" | "user";
4835
5085
  TablePathVariables_for_CommonWorkspaceId: {
4836
5086
  eventId: components["schemas"]["EventId"];
4837
5087
  tableId: components["schemas"]["TableId"];
@@ -5360,7 +5610,6 @@ declare interface components {
5360
5610
  variant: components["schemas"]["TableVariant"];
5361
5611
  };
5362
5612
  UpdateTableRowsLayerOneMutation: {
5363
- asOwner: components["schemas"]["TableOwnerDTO"];
5364
5613
  rows: components["schemas"]["Rows_for_Sorted"];
5365
5614
  tableId: components["schemas"]["TableId"];
5366
5615
  };
@@ -5419,7 +5668,7 @@ declare interface components {
5419
5668
  * Besides the infer keyword, works almost exactly like conditional types in typescript.
5420
5669
  * Checkout [this doc](https://www.typescriptlang.org/docs/handbook/2/conditional-types.html) for a good guide on the ts conditionals.
5421
5670
  */
5422
- declare interface Conditional<T, R> {
5671
+ export declare interface Conditional<T, R> {
5423
5672
  tTest: TypeExpr<T, R>;
5424
5673
  tTestBound: TypeExpr<T, R>;
5425
5674
  tThen: TypeExpr<T, R>;
@@ -5430,21 +5679,67 @@ declare interface Conditional<T, R> {
5430
5679
  infer: LocalParamID[];
5431
5680
  }
5432
5681
 
5682
+ export declare function confirmDeleteItem(modalControls: ModalControls, itemName: string): Promise<boolean>;
5683
+
5433
5684
  /**
5434
5685
  * Named type arguments of a [`TypeExpr::Constructor`](crate::TypeExpr::Constructor).
5435
5686
  *
5436
5687
  * Duplicate keys last-win in place: the original insertion position is kept.
5437
5688
  */
5438
- declare type ConstructorParams<T, R = ParamRef> = Record<string, TypeExpr<T, R>>;
5689
+ export declare type ConstructorParams<T, R = ParamRef> = Record<string, TypeExpr<T, R>>;
5690
+
5691
+ export declare interface ContextWasm {
5692
+ values: Record<string, Value<Primitive>>;
5693
+ }
5439
5694
 
5440
5695
  export declare interface ContributionHandle<DTO> {
5441
5696
  beforeSubmit: (dto: DTO) => Promise<DTO | null>;
5442
5697
  }
5443
5698
 
5699
+ /** `createColumnHelper<AppTableFeatures, TData>()`, bound to `AppTable`'s feature registry. */
5700
+ export declare function createAppTableColumnHelper<TData extends RowData>(): ColumnHelper< {
5701
+ columnSizingFeature: TableFeature;
5702
+ rowSelectionFeature: TableFeature;
5703
+ rowSortingFeature: TableFeature;
5704
+ sortedRowModel: (table: Table_2<any, any>) => () => RowModel<any, any>;
5705
+ rowPaginationFeature: TableFeature;
5706
+ paginatedRowModel: (table: Table_2<any, any>) => () => RowModel<any, any>;
5707
+ columnVisibilityFeature: TableFeature;
5708
+ }, TData>;
5709
+
5710
+ export declare const DateTimeInput: FC<DateTimeInputProps>;
5711
+
5712
+ export declare interface DateTimeInputProps {
5713
+ value: Date | null;
5714
+ onChange?: (value: Date | null) => void;
5715
+ label?: string;
5716
+ disabled?: boolean;
5717
+ className?: string;
5718
+ /**
5719
+ * If true, empty input is accepted and mapped to null.
5720
+ * Default: false
5721
+ */
5722
+ allowEmpty?: boolean;
5723
+ readonly?: boolean;
5724
+ }
5725
+
5726
+ export declare const DateTimeText: FC<DateTimeTextProps>;
5727
+
5728
+ export declare interface DateTimeTextProps {
5729
+ value: Date | number | string;
5730
+ className?: string;
5731
+ }
5732
+
5444
5733
  declare interface DetailedSupertypeDiagnostics<T> {
5445
5734
  layers: NoSupertypeLayer<T>[];
5446
5735
  }
5447
5736
 
5737
+ export declare interface DialogButton<T> {
5738
+ value: T;
5739
+ label: string;
5740
+ theme?: 'primary' | 'default' | 'danger';
5741
+ }
5742
+
5448
5743
  /** Spelled out because the inferred `queryOptions` type references TanStack's unexported `dataTagSymbol`, which breaks the SDK's declaration rollup. */
5449
5744
  export declare type EngineQueryOptions<T> = UnusedSkipTokenOptions<T, Error, T, readonly unknown[]> & {
5450
5745
  queryKey: DataTag<readonly unknown[], T, Error>;
@@ -5462,6 +5757,20 @@ export declare interface EventPath {
5462
5757
  eventId: EventId;
5463
5758
  }
5464
5759
 
5760
+ export declare type ExportableValue = string | number | boolean | null | undefined;
5761
+
5762
+ export declare class ExpressionInContextWasm {
5763
+ private constructor();
5764
+ free(): void;
5765
+ [Symbol.dispose](): void;
5766
+ /**
5767
+ * Runs the expression with the provided primitive values.
5768
+ * @throws {ExpressionInContextError} if the expression is not valid or
5769
+ * the returned value is non primitive and thus not serializable.
5770
+ */
5771
+ run(context: ContextWasm): Value<Primitive>;
5772
+ }
5773
+
5465
5774
  export declare type ExtensionContribution<K extends keyof ExtensionContributions> = {
5466
5775
  /**
5467
5776
  * must be unique per type
@@ -5529,8 +5838,6 @@ export declare interface ExtensionSidebarContribution {
5529
5838
 
5530
5839
  export declare type ExtensionSidebarProps = EventPath;
5531
5840
 
5532
- declare type FieldInput<Field> = Field extends OptionalQueryField<infer Value> ? Value | null : Field extends RepeatedQueryField<infer Value> ? readonly Value[] : never;
5533
-
5534
5841
  declare interface FieldTypeWithDefault {
5535
5842
  fieldType: TypeExpr<Type>;
5536
5843
  /**
@@ -5539,15 +5846,19 @@ declare interface FieldTypeWithDefault {
5539
5846
  default: Value | null;
5540
5847
  }
5541
5848
 
5542
- declare type FieldValue<Field> = Field extends OptionalQueryField<infer Value> ? Value | null : Field extends RepeatedQueryField<infer Value> ? Value[] : never;
5849
+ /**
5850
+ * How a competitor is written out. Kept apart from the components that show competitors so both
5851
+ * the picker and the selector can reach it without importing each other.
5852
+ */
5853
+ export declare function formatCompetitorName(competitor: CompetitorDAO): string;
5543
5854
 
5544
5855
  declare type FormatGroupId = Brand<number, 'formatGroupId'>;
5545
5856
 
5546
5857
  declare type FormatId = Brand<number, 'formatId'>;
5547
5858
 
5548
- declare type FormatInstanceId = Brand<number, 'formatInstanceId'>;
5859
+ export declare type FormatInstanceId = Brand<number, 'formatInstanceId'>;
5549
5860
 
5550
- declare type FormatNodeId = Brand<string, 'formatNodeId'>;
5861
+ export declare type FormatNodeId = Brand<string, 'formatNodeId'>;
5551
5862
 
5552
5863
  declare type FormatNodeInstanceId = Brand<number, 'formatNodeInstanceId'>;
5553
5864
 
@@ -5555,12 +5866,14 @@ declare type FormatNodeTestId = Brand<string, 'formatNodeTestId'>;
5555
5866
 
5556
5867
  declare type FormatTestId = Brand<number, 'formatTestId'>;
5557
5868
 
5558
- declare type FormContribution<Props, DTO> = FC<Props & {
5869
+ export declare type FormContribution<Props, DTO> = FC<Props & {
5559
5870
  formFieldRegistry: FormFieldRegistry;
5560
5871
  ref: Ref<ContributionHandle<DTO>>;
5561
5872
  }>;
5562
5873
 
5563
- declare interface FormFieldMeta {
5874
+ export declare type FormFieldHookId = object;
5875
+
5876
+ export declare interface FormFieldMeta {
5564
5877
  /**
5565
5878
  * true if setValue has been called at least once since the last reset
5566
5879
  */
@@ -5586,7 +5899,7 @@ declare interface FormFieldMeta {
5586
5899
  reset: () => void;
5587
5900
  }
5588
5901
 
5589
- declare interface FormFieldProps<I, O = I> {
5902
+ export declare interface FormFieldProps<I, O = I> {
5590
5903
  /**
5591
5904
  * Used to check wether or not the mapped persisted value has changed
5592
5905
  * Default: `Object.is`
@@ -5601,9 +5914,9 @@ declare interface FormFieldProps<I, O = I> {
5601
5914
  map?: (value: I) => O;
5602
5915
  }
5603
5916
 
5604
- declare interface FormFieldRegistry {
5605
- registerFormField: (hookId: HookId, formField: FormFieldMeta) => void;
5606
- unregisterFormField: (hookId: HookId) => void;
5917
+ export declare interface FormFieldRegistry {
5918
+ registerFormField: (hookId: FormFieldHookId, formField: FormFieldMeta) => void;
5919
+ unregisterFormField: (hookId: FormFieldHookId) => void;
5607
5920
  /**
5608
5921
  * `useFormField` bound to this registry. Follows the rules of hooks:
5609
5922
  * only call it at the top level of a component or custom hook.
@@ -5621,15 +5934,15 @@ declare interface FormFieldRegistry {
5621
5934
  * `const [value, setValue, field] = useFormField(...);`
5622
5935
  * `<FormField {...field}>...</FormField>`
5623
5936
  */
5624
- declare type FormFieldState<T> = [value: T, setValue: (value: T | ((oldValue: T) => T)) => void, field: FormFieldMeta];
5937
+ export declare type FormFieldState<T> = [value: T, setValue: (value: T | ((oldValue: T) => T)) => void, field: FormFieldMeta];
5625
5938
 
5626
5939
  export declare type GameDAO = components['schemas']['GameDAO'];
5627
5940
 
5628
- declare type GameDTO = components['schemas']['GameDTO'];
5941
+ export declare type GameDTO = components['schemas']['GameDTO'];
5629
5942
 
5630
- declare type GameFormatDTO = components['schemas']['GameFormatDTO'];
5943
+ export declare type GameFormatDTO = components['schemas']['GameFormatDTO'];
5631
5944
 
5632
- declare type GameFormatId = Brand<number, 'gameFormatId'>;
5945
+ export declare type GameFormatId = Brand<number, 'gameFormatId'>;
5633
5946
 
5634
5947
  export declare type GameFormatPageContribution = FormContribution<GameFormatPageProps & {
5635
5948
  gameFormat: GameFormatDTO;
@@ -5651,25 +5964,48 @@ export declare type GamePageProps = EventPath & {
5651
5964
 
5652
5965
  export declare const gamesWithTablesMappedByEventQO: (workspaceId: CommonWorkspaceId, eventId: EventId) => EngineQueryOptions<Map<GameId, GameWithTables>>;
5653
5966
 
5654
- declare type GameWithTables = components['schemas']['GameWithTables'];
5967
+ export declare type GameWithTables = components['schemas']['GameWithTables'];
5655
5968
 
5656
5969
  export declare const getClassesByEventQO: (workspaceId: CommonWorkspaceId, eventId: EventId) => EngineQueryOptions<ClassResponse[]>;
5657
5970
 
5971
+ export declare const getCompetitorInTeamMappingAtQueryOptions: (workspaceId: CommonWorkspaceId, eventId: EventId, at: string) => EngineQueryOptions<CompetitorInTeamDAO[]>;
5972
+
5658
5973
  /**
5659
5974
  * @deprecated useCompetitorsMapped instead
5660
5975
  */
5661
5976
  export declare const getCompetitorsQO: (workspaceId: CommonWorkspaceId, eventId: EventId, competitorTypeFilter?: CompetitorType) => EngineQueryOptions<CompetitorDAO[]>;
5662
5977
 
5978
+ export declare const getGameTableResolvedByGameQO: (workspaceId: CommonWorkspaceId, eventId: EventId, gameID: GameId, tableKind: "EntryList" | "ResultList") => EngineQueryOptions<TableSortedDTO>;
5979
+
5663
5980
  /**
5664
5981
  * Location of a validation error in the graph.
5665
5982
  */
5666
5983
  declare type GraphLocation = { type: "Edge"; data: number } | { type: "InputPort"; data: { nodeIdx: number; inputIdx: number } };
5667
5984
 
5668
- declare type HookId = object;
5985
+ export declare const H1: FC<H1Props>;
5986
+
5987
+ export declare interface H1Props {
5988
+ children?: ReactNode;
5989
+ className?: string;
5990
+ }
5991
+
5992
+ export declare const H2: FC<H2Props>;
5993
+
5994
+ export declare interface H2Props {
5995
+ children?: ReactNode;
5996
+ className?: string;
5997
+ noMargin?: boolean;
5998
+ }
5999
+
6000
+ export declare function HR({ className }: HRProps): JSX.Element;
6001
+
6002
+ export declare type HRProps = {
6003
+ className?: string;
6004
+ };
5669
6005
 
5670
6006
  declare type InputIdx = Brand<number, 'inputIdx'>;
5671
6007
 
5672
- declare enum InputLayout {
6008
+ export declare enum InputLayout {
5673
6009
  Normal = 0,
5674
6010
  /**
5675
6011
  * Narrow field for tight UI (node ports, toolbars). Overrides the browser's ~20ch input min-width.
@@ -5679,23 +6015,37 @@ declare enum InputLayout {
5679
6015
  Fill = 2
5680
6016
  }
5681
6017
 
6018
+ export declare const LoadingOverlay: FC<LoadingOverlayProps>;
6019
+
6020
+ export declare type LoadingOverlayProps = {
6021
+ /** When true, children are dimmed and a centered loading indicator is shown. */
6022
+ active: boolean;
6023
+ children: ReactNode;
6024
+ /** Optional text shown below the spinner. */
6025
+ loadingText?: ReactNode;
6026
+ className?: string;
6027
+ };
6028
+
5682
6029
  export declare type Locales = 'de' | 'en';
5683
6030
 
5684
6031
  /**
5685
6032
  * Identifies a type parameter within a type expression or node signature.
5686
6033
  * Can be created from a single character (e.g. `'T'`) or a string (hashed for multi-char names).
5687
6034
  */
5688
- declare type LocalParamID = number;
6035
+ export declare type LocalParamID = number;
5689
6036
 
5690
6037
  declare type LogId = Brand<number, 'logId'>;
5691
6038
 
5692
- declare type Merge<A, B> = {
6039
+ export declare type MergePathParams<A, B> = {
5693
6040
  [K in keyof A | keyof B]: K extends keyof B ? B[K] : K extends keyof A ? A[K] : never;
5694
6041
  };
5695
6042
 
5696
6043
  export declare function Modal({ children, isOpen, onClose, closable, height, width, verticalPosition, horizontalPosition, lightbox, blockBackground, }: ModalProps): null;
5697
6044
 
5698
- declare interface ModalConfig {
6045
+ /** Modal inner body: explicit width; shell uses `width: 'fit'` and shrink-wraps to this. */
6046
+ export declare const modalBodyNarrow = "p-6 w-[min(500px,calc(100vw - 2rem))] min-w-0 md:min-w-[320px]";
6047
+
6048
+ export declare interface ModalConfig {
5699
6049
  id: string;
5700
6050
  content: ReactNode;
5701
6051
  closable?: boolean;
@@ -5708,12 +6058,12 @@ declare interface ModalConfig {
5708
6058
  onClose?: () => void;
5709
6059
  }
5710
6060
 
5711
- declare interface ModalControls {
6061
+ export declare interface ModalControls {
5712
6062
  open: (content: ReactNode, options?: Omit<ModalConfig, 'id' | 'content'>) => string;
5713
6063
  close: (id: string) => void;
5714
6064
  }
5715
6065
 
5716
- declare interface ModalProps {
6066
+ export declare interface ModalProps {
5717
6067
  children: ReactNode;
5718
6068
  isOpen: boolean;
5719
6069
  onClose: () => void;
@@ -5736,7 +6086,7 @@ declare interface ModalProps {
5736
6086
  * Function-like type for a node: generic parameters, inputs, outputs, and defaults.
5737
6087
  * Written in notation as `<T>(T) -> (T)` for the identity node.
5738
6088
  */
5739
- declare interface NodeSignature<T, R = ParamRef> {
6089
+ export declare interface NodeSignature<T, R = ParamRef> {
5740
6090
  /**
5741
6091
  * Generic parameters with their bounds and defaults.
5742
6092
  */
@@ -5793,19 +6143,46 @@ declare interface NoSupertypeLayer<T> {
5793
6143
 
5794
6144
  declare type NoSupertypeLayerReason = "UnknownTypeParam" | "NodeSignatureInputsVarg" | "NodeSignatureInputs" | "NodeSignatureOutputs" | "NodeSignatureTags" | "NodeSignatureRequiredTags" | "PortTypesVarg" | "PortTypesArity" | "PortTypesPort" | "Index" | "ConstructorArity" | "ConstructorParam";
5795
6145
 
5796
- declare type OperatorOf<T> = Extract<TypeOperators[keyof TypeOperators], [T, unknown]>[1];
6146
+ export declare function Note({ children, className }: NoteProps): JSX.Element;
5797
6147
 
5798
- declare interface OptionalQueryField<T> {
6148
+ export declare interface NoteProps {
6149
+ children: ReactNode;
6150
+ className?: string;
6151
+ }
6152
+
6153
+ /** `T` when `required` is true, otherwise `T | null`. */
6154
+ export declare type NullableUnlessRequired<T, Required extends boolean = false> = Required extends true ? T : T | null;
6155
+
6156
+ export declare type OperatorOf<T> = Extract<TypeOperators[keyof TypeOperators], [T, unknown]>[1];
6157
+
6158
+ declare interface Option_2<TVal> {
6159
+ label: React_2.ReactNode;
6160
+ value: TVal;
6161
+ disabled?: boolean;
6162
+ }
6163
+ export { Option_2 as Option }
6164
+
6165
+ export declare interface OptionalQueryField<T> {
5799
6166
  kind: 'optional';
5800
6167
  codec: QueryCodec<T>;
5801
6168
  }
5802
6169
 
5803
6170
  declare type OutputIdx = Brand<number, 'outputIdx'>;
5804
6171
 
6172
+ export declare const Page: FC<PageProps>;
6173
+
6174
+ export declare type PageProps = {
6175
+ children?: ReactNode;
6176
+ /** Standard content padding (less on mobile). Default true. It is exposed as `--page-px` / `--page-py`. */
6177
+ padding?: boolean;
6178
+ className?: string;
6179
+ style?: CSSProperties;
6180
+ };
6181
+
5805
6182
  /**
5806
6183
  * References a local type parameter. This is context sensitive because parameters are scoped.
5807
6184
  */
5808
- declare interface ParamRef {
6185
+ export declare interface ParamRef {
5809
6186
  paramId: LocalParamID;
5810
6187
  /**
5811
6188
  * If false, this reference will not be used to collect candidates for the parameter.
@@ -5814,19 +6191,37 @@ declare interface ParamRef {
5814
6191
  infer: boolean;
5815
6192
  }
5816
6193
 
5817
- declare interface ParsedQuery<Values> {
6194
+ export declare interface ParsedQuery<Values> {
5818
6195
  values: Values;
5819
6196
  /** The original search with malformed known values removed and valid values normalized. */
5820
6197
  canonicalSearch: string;
5821
6198
  malformedKeys: string[];
5822
6199
  }
5823
6200
 
5824
- declare type PathParams<Path extends string> = Path extends `${infer Base}/*` ? PathParams<Base> : Path extends `${infer _}/${infer Rest}` ? Merge<SegmentParam<_>, PathParams<Rest>> : SegmentParam<Path>;
6201
+ export declare type PathParams<Path extends string> = Path extends `${infer Base}/*` ? PathParams<Base> : Path extends `${infer _}/${infer Rest}` ? MergePathParams<PathSegmentParam<_>, PathParams<Rest>> : PathSegmentParam<Path>;
6202
+
6203
+ export declare type PathSegmentParam<S extends string> = S extends `:${infer P}` ? {
6204
+ [K in P]: number;
6205
+ } : S extends `$${infer P}` ? {
6206
+ [K in P]: string;
6207
+ } : Record<never, never>;
6208
+
6209
+ export declare type PersistedStateOptions = {
6210
+ /**
6211
+ * Where to persist the state.
6212
+ * Default: StorageType.Session
6213
+ */
6214
+ storage: StorageType;
6215
+ /**
6216
+ * Useful if the version of the data ever changes
6217
+ */
6218
+ version?: number;
6219
+ };
5825
6220
 
5826
6221
  /**
5827
6222
  * A list of port types, optionally with a variadic type (`...T`).
5828
6223
  */
5829
- declare interface PortTypes<T, R = ParamRef> {
6224
+ export declare interface PortTypes<T, R = ParamRef> {
5830
6225
  ports: TypeExpr<T, R>[];
5831
6226
  varg: TypeExpr<T, R> | null;
5832
6227
  }
@@ -5834,68 +6229,36 @@ declare interface PortTypes<T, R = ParamRef> {
5834
6229
  /**
5835
6230
  * Crate local version of [std::convert::Infallible]
5836
6231
  */
5837
- declare type Primitive = never;
5838
-
5839
- declare type Props = {
5840
- type?: AppButtonType;
5841
- onClick?: () => void;
5842
- disabled?: boolean;
5843
- /** Disabled while read-only (see `useIsReadonly`). */
5844
- mutates?: boolean;
5845
- children?: ReactNode;
5846
- submit?: boolean;
5847
- className?: string;
5848
- loading?: boolean;
5849
- value?: string;
5850
- ref?: RefObject<HTMLButtonElement | null>;
5851
- /** Makes the button a link to this route, so it can also be opened in a new tab. `onClick` runs before routing. */
5852
- href?: string;
5853
- };
6232
+ export declare type Primitive = never;
5854
6233
 
5855
- declare type Props_2 = {
5856
- label?: string;
5857
- description?: string;
5858
- value?: string;
5859
- onChange?: ChangeEventHandler<HTMLInputElement>;
5860
- onBlur?: FocusEventHandler<HTMLInputElement>;
5861
- onFocus?: FocusEventHandler<HTMLInputElement>;
5862
- onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
5863
- type?: HTMLInputTypeAttribute;
5864
- placeholder?: string;
5865
- required?: boolean;
5866
- maxLength?: number;
5867
- disabled?: boolean;
5868
- className?: string;
5869
- tabIndex?: number;
5870
- readonly?: boolean;
5871
- layout?: InputLayout;
5872
- inputRef?: React.RefObject<HTMLInputElement | null>;
5873
- endAdornment?: ReactNode;
5874
- autoFocus?: boolean;
5875
- };
6234
+ export declare function primValueToTypeExpr(value: Value<Primitive>): TypeExpr<Type, ParamRef>;
5876
6235
 
5877
- declare interface QueryCodec<T> {
6236
+ export declare interface QueryCodec<T> {
5878
6237
  parse(value: string): T | null;
5879
6238
  serialize(value: T): string;
5880
6239
  }
5881
6240
 
5882
- declare type QueryField = OptionalQueryField<unknown> | RepeatedQueryField<unknown>;
6241
+ export declare type QueryField = OptionalQueryField<unknown> | RepeatedQueryField<unknown>;
6242
+
6243
+ export declare type QueryFieldInput<Field> = Field extends OptionalQueryField<infer Value> ? Value | null : Field extends RepeatedQueryField<infer Value> ? readonly Value[] : never;
6244
+
6245
+ export declare type QueryFields = Record<string, QueryField>;
5883
6246
 
5884
- declare type QueryFields = Record<string, QueryField>;
6247
+ export declare type QueryFieldValue<Field> = Field extends OptionalQueryField<infer Value> ? Value | null : Field extends RepeatedQueryField<infer Value> ? Value[] : never;
5885
6248
 
5886
- declare type QueryInput<Schema extends AnyQuerySchema> = Schema extends QuerySchema<infer Fields> ? {
5887
- [Key in keyof Fields]?: FieldInput<Fields[Key]>;
6249
+ export declare type QueryInput<Schema extends AnyQuerySchema> = Schema extends QuerySchema<infer Fields> ? {
6250
+ [Key in keyof Fields]?: QueryFieldInput<Fields[Key]>;
5888
6251
  } : never;
5889
6252
 
5890
- declare interface QuerySchema<Fields extends QueryFields> {
6253
+ export declare interface QuerySchema<Fields extends QueryFields> {
5891
6254
  readonly fields: Fields;
5892
6255
  parse(search: string): ParsedQuery<{
5893
- [Key in keyof Fields]: FieldValue<Fields[Key]>;
6256
+ [Key in keyof Fields]: QueryFieldValue<Fields[Key]>;
5894
6257
  }>;
5895
6258
  serialize(input?: {
5896
- [Key in keyof Fields]?: FieldInput<Fields[Key]>;
6259
+ [Key in keyof Fields]?: QueryFieldInput<Fields[Key]>;
5897
6260
  }): string;
5898
- set<Key extends keyof Fields>(search: string, key: Key, value: FieldValue<Fields[Key]>): string;
6261
+ set<Key extends keyof Fields>(search: string, key: Key, value: QueryFieldValue<Fields[Key]>): string;
5899
6262
  }
5900
6263
 
5901
6264
  /**
@@ -5909,14 +6272,42 @@ declare interface RecordTypeWithDefaults {
5909
6272
  properties: Record<string, FieldTypeWithDefault>;
5910
6273
  }
5911
6274
 
5912
- declare type RecordValue<T = Primitive> = Record<string, Value<T>>;
6275
+ export declare type RecordValue<T = Primitive> = Record<string, Value<T>>;
5913
6276
 
5914
- declare interface RepeatedQueryField<T> {
6277
+ export declare function refocusWhenEnabled(input: HTMLInputElement | null | undefined, attempt?: number): void;
6278
+
6279
+ export declare interface RepeatedQueryField<T> {
5915
6280
  kind: 'repeated';
5916
6281
  codec: QueryCodec<T>;
5917
6282
  }
5918
6283
 
5919
- declare interface RouterContextType {
6284
+ export declare function ResizablePanel({ value, onChange, edge, min, max, hideWhenBelowMin, onClose, children, className, contentClassName, }: ResizablePanelProps): JSX.Element;
6285
+
6286
+ export declare interface ResizablePanelProps {
6287
+ /** Current size value (width for left/right, height for top/bottom) */
6288
+ value: number;
6289
+ /** Called when size changes during drag */
6290
+ onChange: (value: number) => void;
6291
+ /** Which edge has the drag handle */
6292
+ edge: ResizeEdge;
6293
+ /** Minimum size (optional) */
6294
+ min?: number;
6295
+ /** Maximum size (optional) */
6296
+ max?: number;
6297
+ /** When true, collapses to 0 when dragged below min and fires onClose on mouse release */
6298
+ hideWhenBelowMin?: boolean;
6299
+ /** Called when hideWhenBelowMin is true and user releases mouse below minimum */
6300
+ onClose?: () => void;
6301
+ children: React_2.ReactNode;
6302
+ /** Additional class names for the container */
6303
+ className?: string;
6304
+ /** Additional class names for the content wrapper */
6305
+ contentClassName?: string;
6306
+ }
6307
+
6308
+ export declare type ResizeEdge = 'left' | 'right' | 'top' | 'bottom';
6309
+
6310
+ export declare interface RouterContextType {
5920
6311
  /** The pathname used for route matching and persistence keys. */
5921
6312
  path: string;
5922
6313
  /** The complete reactive browser location. */
@@ -5934,7 +6325,7 @@ declare interface RouterContextType {
5934
6325
  unregister: (route: string) => void;
5935
6326
  }
5936
6327
 
5937
- declare interface RouterLocation {
6328
+ export declare interface RouterLocation {
5938
6329
  pathname: string;
5939
6330
  search: string;
5940
6331
  hash: string;
@@ -5952,6 +6343,18 @@ declare interface Row {
5952
6343
  columns: RecordValue;
5953
6344
  }
5954
6345
 
6346
+ export declare interface RowAction<T> {
6347
+ id: string;
6348
+ type?: AppButtonType;
6349
+ label: ReactNode | string;
6350
+ icon?: ReactNode;
6351
+ triggerSingle: (row: T) => void | Promise<void>;
6352
+ triggerMultiple?: (rows: T[]) => void | Promise<void>;
6353
+ supportsRow?: (row: T) => boolean;
6354
+ /** Stays available in read-only workspaces. */
6355
+ readOnlySafe?: boolean;
6356
+ }
6357
+
5955
6358
  declare type RowMutationId = Brand<number, 'rowMutationId'>;
5956
6359
 
5957
6360
  declare interface Rows<SortingState> {
@@ -5962,14 +6365,41 @@ declare interface Rows<SortingState> {
5962
6365
  rows: Row[];
5963
6366
  }
5964
6367
 
5965
- declare type SegmentParam<S extends string> = S extends `:${infer P}` ? {
5966
- [K in P]: number;
5967
- } : S extends `$${infer P}` ? {
5968
- [K in P]: string;
5969
- } : Record<never, never>;
6368
+ export declare enum RowState {
6369
+ /** The item is persisted in the backend as displayed and is managed by nodes. */
6370
+ Unchanged = 0,
6371
+ /** The item is persisted but updated in the ui. */
6372
+ Updated = 1,
6373
+ /** The item is persisted but deleted in the ui. */
6374
+ Deleted = 2,
6375
+ /** The item is not yet persisted. */
6376
+ Added = 3
6377
+ }
6378
+
6379
+ export declare function SearchInput({ value, onChange, placeholder, className }: SearchInputProps): JSX.Element;
6380
+
6381
+ export declare type SearchInputProps = {
6382
+ value: string;
6383
+ onChange: (value: string) => void;
6384
+ placeholder?: string;
6385
+ className?: string;
6386
+ };
5970
6387
 
5971
6388
  declare type SerializableNonPrimitiveValue = { type: "game-table"; data: Table<Unsorted_2, StateMetadata> } | { type: "game-table-sorted"; data: Table<Sorted_2, StateMetadata> } | { type: "row"; data: Row } | { type: "class"; data: number } | { type: "closure" };
5972
6389
 
6390
+ /**
6391
+ * A keyboard shortcut as the keys to press together, e.g. `['Mod', 'Shift', 'Z']`. `Mod` is Ctrl, or
6392
+ * Cmd on Apple platforms, matching handlers that read `ctrlKey || metaKey`. Pointer gestures
6393
+ * (`Click`, `Drag`, `Scroll`) are written like keys so they read the same way: "Shift+Click".
6394
+ */
6395
+ export declare type Shortcut = readonly string[];
6396
+
6397
+ /**
6398
+ * Shows a dialog that can be dismissed (ESC, click outside, or X button)
6399
+ * Returns the selected value or null if dismissed
6400
+ */
6401
+ export declare function showDialog<T>(modal: ModalControls, buttons: DialogButton<T>[], content: ReactNode): Promise<T | null>;
6402
+
5973
6403
  declare type Sorted = Brand<'sorted', 'sorted'>;
5974
6404
 
5975
6405
  /**
@@ -5988,22 +6418,91 @@ declare interface StateMetadata {
5988
6418
  state: TableState;
5989
6419
  }
5990
6420
 
6421
+ export declare enum StorageType {
6422
+ Session = 0,
6423
+ Local = 1
6424
+ }
6425
+
5991
6426
  /**
5992
6427
  * Combines rows with table attributes and state
5993
6428
  */
5994
6429
  declare type Table<SortingState, M = NoMetadata> = { rows: Rows<SortingState> } & M;
5995
6430
 
5996
- declare type TableId = Brand<number, 'tableId'>;
6431
+ export declare type TableId = Brand<number, 'tableId'>;
5997
6432
 
5998
6433
  declare type TableLineageId = Brand<number, 'tableLineageId'>;
5999
6434
 
6000
- declare type TableSorting = "unsorted" | "sorted";
6435
+ export declare interface TableProps<TData extends RowData> {
6436
+ data: TData[];
6437
+ columns: ColumnDef<AppTableFeatures, TData, unknown>[];
6438
+ actions?: RowAction<TData>[];
6439
+ allowSelect?: boolean;
6440
+ getRowId?: (row: TData, index: number) => string;
6441
+ getRowState?: (row: TData) => RowState;
6442
+ rowClicked?: (row: TData) => void;
6443
+ /**
6444
+ * Route a row leads to. Clicking the row routes there (after `rowClicked`); a middle or Ctrl click
6445
+ * opens it in a new tab.
6446
+ */
6447
+ rowHref?: (row: TData) => string;
6448
+ /**
6449
+ * Default: true
6450
+ */
6451
+ enableSorting?: boolean;
6452
+ /** Should be one of pageSizes */
6453
+ initialPageSize?: number;
6454
+ initialSorting?: SortingState;
6455
+ pageSizes?: number[];
6456
+ /**
6457
+ * ~Composer:
6458
+ * When true (default), TanStack Table resets the page index when `data` changes.
6459
+ * Set to false if edits replace the `data` array often but you want to keep the current page.
6460
+ */
6461
+ autoResetPageIndex?: boolean;
6462
+ /** Text to be displayed when there is no data */
6463
+ emptyTableText?: ReactNode;
6464
+ /**
6465
+ * When provided, shows a "Columns" toggle button above the table and persists column
6466
+ * visibility to localStorage under this key. Columns with `enableHiding: false` are excluded.
6467
+ */
6468
+ columnVisibilityStorageKey?: string;
6469
+ }
6470
+
6471
+ export declare type TableSortedDTO = components['schemas']['Table_for_Sorted_and_StateMetadata'];
6472
+
6473
+ export declare type TableSorting = "unsorted" | "sorted";
6001
6474
 
6002
6475
  declare type TableState = number;
6003
6476
 
6477
+ export declare type TimeDelta = components['schemas']['TimeDeltaSchema'];
6478
+
6479
+ export declare const TimeDeltaInput: FC<TimeDeltaInputProps>;
6480
+
6481
+ export declare interface TimeDeltaInputProps {
6482
+ value: TimeDelta;
6483
+ onChange?: (value: TimeDelta) => void;
6484
+ label?: string;
6485
+ className?: string;
6486
+ readonly?: boolean;
6487
+ }
6488
+
6004
6489
  export { toast }
6005
6490
 
6006
- declare type Type = { type: "integer"; data: { min: number | null; max: number | null } } | { type: "float" } | { type: "string"; data: string | null } | { type: "boolean" } | { type: "iterable" } | { type: "countable" } | { type: "comparable" } | { type: "sortable" } | { type: "unit" } | { type: "time-delta" } | { type: "date-time" } | { type: "date" } | { type: "primitive" } | { type: "competitor-id" } | { type: "array" } | { type: "record" } | { type: "table" } | { type: "row" } | { type: "table-sorting"; data: TableSorting } | { type: "class" };
6491
+ export declare type Type = { type: "integer"; data: { min: number | null; max: number | null } } | { type: "float" } | { type: "string"; data: string | null } | { type: "boolean" } | { type: "iterable" } | { type: "countable" } | { type: "comparable" } | { type: "sortable" } | { type: "unit" } | { type: "time-delta" } | { type: "date-time" } | { type: "date" } | { type: "primitive" } | { type: "competitor-id" } | { type: "array" } | { type: "record" } | { type: "table" } | { type: "row" } | { type: "table-sorting"; data: TableSorting } | { type: "class" };
6492
+
6493
+ /**
6494
+ * Can be parsed from string with the following syntax:
6495
+ *
6496
+ * `TypeContext ::= <Record> "->" <TypeExpr>`
6497
+ *
6498
+ * # Examples:
6499
+ * - `{a: Integer} -> Float`
6500
+ * - `{} -> Any`
6501
+ */
6502
+ export declare interface TypeContext {
6503
+ variables: Record<string, TypeExpr<Type, ParamRef>>;
6504
+ returnType: TypeExpr<Type, ParamRef>;
6505
+ }
6007
6506
 
6008
6507
  /**
6009
6508
  * Type expression—the core type representation in nodety.
@@ -6014,18 +6513,18 @@ declare type Type = { type: "integer"; data: { min: number | null; max: number |
6014
6513
  * [`PartialEq`], [`Eq`] and [`Hash`] are structural: `A | B` is not equal to `B | A`.
6015
6514
  * [`Eq`] and [`Hash`] are available when `T: Eq + Hash`.
6016
6515
  */
6017
- declare type TypeExpr<T, R = ParamRef> = { type: "Type"; data: T } | { type: "Constructor"; data: { inner: T; parameters: ConstructorParams<T, R> } } | { type: "Operation"; data: { a: TypeExpr<T, R>; operator: OperatorOf<T>; b: TypeExpr<T, R> } } | { type: "NodeSignature"; data: NodeSignature<T, R> } | { type: "PortTypes"; data: PortTypes<T, R> } | { type: "Union"; data: [TypeExpr<T, R>, TypeExpr<T, R>] } | { type: "KeyOf"; data: TypeExpr<T, R> } | { type: "Index"; data: { expr: TypeExpr<T, R>; index: TypeExpr<T, R> } } | { type: "Intersection"; data: [TypeExpr<T, R>, TypeExpr<T, R>] } | { type: "Conditional"; data: Conditional<T, R> } | { type: "Any" } | { type: "Never" } | { type: "Ref"; data: R };
6516
+ export declare type TypeExpr<T, R = ParamRef> = { type: "Type"; data: T } | { type: "Constructor"; data: { inner: T; parameters: ConstructorParams<T, R> } } | { type: "Operation"; data: { a: TypeExpr<T, R>; operator: OperatorOf<T>; b: TypeExpr<T, R> } } | { type: "NodeSignature"; data: NodeSignature<T, R> } | { type: "PortTypes"; data: PortTypes<T, R> } | { type: "Union"; data: [TypeExpr<T, R>, TypeExpr<T, R>] } | { type: "KeyOf"; data: TypeExpr<T, R> } | { type: "Index"; data: { expr: TypeExpr<T, R>; index: TypeExpr<T, R> } } | { type: "Intersection"; data: [TypeExpr<T, R>, TypeExpr<T, R>] } | { type: "Conditional"; data: Conditional<T, R> } | { type: "Any" } | { type: "Never" } | { type: "Ref"; data: R };
6018
6517
 
6019
6518
  declare type TypeExprValidationError = { type: "UnknownVar"; var: LocalParamID } | { type: "CyclicReference" };
6020
6519
 
6021
- declare interface TypeOperators { graphite: [Type, ArithmeticOperator] }
6520
+ export declare interface TypeOperators { graphite: [Type, ArithmeticOperator] }
6022
6521
 
6023
- declare interface TypeOperators {}
6522
+ export declare interface TypeOperators {}
6024
6523
 
6025
6524
  /**
6026
6525
  * A generic type parameter with optional bound and default.
6027
6526
  */
6028
- declare interface TypeParameter<T, R = ParamRef> {
6527
+ export declare interface TypeParameter<T, R = ParamRef> {
6029
6528
  /**
6030
6529
  * Upper bound (e.g. `T extends Comparable`).
6031
6530
  */
@@ -6041,7 +6540,7 @@ declare interface TypeParameter<T, R = ParamRef> {
6041
6540
  *
6042
6541
  * Exists so that it can implement traits like [std::str::FromStr]
6043
6542
  */
6044
- declare type TypeParameters<T, R = ParamRef> = Record<LocalParamID, TypeParameter<T, R>>;
6543
+ export declare type TypeParameters<T, R = ParamRef> = Record<LocalParamID, TypeParameter<T, R>>;
6045
6544
 
6046
6545
  declare type Unsorted = Brand<'unsorted', 'unsorted'>;
6047
6546
 
@@ -6054,11 +6553,37 @@ declare type Unsorted_2 = null;
6054
6553
  /** The engine's active locale. Extensions ship their own dictionaries and select them by it. */
6055
6554
  export declare function useEngineLocale(): Locales;
6056
6555
 
6556
+ /** Returns a `fetch` for `path` (relative, e.g. `"items"`) on the calling extension's own backend in the current event. */
6557
+ export declare function useExtensionBackend(): (path: string, init?: RequestInit) => Promise<Response>;
6558
+
6559
+ /** The identifier the calling extension is installed under, e.g. the key of its `extensionData`. */
6560
+ export declare function useExtensionIdentifier(): string;
6561
+
6562
+ export declare function useMediaQuery(query: string): boolean;
6563
+
6057
6564
  export declare function useModal(): ModalControls;
6058
6565
 
6566
+ /**
6567
+ * @todo Add a parameter to save stuff in localstorage or even better, per user
6568
+ *
6569
+ * Wrapper for useState with persistence in sessionstorage.
6570
+ * Only serializes and writes to sessionstorage on window.beforeunload
6571
+ *
6572
+ * @param storageKey Key used for persisting the state. Only the key passed
6573
+ * in the to the first call of usePersistedState is used. Consequent keys are discarded.
6574
+ * @param initialState The initial state. Equal to useStates initial value
6575
+ */
6576
+ export declare function usePersistedState<S>(storageKey: string, initialState: S | (() => S), { storage: storageType, version }?: PersistedStateOptions): [S, (newState: S | ((prev: S) => S)) => void];
6577
+
6059
6578
  /** Hook to use the router context. Must be called within a <Router> provider. */
6060
6579
  export declare function useRouter(): RouterContextType;
6061
6580
 
6581
+ /**
6582
+ * Validates the expression and returns a `ExpressionInContextWasm` if the expression is valid.
6583
+ * @throws {ValidateExpressionError} if the expression is not valid.
6584
+ */
6585
+ export declare function validateExpression(expression: string, context: TypeContext): ExpressionInContextWasm;
6586
+
6062
6587
  /**
6063
6588
  * A validation error with its location and kind.
6064
6589
  */
@@ -6069,7 +6594,19 @@ declare interface ValidationError<T> {
6069
6594
 
6070
6595
  declare type ValidationErrorKind<T> = { type: "TypeParameterBoundsExceeded" } | { type: "TagMissing"; data: number[] } | { type: "MultipleEdgesOnOneInput" } | { type: "EdgeMissingOnInput" } | { type: "EdgeHasNoSourceOutput" } | { type: "InsufficientlyInferredTypes" } | { type: "NonPortTypesIO" } | { type: "TypeExprValidationError"; data: TypeExprValidationError } | { type: "TypeMismatch"; data: DetailedSupertypeDiagnostics<T> };
6071
6596
 
6072
- declare type Value<T = Primitive> = { type: "unit" } | { type: "float"; data: number } | { type: "integer"; data: number } | { type: "string"; data: string } | { type: "boolean"; data: boolean } | { type: "array"; data: ArrayValue<T> } | { type: "record"; data: RecordValue<T> } | { type: "time-delta"; data: [number, number] } | { type: "date-time"; data: string } | { type: "date"; data: string } | { type: "non-primitive"; data: T };
6597
+ export declare type Value<T = Primitive> = { type: "unit" } | { type: "float"; data: number } | { type: "integer"; data: number } | { type: "string"; data: string } | { type: "boolean"; data: boolean } | { type: "array"; data: ArrayValue<T> } | { type: "record"; data: RecordValue<T> } | { type: "time-delta"; data: [number, number] } | { type: "date-time"; data: string } | { type: "date"; data: string } | { type: "non-primitive"; data: T };
6598
+
6599
+ /**
6600
+ * Turns a Value into an ExportableValue
6601
+ */
6602
+ export declare function valueIntoExportable(value: Value): ExportableValue;
6603
+
6604
+ export declare function Warning({ children, className }: WarningProps): JSX.Element;
6605
+
6606
+ export declare interface WarningProps {
6607
+ children: ReactNode;
6608
+ className?: string;
6609
+ }
6073
6610
 
6074
6611
  /**
6075
6612
  * Same as GameDTO but with gameFormatId optional
@@ -6078,8 +6615,8 @@ export declare type WorkingGameDTO = Omit<GameDTO, 'gameFormatId'> & {
6078
6615
  gameFormatId: GameFormatId | null;
6079
6616
  };
6080
6617
 
6081
- declare type WorkspaceRootId = Brand<number, 'workspaceRootId'>;
6618
+ export declare type WorkspaceRootId = Brand<number, 'workspaceRootId'>;
6082
6619
 
6083
- declare type WorkspaceSelfHostedId = Brand<number, 'workspaceSelfHostedId'>;
6620
+ export declare type WorkspaceSelfHostedId = Brand<number, 'workspaceSelfHostedId'>;
6084
6621
 
6085
6622
  export { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphite-sports/sdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "MIT",
5
5
  "repository": "github:Graphite-sports/starter-extension",
6
6
  "homepage": "https://github.com/Graphite-sports/starter-extension",
@@ -10,7 +10,10 @@
10
10
  "index.d.ts"
11
11
  ],
12
12
  "peerDependencies": {
13
+ "@headlessui/react": "^2.2.7",
13
14
  "@tanstack/react-query": "^5.90.7",
15
+ "@tanstack/react-table": "^9.2.4",
16
+ "@tanstack/table-core": "^9.2.4",
14
17
  "react": "^19.1.1",
15
18
  "react-hot-toast": "^2.6.0"
16
19
  }