From a63389582c136a3235f6abde9b074379ce908e0b Mon Sep 17 00:00:00 2001 From: Vasily Krakovetsky Date: Thu, 20 Apr 2023 14:11:53 +0300 Subject: [PATCH 1/4] add typings to package.json --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 5517781..d0d9238 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "lint": "eslint --ext .ts,.js,.vue --ignore-path .gitignore .", "lint:fix": "eslint --fix --ext .ts,.js,.vue --ignore-path .gitignore ." }, + "typings": "./dist/lib/main.d.ts", "peerDependencies": { "vue": "^3.0.5" }, From ed838ae2343d09223ba892f4fcec0ba3e5d63088 Mon Sep 17 00:00:00 2001 From: Vasily Krakovetsky Date: Thu, 20 Apr 2023 14:12:40 +0300 Subject: [PATCH 2/4] fix exports in main.d.ts --- lib/main.d.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/main.d.ts b/lib/main.d.ts index ef415c5..a77fb1e 100644 --- a/lib/main.d.ts +++ b/lib/main.d.ts @@ -5,3 +5,7 @@ declare module "@vue/runtime-core" { } } +export function useSupabase(): IVueSupabase; + +declare const supabasePlugin: IVueSupabase; +export default supabasePlugin; From bf673733562718665643c7bd076e676e7e9d14a2 Mon Sep 17 00:00:00 2001 From: Vasily Krakovetsky Date: Thu, 20 Apr 2023 14:13:23 +0300 Subject: [PATCH 3/4] fix options types --- lib/@types/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/@types/index.ts b/lib/@types/index.ts index ef8e5d1..d809b0b 100644 --- a/lib/@types/index.ts +++ b/lib/@types/index.ts @@ -1,8 +1,10 @@ import { App } from "vue"; +import type { SupabaseClientOptions } from "@supabase/supabase-js"; + export interface Params { supabaseUrl: string; supabaseKey: string; - options?: never; + options?: SupabaseClientOptions<'public'>; } export interface IVueSupabase { From 99ffd43a8c0608335a04b993dddb3a2bf7135c77 Mon Sep 17 00:00:00 2001 From: Vasily Krakovetsky Date: Thu, 20 Apr 2023 14:26:14 +0300 Subject: [PATCH 4/4] fix for useSupabase --- lib/main.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/main.d.ts b/lib/main.d.ts index a77fb1e..a16116b 100644 --- a/lib/main.d.ts +++ b/lib/main.d.ts @@ -1,11 +1,13 @@ import type { IVueSupabase } from "./@types"; +import type { SupabaseClient } from "@supabase/supabase-js"; + declare module "@vue/runtime-core" { interface ComponentCustomProperties { $supabase: IVueSupabase; } } -export function useSupabase(): IVueSupabase; +export function useSupabase(): SupabaseClient; declare const supabasePlugin: IVueSupabase; export default supabasePlugin;