Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -133,7 +135,7 @@ export class Table<T> extends Selection<T> {
* @param key Primary key value
* @returns Single document selection
*/
public get(key: string) {
public get(key: ValueProxyOrValue<string>) {
return this.stage(SingleSelection<T>, "get", undefined, key);
}

Expand All @@ -145,7 +147,7 @@ export class Table<T> extends Selection<T> {
* @returns Multiple document selection
*/
public getAll(
keys: string | number | boolean | (string | number | boolean)[],
keys: ValueProxyOrValue<SelectionKey> | ValueProxyOrValue<SelectionKey>[],
index?: string,
) {
return this.stage(Selection<T>, "getAll", { index }, keys);
Expand Down
Loading