Skip to content

Commit b9cb9e1

Browse files
kamilogoreksoedirgo
authored andcommitted
fix: Use explicit return type for from/schema/rpc
1 parent a5a70db commit b9cb9e1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/SupabaseClient.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export default class SupabaseClient<
130130
*
131131
* @param relation - The table or view name to query
132132
*/
133-
from(relation: string) {
133+
from(relation: string): ReturnType<PostgrestClient<Database, SchemaName>['from']> {
134134
return this.rest.from(relation)
135135
}
136136

@@ -142,7 +142,9 @@ export default class SupabaseClient<
142142
*
143143
* @param schema - The name of the schema to query
144144
*/
145-
schema<DynamicSchema extends string & keyof Database>(schema: DynamicSchema) {
145+
schema<DynamicSchema extends string & keyof Database>(
146+
schema: DynamicSchema
147+
): ReturnType<PostgrestClient<Database, SchemaName>['schema']> {
146148
return this.rest.schema<DynamicSchema>(schema)
147149
}
148150

@@ -174,7 +176,7 @@ export default class SupabaseClient<
174176
head?: boolean
175177
count?: 'exact' | 'planned' | 'estimated'
176178
}
177-
) {
179+
): ReturnType<PostgrestClient<Database, SchemaName>['rpc']> {
178180
return this.rest.rpc(fn, args, options)
179181
}
180182

0 commit comments

Comments
 (0)