Update docs
This commit is contained in:
@@ -41,6 +41,12 @@ console.log(allPlaces);
|
|||||||
// List places for specific geohash prefixes (e.g. for a map view)
|
// List places for specific geohash prefixes (e.g. for a map view)
|
||||||
const areaPlaces = await places.getPlaces(['u33d', 'u33e']);
|
const areaPlaces = await places.getPlaces(['u33d', 'u33e']);
|
||||||
console.log(areaPlaces);
|
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
|
## API Reference
|
||||||
@@ -52,3 +58,4 @@ console.log(areaPlaces);
|
|||||||
### Type Aliases
|
### Type Aliases
|
||||||
|
|
||||||
- [Place](docs/type-aliases/Place.md)
|
- [Place](docs/type-aliases/Place.md)
|
||||||
|
- [List](docs/type-aliases/List.md)
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
## Type Aliases
|
## Type Aliases
|
||||||
|
|
||||||
|
- [List](type-aliases/List.md)
|
||||||
- [Place](type-aliases/Place.md)
|
- [Place](type-aliases/Place.md)
|
||||||
|
|
||||||
## Variables
|
## Variables
|
||||||
|
|||||||
@@ -6,6 +6,144 @@
|
|||||||
|
|
||||||
# Interface: PlacesClient
|
# 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
|
## Methods
|
||||||
|
|
||||||
### get()
|
### get()
|
||||||
|
|||||||
9
docs/type-aliases/List.md
Normal file
9
docs/type-aliases/List.md
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[**@remotestorage/module-places**](../README.md)
|
||||||
|
|
||||||
|
***
|
||||||
|
|
||||||
|
[@remotestorage/module-places](../README.md) / List
|
||||||
|
|
||||||
|
# Type Alias: List
|
||||||
|
|
||||||
|
> **List** = `FromSchema`\<*typeof* `listSchema`\> & `object`
|
||||||
Reference in New Issue
Block a user