Skip to content

Commit fbb9615

Browse files
committed
fix open tab types
1 parent dd6fc90 commit fbb9615

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/commonTypes.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,11 @@ export type WindowEventInits =
1919
| MouseEventInit
2020
| KeyboardEventInit
2121
| PointerEventInit;
22+
23+
export type TableFilter = {
24+
field: string;
25+
type: "=" | "!=" | "like" | "not like" | "<" | "<=" | ">" | ">=" | "in" | "is" | "is not";
26+
value?: string | string[];
27+
op?: 'AND' | 'OR';
28+
}
29+

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ export async function setEncryptedData<T>(keyOrValue: string | T, value?: T): Pr
120120
}
121121
}
122122

123-
export async function openTab(type: "query", args: Omit<OpenQueryTabRequest['args'], 'type'>): Promise<OpenTabResponse>;
123+
export async function openTab(type: "query", args?: Omit<OpenQueryTabRequest['args'], 'type'>): Promise<OpenTabResponse>;
124124
export async function openTab(type: "tableTable", args: Omit<OpenTableTableTabRequest['args'], 'type'>): Promise<OpenTabResponse>;
125125
export async function openTab(type: "tableStructure", args: Omit<OpenTableStructureTabRequest['args'], 'type'>): Promise<OpenTabResponse>;
126-
export async function openTab(type: OpenTabRequest['args']['type'], args: Omit<OpenTabRequest['args'], 'type'>): Promise<OpenTabResponse> {
126+
export async function openTab(type: OpenTabRequest['args']['type'], args?: Omit<OpenTabRequest['args'], 'type'>): Promise<OpenTabResponse> {
127127
return await request({ name: "openTab", args: { type, ...args } });
128128
}
129129

src/requestTypes.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { QueryResult } from "./commonTypes";
1+
import { QueryResult, TableFilter } from "./commonTypes";
22

33
interface BaseRequest {
44
id: string;
@@ -115,7 +115,7 @@ export type OpenQueryTabRequest = BaseRequest & {
115115
name: "openTab";
116116
args: {
117117
type: "query";
118-
query: string;
118+
query?: string;
119119
};
120120
}
121121

@@ -125,6 +125,7 @@ export type OpenTableTableTabRequest = BaseRequest & {
125125
type: "tableTable";
126126
table: string;
127127
schema?: string;
128+
filters?: TableFilter[];
128129
};
129130
}
130131

0 commit comments

Comments
 (0)