···11+# `#/storage`
22+33+## Usage
44+55+Import the correctly scoped store from `#/storage`. Each instance of `Storage`
66+(the base class, not to be used directly), has the following interface:
77+88+- `set([...scope, key], value)`
99+- `get([...scope, key])`
1010+- `remove([...scope, key])`
1111+- `removeMany([...scope], [...keys])`
1212+1313+For example, using our `device` store looks like this, since it's scoped to the
1414+device (the most base level scope):
1515+1616+```typescript
1717+import { device } from '#/storage';
1818+1919+device.set(['foobar'], true);
2020+device.get(['foobar']);
2121+device.remove(['foobar']);
2222+device.removeMany([], ['foobar']);
2323+```
2424+2525+## TypeScript
2626+2727+Stores are strongly typed, and when setting a given value, it will need to
2828+conform to the schemas defined in `#/storage/schema`. When getting a value, it
2929+will be returned to you as the type defined in its schema.
3030+3131+## Scoped Stores
3232+3333+Some stores are (or might be) scoped to an account or other identifier. In this
3434+case, storage instances are created with type-guards, like this:
3535+3636+```typescript
3737+type AccountSchema = {
3838+ language: `${string}-${string}`;
3939+};
4040+4141+type DID = `did:${string}`;
4242+4343+const account = new Storage<
4444+ [DID],
4545+ AccountSchema
4646+>({
4747+ id: 'account',
4848+});
4949+5050+account.set(
5151+ ['did:plc:abc', 'language'],
5252+ 'en-US',
5353+);
5454+5555+const language = account.get([
5656+ 'did:plc:abc',
5757+ 'language',
5858+]);
5959+```
6060+6161+Here, if `['did:plc:abc']` is not supplied along with the key of
6262+`language`, the `get` will return undefined (and TS will yell at you).