Skip to content

Commit

Permalink
refactor: use items instead of data
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 11, 2024
1 parent 8f9e09c commit a2a4ab4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/1.guide/1.index.md
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ await storage.getItem<string>("k"); // => <string | null>

```ts
type StorageDefinition = {
data: {
items: {
foo: string;
baz: number;
}
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ export interface Driver<OptionsT = any, InstanceT = any> {
}

type StorageDefinition = {
data: unknown;
items: unknown;
[key: string]: unknown;
};

type StorageItemMap<T extends StorageDefinition> = T["data"];
type StorageItemMap<T extends StorageDefinition> = T["items"];

export interface Storage<T extends StorageValue = StorageValue> {
// Item
Expand Down
2 changes: 1 addition & 1 deletion test/storage.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe("types", () => {
b: boolean;
};
type MyStorage = {
data: {
items: {
foo: string;
bar: number;
baz: TestObjType;
Expand Down

0 comments on commit a2a4ab4

Please sign in to comment.