typed_links library

Classes

Adds __typename to each node of the operation.
BinaryReader
The BinaryReader is used to bring data back from the binary format on the disk.
BinaryWriter
The BinaryWriter is used to encode data to the binary format.
Box<E>
Boxes contain all of your data. In the browser, each box has its own IndexedDB database. On all other platforms, each Box is stored in a separate file in the Hive home directory.
BoxBase<E>
Boxes contain all of your data. In the browser, each box has its own IndexedDB database. On all other platforms, each Box is stored in a seperate file in the Hive home directory.
BoxCollection
BoxEvent
A event representing a change in a box.
Cache
CacheProxy
Provides an interface for interacting with the Cache from within UpdateCacheHandlers.
A terminating link that fetches the operation from the Cache, mapping the result to an OperationResponse.
CollectionBox<V>
represents a Box being part of a BoxCollection
Catches Exceptions in the link chain and converts them into data.
FetchPolicy
A terminating link that resolves an operation from the link or the cache based on the OperationRequest.fetchPolicy, possibly caching the response
FieldFunctionOptions
FieldPolicy<TExisting, TIncoming, TReadResult>
FragmentRequest<TData, TVars>
A terminating link which defers execution to the provided gql_link, mapping the result to an OperationResponse.
HiveAesCipher
Default encryption algorithm. Uses AES256 CBC with PKCS7 padding.
HiveCipher
Abstract cipher can be implemented to customize encryption.
HiveCollection<E extends HiveObjectMixin>
List containing HiveObjectMixins.
HiveField
Annotate all fields you want to persist with HiveField.
HiveInterface
The main API interface of Hive. Available through the Hive constant.
HiveList<E extends HiveObjectMixin>
Allows defining references to other HiveObjectMixins.
HiveObject
HiveType
Annotate classes with HiveType to generate a TypeAdapter.
JsonOperationRequest
A OperationRequest that parses the response into a Map<String, dynamic> this is useful for when you don't have a generated class for the operation or as an escape hatch for when you want to parse the response yourself.
LazyBox<E>
LazyBoxes don't keep the values in memory like normal boxes. Each time a value is read, it is loaded from the backend.
DocumentNode-based GraphQL execution interface
MemoryStore
Caches mutations in a hive box when offline and re-runs them when re-connected.
OperationRequest<TData, TVars>
OperationResponse<TData, TVars>
Encapsulates a GraphQL operation's response, with typed input and responses, and errors.
Returns the response stream from the next link in the chain, immediately emitting a response with the optimistic data.
Allows multiple requests to be made by adding requests to the requestController.
RequestSerializer
JSON Request serializer.
ResponseParser
JSON Response parser
Store
TypeAdapter<T>
Type adapters can be implemented to support non primitive values.
A fully typed implementation of gql_link
TypePolicy
TypeRegistry
TypeRegistries contain the TypeAdapters associated with a typeId.
Runs any specified UpdateCacheHandlers with a CacheProxy when a response is received from DataSource.Link or DataSource.Optimistic.

Enums

DataSource
HiveStorageBackendPreference
declares the preferred JS StorageBackend to be used

Mixins

HiveObjectMixin
Extend HiveObject to add useful methods to the objects you want to store in Hive

Properties

Hive HiveInterface
Global constant to access Hive.
final

Functions

jsonMapEquals(Object? a, Object? b) bool
compare two json-like objects for equality parameters must be either null, num, bool, String or a List or Map of these types this is an alternative too DeepCollectionEquality().equals, which is very slow and has O(n^2) complexity

Typedefs

CompactionStrategy = bool Function(int entries, int deletedEntries)
A function which decides when to compact a box.
FieldMergeFunction<TExisting, TIncoming> = TExisting Function(TExisting existing, TIncoming incoming, FieldFunctionOptions options)
FieldReadFunction<TExisting, TReadResult> = TReadResult Function(TExisting existing, FieldFunctionOptions options)
JsonEquals = bool Function(Object? a, Object? b)
a function that compares two json-like maps for deep equality more performant alternative to DeepCollectionEquality which has O(n^2) time complexity (where n is the level of nesting) but also very slow on flat maps
KeyComparator = int Function(dynamic key1, dynamic key2)
LinkExceptionHandler<TData, TVars> = void Function(OperationResponse<TData, TVars> response, EventSink<OperationResponse<TData, TVars>> sink)
LinkFunction = Stream<Response> Function(Request request, [NextLink? forward])
Link as a function
LinkRouter = Link Function(Request request)
A function which returns a Link based on contents Request
Type of the forward function
Type of the forward function
TypedLinkFunction = Stream<OperationResponse<TData, TVars>> Function<TData, TVars>(OperationRequest<TData, TVars> request, [NextTypedLink<TData, TVars>? forward])
TypedLink as a function
TypedLinkRouter<TData, TVars> = TypedLink Function(OperationRequest<TData, TVars> request)
A function which returns a TypedLink based on contents of request
UpdateCacheHandler<TData, TVars> = void Function(CacheProxy proxy, OperationResponse<TData, TVars> response)
Updates the cache after receiving an OperationResponse.

Exceptions / Errors

ContextReadException
Exception occurring when reading from the context
ContextWriteException
Exception occurring when writing to the context
HiveError
An error related to Hive.
LinkException
A base class for exceptions thrown by links
RequestFormatException
Exception occurring when a terminating link tries to serialize the request
ResponseFormatException
Exception occurring when a terminating link tries to parse the response
ServerException
Exception occurring when network fails or parsed response is missing both data and errors
TypedLinkException
A base class for exceptions thrown by TypedLinks