diff --git a/src/selection.ts b/src/selection.ts index 4f80a45..4930112 100644 --- a/src/selection.ts +++ b/src/selection.ts @@ -7,7 +7,9 @@ import type { import { Datum } from "./datum"; import { Query } from "./query"; import { Stream } from "./stream"; -import { ValueProxy } from "./valueproxy"; +import { ValueProxy, type ValueProxyOrValue } from "./valueproxy"; + +type SelectionKey = string | number | boolean; /** * Selection containing a single element @@ -133,7 +135,7 @@ export class Table extends Selection { * @param key Primary key value * @returns Single document selection */ - public get(key: string) { + public get(key: ValueProxyOrValue) { return this.stage(SingleSelection, "get", undefined, key); } @@ -145,7 +147,7 @@ export class Table extends Selection { * @returns Multiple document selection */ public getAll( - keys: string | number | boolean | (string | number | boolean)[], + keys: ValueProxyOrValue | ValueProxyOrValue[], index?: string, ) { return this.stage(Selection, "getAll", { index }, keys);