# SyGridState

Fields, allowed values, and APIs that use SyGridState.

Canonical: https://grid.syidax.com/docs/types/SyGridState/

<a id="definition"></a>

## Type definition

A question mark (?) marks an optional field; readonly marks a value you should not change directly. A union (|) accepts one of the listed forms. Functions are callbacks that Grid invokes at the relevant point.

```typescript
export interface SyGridState {
  readonly version: SyGridStateVersion;
  readonly slices: Readonly<Partial<Record<SyGridStateSliceKey, unknown>>>;
}
```

<a id="used-by"></a>

## APIs using this type

- [initialState](https://grid.syidax.com/docs/options/initialState.md) — Versioned view state applied once during initial Grid setup. Use setState for runtime restoration.
- [getState](https://grid.syidax.com/docs/methods/getState.md) — Reads an immutable, versioned snapshot of the complete view state. Does not back up source row data.
- [setState](https://grid.syidax.com/docs/methods/setState.md) — Restores complete or selected state slices and returns applied/issue reports. Only slices in appliedSlices were actually applied.

<a id="parents"></a>

## Contracts containing this type

- [SyGridImperativeMethods](https://grid.syidax.com/docs/types/SyGridImperativeMethods.md)
- [SyGridPreDestroyedDetail](https://grid.syidax.com/docs/types/SyGridPreDestroyedDetail.md)

<a id="related"></a>

## Related types

- [SyGridStateVersion](https://grid.syidax.com/docs/types/SyGridStateVersion.md)
- [SyGridStateSliceKey](https://grid.syidax.com/docs/types/SyGridStateSliceKey.md)
