Skip to content

Commit dda6ff7

Browse files
authored
fix(index.d.ts): add string to useQuery query types (#17)
1 parent 66feb68 commit dda6ff7

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export type Entity = {
88
export function HomebaseProvider(props: {config?:config, children:any}): any;
99
export function useTransact(): [(transaction:Transaction) => any];
1010
export function useEntity(lookup: object | number): [Entity];
11-
export function useQuery(query: object, ...args: any): [Array<Entity>];
11+
export function useQuery(query: object | string, ...args: any): [Array<Entity>];

types/tests/index.test-d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ expectType<[Entity]>(useEntity(1));
1212
expectError(useEntity());
1313

1414
expectType<[Entity[]]>(useQuery({}));
15-
expectError(useQuery("d"));
15+
expectType<[Entity[]]>(useQuery("a datalog query could live here"));
16+
expectError(useQuery(1));

0 commit comments

Comments
 (0)