From 1a6670ded5d7103c0d2e1d40cb031dfe7501b5cf Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Mon, 25 Sep 2023 15:07:20 -0400 Subject: [PATCH 1/2] fix(storage): Rename type Writeable to Writable --- .changeset/serious-comics-lick.md | 5 +++++ README.md | 4 ++-- docs/cookbook.md | 4 ++-- docs/packages/storage.md | 10 +++++----- docs/what-is-zarrita.md | 2 +- packages/storage/src/types.ts | 10 +++++----- 6 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 .changeset/serious-comics-lick.md diff --git a/.changeset/serious-comics-lick.md b/.changeset/serious-comics-lick.md new file mode 100644 index 00000000..b068a762 --- /dev/null +++ b/.changeset/serious-comics-lick.md @@ -0,0 +1,5 @@ +--- +"@zarrita/storage": minor +--- + +fix(storage): rename storage type Writeable to Writable diff --git a/README.md b/README.md index 7641ebe0..c59436db 100644 --- a/README.md +++ b/README.md @@ -85,14 +85,14 @@ classDiagram class core { - open(store: Readable) - - create(store: Writeable) + - create(store: Writable) - zarr.Array and zarr.Group - access and decode individual chunks } class storage { - Readable - - Writeable + - Writable - Map() - FetchStore() - FileSystemStore() diff --git a/docs/cookbook.md b/docs/cookbook.md index 2ece5735..b34f2e04 100644 --- a/docs/cookbook.md +++ b/docs/cookbook.md @@ -58,7 +58,7 @@ const arr = await zarr.open.v2(store, { kind: "array" }); ## Create an Array -Requires the `store` to implement `Writeable`. +Requires the `store` to implement `Writable`. ```js import * as zarr from "zarrita"; @@ -75,7 +75,7 @@ arr; // zarr.Array<"int32", FileSystemStore> ## Create a Group -Requires the `store` to implement `Writeable`. +Requires the `store` to implement `Writable`. ```js import * as zarr from "zarrita"; diff --git a/docs/packages/storage.md b/docs/packages/storage.md index e867e7b4..93c50ab4 100644 --- a/docs/packages/storage.md +++ b/docs/packages/storage.md @@ -25,19 +25,19 @@ interface AsyncReadable { } ``` -and may optionally implement `Writeable` or `AsyncWriteable`: +and may optionally implement `Writable` or `AsyncWritable`: ```typescript -interface Writeable { +interface Writable { set(key: string, value: Uint8Array): void; } -interface AsyncWriteable { +interface AsyncWritable { set(key: string, value: Uint8Array): Promise; } ``` -That's it! `Readable`/`Writeable` are enough to allow an +That's it! `Readable`/`Writable` are enough to allow an [ES6 Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) to serve as the most basic backend, while also facilitating developers in creating their custom stores as needed. @@ -69,7 +69,7 @@ const store = new FetchStore("http://localhost:8080/data.zarr", { }); ``` -### FileSystemStore +### FileSystemStore Designed for JavaScript runtimes with file system access, the The **FileSystemStore** is designed for JavaScript runtimes with file system access diff --git a/docs/what-is-zarrita.md b/docs/what-is-zarrita.md index 0ed4e670..487d9ab7 100644 --- a/docs/what-is-zarrita.md +++ b/docs/what-is-zarrita.md @@ -32,7 +32,7 @@ Zarr. ### [@zarrita/storage](/packages/storage) - A collection of useful of storage backends for Zarr. -- Implement your own `Readable` and (optionally `Writeable`) stores. +- Implement your own `Readable` and (optionally `Writable`) stores. ### [@zarrita/core](/packages/core) diff --git a/packages/storage/src/types.ts b/packages/storage/src/types.ts index 8200b0ee..61f4f6ab 100644 --- a/packages/storage/src/types.ts +++ b/packages/storage/src/types.ts @@ -33,20 +33,20 @@ export interface SyncReadable { ): Uint8Array | undefined; } -export type Writeable = AsyncWriteable | SyncWriteable; -export interface AsyncWriteable { +export type Writable = AsyncWritable | SyncWritable; +export interface AsyncWritable { set(key: AbsolutePath, value: Uint8Array): Promise; } -export interface SyncWriteable { +export interface SyncWritable { set(key: AbsolutePath, value: Uint8Array): void; } export type AsyncMutable = & AsyncReadable - & AsyncWriteable; + & AsyncWritable; export type SyncMutable = & SyncReadable - & SyncWriteable; + & SyncWritable; export type Mutable = | AsyncMutable | SyncMutable; From 58b801d6db730d256c9ebb1484d475e4a6c7d7e9 Mon Sep 17 00:00:00 2001 From: Trevor Manz Date: Mon, 25 Sep 2023 15:08:45 -0400 Subject: [PATCH 2/2] formatting --- .changeset/serious-comics-lick.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/serious-comics-lick.md b/.changeset/serious-comics-lick.md index b068a762..f151e91c 100644 --- a/.changeset/serious-comics-lick.md +++ b/.changeset/serious-comics-lick.md @@ -2,4 +2,4 @@ "@zarrita/storage": minor --- -fix(storage): rename storage type Writeable to Writable +fix(storage): Rename storage type `Writeable` to `Writable`