/*! * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Microsoft Live Share SDK License. */ import { DisposeSharedStateAction, SetSharedStateAction } from "../types"; /** * Inspired by React's `useState` hook, `useSharedState` makes it easy to synchronize state in your app. * * @remarks * Values set through this state is automatically attached to a `SharedMap` that the `AzureProvider` * creates. If you are synchronizing complex data structures that multiple users will be setting simultaneously, * consider using an optimized hook for your data structure (e.g., `useSharedMap`, `useSharedString`, etc.). * This hook can only be used in a child component of `` or ``. * * @template S Typing for objects stored associated with the `uniqueKey`. * @param uniqueKey the unique key for a `SharedMap`. If you use the same key for multiple components, those components will reference the same state. * @param initialState a default state for the `SharedMap`. * * @returns a stateful value, the function to update it, and an optional dispose method to delete it from the `SharedMap`. */ export declare function useSharedState(uniqueKey: string, initialState: S): [S, SetSharedStateAction, DisposeSharedStateAction]; //# sourceMappingURL=useSharedState.d.ts.map