This commit is contained in:
2026-03-13 16:41:55 +04:00
parent 1f8c076051
commit 90b7b1cf01
4 changed files with 200 additions and 3 deletions

79
dist/places.d.ts vendored
View File

@@ -57,6 +57,48 @@ declare const placeSchema: {
};
readonly required: readonly ["id", "title", "lat", "lon", "geohash", "createdAt"];
};
declare const listSchema: {
readonly type: "object";
readonly properties: {
readonly id: {
readonly type: "string";
};
readonly title: {
readonly type: "string";
};
readonly color: {
readonly type: "string";
};
readonly placeRefs: {
readonly type: "array";
readonly items: {
readonly type: "object";
readonly properties: {
readonly id: {
readonly type: "string";
};
readonly geohash: {
readonly type: "string";
};
};
readonly required: readonly ["id", "geohash"];
};
readonly default: readonly [];
};
readonly createdAt: {
readonly type: "string";
readonly format: "date-time";
};
readonly updatedAt: {
readonly type: "string";
readonly format: "date-time";
};
};
readonly required: readonly ["id", "title", "placeRefs", "createdAt"];
};
export type List = FromSchema<typeof listSchema> & {
[key: string]: any;
};
/**
* Represents a Place object.
*
@@ -126,6 +168,43 @@ export interface PlacesClient {
* @returns An array of places.
*/
getPlaces(prefixes?: string[]): Promise<Place[]>;
lists: {
/**
* Get all lists.
* @returns Array of List objects.
*/
getAll(): Promise<List[]>;
/**
* Get a single list by ID (slug).
* @param id - The slug ID of the list.
*/
get(id: string): Promise<List | null>;
/**
* Create or update a list.
* @param id - The slug ID (e.g., "to-go").
* @param title - Human readable title.
* @param color - Optional hex color code.
*/
create(id: string, title: string, color?: string): Promise<List>;
/**
* Delete a list.
* @param id - The slug ID of the list.
*/
delete(id: string): Promise<void>;
/**
* Add a place to a list.
* @param listId - The slug ID of the list.
* @param placeId - The ID of the place.
* @param geohash - The geohash of the place.
*/
addPlace(listId: string, placeId: string, geohash: string): Promise<List>;
/**
* Remove a place from a list.
* @param listId - The slug ID of the list.
* @param placeId - The ID of the place.
*/
removePlace(listId: string, placeId: string): Promise<List>;
};
}
declare const _default: {
name: string;