From ba01a579b6e08e777334b42ae6fc2e9c5a9ddb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Fri, 13 Mar 2026 16:39:37 +0400 Subject: [PATCH] Update docs --- README.md | 7 ++ docs/README.md | 1 + docs/interfaces/PlacesClient.md | 138 ++++++++++++++++++++++++++++++++ docs/type-aliases/List.md | 9 +++ 4 files changed, 155 insertions(+) create mode 100644 docs/type-aliases/List.md diff --git a/README.md b/README.md index 04eeac8..d99bba3 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,12 @@ console.log(allPlaces); // List places for specific geohash prefixes (e.g. for a map view) const areaPlaces = await places.getPlaces(['u33d', 'u33e']); console.log(areaPlaces); + +// Create a list +await places.lists.create('favorites', 'My Favorites'); + +// Add a place to a list (requires list ID, place ID, and place geohash) +await places.lists.addPlace('favorites', 'place-id-123', 'u33dc0'); ``` ## API Reference @@ -52,3 +58,4 @@ console.log(areaPlaces); ### Type Aliases - [Place](docs/type-aliases/Place.md) +- [List](docs/type-aliases/List.md) diff --git a/docs/README.md b/docs/README.md index abc164d..5768872 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,6 +10,7 @@ ## Type Aliases +- [List](type-aliases/List.md) - [Place](type-aliases/Place.md) ## Variables diff --git a/docs/interfaces/PlacesClient.md b/docs/interfaces/PlacesClient.md index b247cbb..f455c71 100644 --- a/docs/interfaces/PlacesClient.md +++ b/docs/interfaces/PlacesClient.md @@ -6,6 +6,144 @@ # Interface: PlacesClient +## Properties + +### lists + +> **lists**: `object` + +#### addPlace() + +> **addPlace**(`listId`, `placeId`, `geohash`): `Promise`\<[`List`](../type-aliases/List.md)\> + +Add a place to a list. + +##### Parameters + +###### listId + +`string` + +The slug ID of the list. + +###### placeId + +`string` + +The ID of the place. + +###### geohash + +`string` + +The geohash of the place. + +##### Returns + +`Promise`\<[`List`](../type-aliases/List.md)\> + +#### create() + +> **create**(`id`, `title`, `color?`): `Promise`\<[`List`](../type-aliases/List.md)\> + +Create or update a list. + +##### Parameters + +###### id + +`string` + +The slug ID (e.g., "to-go"). + +###### title + +`string` + +Human readable title. + +###### color? + +`string` + +Optional hex color code. + +##### Returns + +`Promise`\<[`List`](../type-aliases/List.md)\> + +#### delete() + +> **delete**(`id`): `Promise`\<`void`\> + +Delete a list. + +##### Parameters + +###### id + +`string` + +The slug ID of the list. + +##### Returns + +`Promise`\<`void`\> + +#### get() + +> **get**(`id`): `Promise`\<[`List`](../type-aliases/List.md) \| `null`\> + +Get a single list by ID (slug). + +##### Parameters + +###### id + +`string` + +The slug ID of the list. + +##### Returns + +`Promise`\<[`List`](../type-aliases/List.md) \| `null`\> + +#### getAll() + +> **getAll**(): `Promise`\<[`List`](../type-aliases/List.md)[]\> + +Get all lists. + +##### Returns + +`Promise`\<[`List`](../type-aliases/List.md)[]\> + +Array of List objects. + +#### removePlace() + +> **removePlace**(`listId`, `placeId`): `Promise`\<[`List`](../type-aliases/List.md)\> + +Remove a place from a list. + +##### Parameters + +###### listId + +`string` + +The slug ID of the list. + +###### placeId + +`string` + +The ID of the place. + +##### Returns + +`Promise`\<[`List`](../type-aliases/List.md)\> + ## Methods ### get() diff --git a/docs/type-aliases/List.md b/docs/type-aliases/List.md new file mode 100644 index 0000000..3e9cfaf --- /dev/null +++ b/docs/type-aliases/List.md @@ -0,0 +1,9 @@ +[**@remotestorage/module-places**](../README.md) + +*** + +[@remotestorage/module-places](../README.md) / List + +# Type Alias: List + +> **List** = `FromSchema`\<*typeof* `listSchema`\> & `object`